Wasabi ExpressPlay SDK for Embedded Systems  1.10
WsbMediaAccess.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi - Media Access API
4 |
5 | $Id: WsbMediaAccess.h 10793 2014-06-25 12:46:08Z jebaseelir $
6 | Original author: Gilles Boccon-Gibod
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) 2008-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
21 #ifndef _WSB_MEDIA_ACCESS_H_
22 #define _WSB_MEDIA_ACCESS_H_
23 
24 /*----------------------------------------------------------------------
25 | includes
26 +---------------------------------------------------------------------*/
27 #include "WsbTypes.h"
28 #include "WsbElements.h"
29 #include "WsbMediaFile.h"
30 
31 /*----------------------------------------------------------------------
32 | types
33 +---------------------------------------------------------------------*/
34 
35 
42 
43 
47 typedef enum {
59 
63 typedef enum {
68 
72 typedef enum {
75 
79 typedef enum {
83 
87 typedef enum {
91 
95 typedef enum {
99 
133 typedef struct {
137 
143 typedef struct {
144  WSB_UInt32 type; /* see WSB_MediaSourceInfoExtension types */
146  const WSB_UInt8* data;
148 
153 typedef struct {
159  const unsigned char* codec_info;
161 
165 typedef struct {
171 
175 typedef struct {
181 
185 typedef struct {
188  const char* representation_id;
190  unsigned int media_info_count;
193 
197 typedef struct {
200  const char* representation_id;
205  const char* url;
208 
212 typedef struct {
214  WSB_UInt8 kid[16];
215  const char* content_id;
216  unsigned int data_size;
217  const WSB_UInt8* data;
219 
223 typedef struct {
227 
231 typedef struct {
234  const char* representation_id;
236  unsigned int media_data_size;
237  const unsigned char* media_data;
239 
243 typedef struct {
250 
254 typedef struct {
255  const char* representation_id;
256  const char* codecs;
260 
264 typedef struct {
265  const char* language;
268 
272 typedef struct {
275 
279 typedef struct {
283  const char* message;
285 
290 typedef struct {
293  unsigned int extension_count;
296 
301 typedef struct {
304  unsigned int extension_count;
307 
314 typedef struct {
317  unsigned int extension_count;
320 
325 typedef struct {
328  unsigned int extension_count;
331 
336 typedef struct {
339  unsigned int extension_count;
342 
346 typedef struct {
350 
354 typedef struct {
358 
362 typedef struct {
366 
370 typedef struct {
374 
380 typedef struct {
384 
418  void (*OnEvent)(const WSB_MediaSourceListener* self,
419  const WSB_MediaSourceEvent* event);
420 };
421 
427 typedef struct {
431 
446  WSB_MediaType media_type,
447  const char* codec);
448 };
449 
456 typedef struct {
460 
485  WSB_MediaType media_type,
486  unsigned int stream_count,
487  const WSB_MediaStreamVariantInfo** streams);
488 };
489 
496 typedef struct {
500 
529  WSB_MediaType media_type,
530  unsigned int representation_count,
531  const WSB_MediaRepresentationInfo** representations,
532  const WSB_MediaSourceStatistics* statistics);
533 };
534 
538 typedef struct {
540  WSB_Cardinal max_video_bytes_in_queue; /* TS accounted as video */
541  WSB_UInt32 max_bitrate; /* used by default stream selector */
542  WSB_UInt32 max_height; /* used by default stream selector */
543  WSB_UInt32 max_width; /* used by default stream selector */
544  const char* prefered_language; /* used by default stream selector */
545  WSB_Boolean create_stopped; /* WSB_FALSE by default */
546  double segment_retry_period; /* seconds between failed fetch retries */
548 
552 typedef struct {
555  WSB_Size audio_duration_in_queue; /* in milliseconds */
556  WSB_Size video_duration_in_queue; /* in milliseconds */
558 
559 typedef enum {
562 
563 typedef enum {
567 
574 typedef enum {
582 
589 typedef enum {
597 
604 typedef enum {
610 
611 /*----------------------------------------------------------------------
612 | constants
613 +---------------------------------------------------------------------*/
614 #define WSB_MEDIA_SOURCE_TIMEOUT_INFINITE ((WSB_Int32)(-1))
615 
616 /* WSB_DashIsoFfMediaDataInfo flags */
617 #define WSB_DASH_ISOFF_MEDIA_DATA_FLAG_SYNC 1
618 
619 /* WSB_MediaSourceInfoExtension types */
620 #define WSB_MEDIA_SOURCE_INFO_EXTENSION_TYPE_PSSH 0x70737368 /* 'pssh' */
621 
622 /* Return values for stream and representation selectors */
623 #define WSB_MEDIA_SOURCE_USE_DEFAULT_SELECTOR (-1)
624 #define WSB_MEDIA_SOURCE_NO_COMPATIBLE_SELECTION (-2)
625 
626 /*----------------------------------------------------------------------
627 | functions
628 +---------------------------------------------------------------------*/
629 #if defined(__cplusplus)
630 extern "C" {
631 #endif
632 
659 WSB_EXPORT WSB_Result
661  const char* url,
662  const char* mime_type,
663  const WSB_MediaSourceListener* listener,
664  const WSB_MediaSourceCodecFilter* codec_filter,
665  const WSB_MediaSourceStreamSelector* stream_selector,
666  const WSB_MediaSourceRepresentationSelector* representation_selector,
667  const WSB_MediaSourceConfig* config,
668  WSB_MediaSource** source);
669 
685 WSB_EXPORT WSB_Result
687 
700 WSB_EXPORT WSB_Result
702 
722 WSB_EXPORT WSB_Result
724 
738 WSB_EXPORT WSB_Result
740  WSB_Int32 timeout);
741 
757 WSB_EXPORT WSB_Result
759  WSB_UInt64 position_in_ms,
760  WSB_MediaSourceSeekFlag seek_flag);
761 
774 WSB_EXPORT WSB_Result
776 
787 WSB_EXPORT WSB_Result
789  WSB_MediaSourceStatus* status);
790 
799 WSB_EXPORT WSB_Result
801 
810 
830 WSB_EXPORT WSB_Result
832  const void* init_info,
834  const WSB_UInt8* key,
835  unsigned int key_size,
836  WSB_MediaDataDecrypter** decrypter);
837 
853 WSB_EXPORT WSB_Result
855  const WSB_UInt8* in,
856  unsigned int in_size,
857  WSB_UInt8* out,
858  unsigned int* out_size);
859 
868 WSB_EXPORT WSB_Result
870 
873 #if defined(__cplusplus)
874 }
875 #endif
876 
877 #endif /* _WSB_MEDIA_ACCESS_H_ */