Wasabi ExpressPlay SDK for Desktop Systems  1.23.0
WsbMediaStream.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi - Media Stream API
4 |
5 | $Id: WsbMediaStream.h 12416 2016-04-26 16:39:31Z hwa $
6 | Original author: Edin Hodzic ([email protected])
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 #define WSB_MEDIASTREAM_CONTENT_TYPE_AES128CTR "application/vnd.intertrust.drm.aes128.ctr"
36 
37 /*----------------------------------------------------------------------
38 | WSB_MediaStream_Interface
39 +---------------------------------------------------------------------*/
390 typedef struct WSB_KeyManager WSB_MediaStreamKey;
391 typedef struct {
393  WSB_Result (*Read)(WSB_MediaStream* self, void* buffer, WSB_Size* read_bytes);
395  WSB_Result (*Seek)(WSB_MediaStream* self, WSB_Position position);
397  WSB_Result (*Tell)(WSB_MediaStream* self, WSB_Position* position);
399  WSB_Result (*GetSize)(WSB_MediaStream* self, WSB_LargeSize* size);
401  WSB_Result (*GetContentType)(WSB_MediaStream* self, const char** content_type);
405  WSB_Result (*GetKey)(WSB_MediaStream* self, const WSB_MediaStreamKey** key);
407  WSB_Result (*Close)(WSB_MediaStream* self);
409 
410 /*----------------------------------------------------------------------
411 | WSB_MediaStream
412 +---------------------------------------------------------------------*/
415 };
416 
417 /*----------------------------------------------------------------------
418 | WSB_MediaStream_SourceType
419 +---------------------------------------------------------------------*/
420 typedef enum {
425 
434 
442 
443 /*----------------------------------------------------------------------
444 | WSB_MediaStream_FormatInfo
445 +---------------------------------------------------------------------*/
450 typedef union {
457  const char* content_id;
458 
464  const char* ms3_url;
465 
473 
477  const char* license_data;
478 
483 
500  const WSB_Byte* iv;
501 
509 
523 
524  } common;
526 
527 
528 #ifdef __cplusplus
529 extern "C" {
530 #elif 0
531 }
532 #endif
533 
534 /*----------------------------------------------------------------------
535 | functions
536 +---------------------------------------------------------------------*/
565 WSB_EXPORT WSB_Result
566 WSB_MediaStream_OpenUrl(const char* source_url,
567  WSB_MediaStream_SourceType source_type,
568  const WSB_MediaStream_FormatInfo* format_info,
569  WSB_MediaStream** stream);
570 
591 WSB_EXPORT WSB_Result
593  const WSB_MediaStream_FormatInfo* format_info,
594  WSB_MediaStream** stream);
595 
622 WSB_EXPORT WSB_Result
623 WSB_MediaStream_Read(WSB_MediaStream* self, void* buffer, WSB_Size* read_bytes);
624 
633 WSB_EXPORT WSB_Result
635 
645 WSB_EXPORT WSB_Result
647 
656 WSB_EXPORT WSB_Result
658 
671 WSB_EXPORT WSB_Result
672 WSB_MediaStream_GetContentType(WSB_MediaStream* self, const char** content_type);
673 
691 WSB_EXPORT WSB_Result
693 
699 WSB_EXPORT WSB_Result
701 
704 #ifdef __cplusplus
705 }
706 #endif
707 
708 #endif // _WSB_MEDIA_STREAM_H_
WSB_EXPORT WSB_Result WSB_MediaStream_OpenUrl(const char *source_url, WSB_MediaStream_SourceType source_type, const WSB_MediaStream_FormatInfo *format_info, WSB_MediaStream **stream)
Open a Marlin protected source.
Definition: WsbMediaStream.h:391
unsigned WSB_CONFIG_INT64_TYPE WSB_Position
Definition: WsbTypes.h:51
unsigned WSB_CONFIG_INT64_TYPE WSB_LargeSize
Definition: WsbTypes.h:50
WSB_EXPORT WSB_Result WSB_MediaStream_GetContentType(WSB_MediaStream *self, const char **content_type)
Get the content type of the data in the media stream.
WSB_MediaStreamInterface * iface
Definition: WsbMediaStream.h:414
WSB_EXPORT WSB_Result WSB_MediaStream_Open(WSB_MediaStream *source_stream, const WSB_MediaStream_FormatInfo *format_info, WSB_MediaStream **stream)
Open a Marlin protected source stream.
WSB_EXPORT WSB_Result WSB_MediaStream_Tell(WSB_MediaStream *self, WSB_Position *position)
Get the current read position for a media stream.
The basic AES128CTR cipher protected data.
Definition: WsbMediaStream.h:440
WSB_EXPORT WSB_Result WSB_MediaStream_Read(WSB_MediaStream *self, void *buffer, WSB_Size *read_bytes)
Read data from a media stream object.
const char * ms3_url
MS3 URL that can be used to access the key.
Definition: WsbMediaStream.h:464
Marlin DCF document format.
Definition: WsbMediaStream.h:424
WSB_LargeSize clear_text_size
The decrypted media size in bytes.
Definition: WsbMediaStream.h:522
See http://www.w3.org/TR/xmlenc-core/#sec-Alg-Block for the encryption format.
Definition: WsbMediaStream.h:433
const WSB_MediaStreamKey * key
Crypto context transferred from another Media Stream object.
Definition: WsbMediaStream.h:472
const char * content_id
Content ID of the input.
Definition: WsbMediaStream.h:457
WSB_EXPORT WSB_Result WSB_MediaStream_GetSize(WSB_MediaStream *self, WSB_LargeSize *size)
Get the size of the media stream in bytes, if known (or an error code if the size is unknown or an er...
struct WSB_KeyManager WSB_MediaStreamKey
Definition: WsbMediaStream.h:390
const WSB_Byte * iv
The initialization vector for the AES128CBC and AES128CTR decryption.
Definition: WsbMediaStream.h:500
Source data format information.
Definition: WsbMediaStream.h:450
const char * license_data
The BB license data.
Definition: WsbMediaStream.h:477
int WSB_Result
Signed integer value representing a function or method result (return value).
Definition: WsbTypes.h:83
WSB_EXPORT WSB_Result WSB_MediaStream_Seek(WSB_MediaStream *self, WSB_Position position)
Change the current read position for a media stream.
Definition: WsbMediaStream.h:413
WSB_EXPORT WSB_Result WSB_MediaStream_Close(WSB_MediaStream *self)
Release a media stream object once it is no longer needed.
WSB_UInt8 WSB_Byte
An 8-bit byte.
Definition: WsbTypes.h:132
Result codes.
WSB_MediaStream_SourceType
Definition: WsbMediaStream.h:420
WSB_Size counter_size
Size of the IV counter in bytes.
Definition: WsbMediaStream.h:508
WSB_Size license_data_size
The BB license data size in bytes.
Definition: WsbMediaStream.h:482
WSB_EXPORT WSB_Result WSB_MediaStream_GetKey(WSB_MediaStream *self, const WSB_MediaStreamKey **key)
Extract the crypto context from a Media Stream object.
Wasabi Result.
WSB_UInt32 WSB_Size
An unsigned integer used to represent a measurable quantity (e.g., the size of a file).
Definition: WsbTypes.h:104