Wasabi ExpressPlay SDK for iOS
1.10
Main Page
Modules
Data Structures
Files
File List
Globals
Client
Source
Interface
Core
WsbMediaStream.h
Go to the documentation of this file.
1
/*****************************************************************
2
|
3
| Wasabi - Media Stream API
4
|
5
| $Id: WsbMediaStream.h 11001 2014-09-16 20:43:39Z gilles $
6
| Original author: Edin Hodzic (dino@concisoft.com)
7
|
8
| This software is provided to you pursuant to your agreement
9
| with Intertrust Technologies Corporation ("Intertrust").
10
| This software may be used only in accordance with the terms
11
| of the agreement.
12
|
13
| Copyright (c) 2013-2014 by Intertrust. All rights reserved.
14
|
15
****************************************************************/
21
#ifndef _WSB_MEDIA_STREAM_H_
22
#define _WSB_MEDIA_STREAM_H_
23
24
/*----------------------------------------------------------------------
25
| includes
26
+---------------------------------------------------------------------*/
27
#include "
WsbResults.h
"
28
#include "
WsbTypes.h
"
29
30
/*----------------------------------------------------------------------
31
| macros
32
+---------------------------------------------------------------------*/
33
#define WSB_MEDIASTREAM_CONTENT_TYPE_DCF "application/vnd.oma.drm.dcf"
34
#define WSB_MEDIASTREAM_CONTENT_TYPE_AES128CBC "application/vnd.intertrust.drm.aes128.cbc"
35
36
/*----------------------------------------------------------------------
37
| WSB_MediaStream_Interface
38
+---------------------------------------------------------------------*/
44
typedef
struct
WSB_MediaStream
WSB_MediaStream
;
45
typedef
struct
WSB_KeyManager
WSB_MediaStreamKey
;
46
typedef
struct
{
48
WSB_Result
(*Read)(
WSB_MediaStream
*
self
,
void
* buffer,
WSB_Size
* read_bytes);
50
WSB_Result
(*Seek)(
WSB_MediaStream
*
self
,
WSB_Position
position);
52
WSB_Result
(*Tell)(
WSB_MediaStream
*
self
,
WSB_Position
* position);
54
WSB_Result
(*GetSize)(
WSB_MediaStream
*
self
,
WSB_LargeSize
* size);
56
WSB_Result
(*GetContentType)(
WSB_MediaStream
*
self
,
const
char
** content_type);
60
WSB_Result
(*GetKey)(
WSB_MediaStream
*
self
,
const
WSB_MediaStreamKey
** key);
62
WSB_Result
(*Close)(
WSB_MediaStream
*
self
);
63
}
WSB_MediaStreamInterface
;
64
65
/*----------------------------------------------------------------------
66
| WSB_MediaStream
67
+---------------------------------------------------------------------*/
68
struct
WSB_MediaStream
{
69
WSB_MediaStreamInterface
*
iface
;
70
};
71
72
/*----------------------------------------------------------------------
73
| WSB_MediaStream_SourceType
74
+---------------------------------------------------------------------*/
75
typedef
enum
{
79
WSB_MEDIASTREAM_SOURCE_TYPE_DCF
,
80
88
WSB_MEDIASTREAM_SOURCE_TYPE_AES128CBC
89
}
WSB_MediaStream_SourceType
;
90
91
/*----------------------------------------------------------------------
92
| WSB_MediaStream_FormatInfo
93
+---------------------------------------------------------------------*/
98
typedef
union
{
99
struct
WSB_MediaStream_FormatInfo_Common
{
105
const
char
*
content_id
;
106
112
const
char
*
ms3_url
;
113
120
const
WSB_MediaStreamKey
*
key
;
121
125
const
char
*
license_data
;
126
130
WSB_Size
license_data_size
;
131
145
const
WSB_Byte
*
iv
;
146
159
WSB_LargeSize
clear_text_size
;
160
161
} common;
162
}
WSB_MediaStream_FormatInfo
;
163
164
165
#ifdef __cplusplus
166
extern
"C"
{
167
#elif 0
168
}
169
#endif
170
171
/*----------------------------------------------------------------------
172
| functions
173
+---------------------------------------------------------------------*/
202
WSB_EXPORT
WSB_Result
203
WSB_MediaStream_OpenUrl
(
const
char
* source_url,
204
WSB_MediaStream_SourceType
source_type,
205
const
WSB_MediaStream_FormatInfo
* format_info,
206
WSB_MediaStream
** stream);
207
228
WSB_EXPORT
WSB_Result
229
WSB_MediaStream_Open
(
WSB_MediaStream
* source_stream,
230
const
WSB_MediaStream_FormatInfo
* format_info,
231
WSB_MediaStream
** stream);
232
259
WSB_EXPORT
WSB_Result
260
WSB_MediaStream_Read
(
WSB_MediaStream
*
self
,
void
* buffer,
WSB_Size
* read_bytes);
261
270
WSB_EXPORT
WSB_Result
271
WSB_MediaStream_Seek
(
WSB_MediaStream
*
self
,
WSB_Position
position);
272
282
WSB_EXPORT
WSB_Result
283
WSB_MediaStream_Tell
(
WSB_MediaStream
*
self
,
WSB_Position
* position);
284
293
WSB_EXPORT
WSB_Result
294
WSB_MediaStream_GetSize
(
WSB_MediaStream
*
self
,
WSB_LargeSize
* size);
295
308
WSB_EXPORT
WSB_Result
309
WSB_MediaStream_GetContentType
(
WSB_MediaStream
*
self
,
const
char
** content_type);
310
328
WSB_EXPORT
WSB_Result
329
WSB_MediaStream_GetKey
(
WSB_MediaStream
*
self
,
const
WSB_MediaStreamKey
** key);
330
336
WSB_EXPORT
WSB_Result
337
WSB_MediaStream_Close
(
WSB_MediaStream
*
self
);
338
341
#ifdef __cplusplus
342
}
343
#endif
344
345
#endif // _WSB_MEDIA_STREAM_H_