Wasabi ExpressPlay SDK for Embedded Systems  1.10
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 +---------------------------------------------------------------------*/
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);
64 
65 /*----------------------------------------------------------------------
66 | WSB_MediaStream
67 +---------------------------------------------------------------------*/
70 };
71 
72 /*----------------------------------------------------------------------
73 | WSB_MediaStream_SourceType
74 +---------------------------------------------------------------------*/
75 typedef enum {
80 
90 
91 /*----------------------------------------------------------------------
92 | WSB_MediaStream_FormatInfo
93 +---------------------------------------------------------------------*/
98 typedef union {
105  const char* content_id;
106 
112  const char* ms3_url;
113 
121 
125  const char* license_data;
126 
131 
145  const WSB_Byte* iv;
146 
160 
161  } common;
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
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
272 
282 WSB_EXPORT WSB_Result
284 
293 WSB_EXPORT WSB_Result
295 
308 WSB_EXPORT WSB_Result
309 WSB_MediaStream_GetContentType(WSB_MediaStream* self, const char** content_type);
310 
328 WSB_EXPORT WSB_Result
330 
336 WSB_EXPORT WSB_Result
338 
341 #ifdef __cplusplus
342 }
343 #endif
344 
345 #endif // _WSB_MEDIA_STREAM_H_