Wasabi ExpressPlay SDK for Desktop Systems  1.23.0
WsbMediaPlayback.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi - Media Playback API
4 |
5 | $Id: WsbMediaPlayback.h 12185 2015-12-07 06:21:28Z hwa $
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_PLAYBACK_H_
22 #define _WSB_MEDIA_PLAYBACK_H_
23 
24 /*----------------------------------------------------------------------
25 | includes
26 +---------------------------------------------------------------------*/
27 #include "WsbTypes.h"
28 #include "ShiData.h"
29 
30 /*----------------------------------------------------------------------
31 | prototypes
32 +---------------------------------------------------------------------*/
38 typedef struct WSB_Player WSB_Player;
39 
40 #if defined(__cplusplus)
41 extern "C" {
42 #endif
43 
44 /*----------------------------------------------------------------------
45 | constants
46 +---------------------------------------------------------------------*/
50 #define WSB_PLAYER_STREAM_INFO_MASK_ALL 0x1FFF
51 
52 #define WSB_PLAYER_STREAM_INFO_MASK_TYPE 0x0001
53 #define WSB_PLAYER_STREAM_INFO_MASK_ID 0x0002
54 #define WSB_PLAYER_STREAM_INFO_MASK_NOMINAL_BITRATE 0x0004
55 #define WSB_PLAYER_STREAM_INFO_MASK_AVERAGE_BITRATE 0x0008
56 #define WSB_PLAYER_STREAM_INFO_MASK_INSTANT_BITRATE 0x0010
57 #define WSB_PLAYER_STREAM_INFO_MASK_SIZE 0x0020
58 #define WSB_PLAYER_STREAM_INFO_MASK_DURATION 0x0040
59 #define WSB_PLAYER_STREAM_INFO_MASK_SAMPLE_RATE 0x0080
60 #define WSB_PLAYER_STREAM_INFO_MASK_CHANNEL_COUNT 0x0100
61 #define WSB_PLAYER_STREAM_INFO_MASK_WIDTH 0x0200
62 #define WSB_PLAYER_STREAM_INFO_MASK_HEIGHT 0x0400
63 #define WSB_PLAYER_STREAM_INFO_MASK_FLAGS 0x0800
64 #define WSB_PLAYER_STREAM_INFO_MASK_DATA_TYPE 0x1000
65 
69 #define WSB_PLAYER_INPUT_FLAG_AUDIO_TRACK 0x0001
70 #define WSB_PLAYER_INPUT_FLAG_VIDEO_TRACK 0x0002
71 #define WSB_PLAYER_INPUT_FLAG_TRACK_BY_INDEX 0x0004
72 
74 #define WSB_PLAYER_STREAM_INFO_FLAG_VBR 0x01
75 
77 #define WSB_PLAYER_STREAM_INFO_FLAG_CONTINUOUS 0x02
78 
90 typedef enum {
94 
98 typedef enum {
113 
117 typedef enum {
133 
137 typedef enum {
143 
147 typedef enum {
151 
155 typedef enum {
160 
165 typedef enum {
170 
171 /*----------------------------------------------------------------------
172 | types
173 +---------------------------------------------------------------------*/
174 
180 typedef struct {
181  WSB_Player_EventType type;
183 
191 typedef struct {
193  WSB_Player_CommandId command;
195 
203 typedef struct {
205  WSB_Player_CommandId command;
208 
217 typedef struct {
219  const void* cookie;
221 
229 typedef struct {
231  WSB_Player_DecoderState state;
233 
237 typedef struct {
239  const char* message;
241 
249 typedef struct {
251  WSB_Player_DecoderEventType type;
252  union {
254  } details;
256 
264 typedef struct {
266  float volume;
268 
276 typedef struct {
280 
288 typedef struct {
292 
301 typedef struct {
306 
314 typedef struct {
316  WSB_Player_DRMState state;
318 
327 typedef struct {
332 
340 typedef struct {
342  const char* goto_url;
344 
352 typedef struct {
354  WSB_Player_PropertyScope scope;
355  const char* source;
356  const char* name;
360 
366 typedef struct {
367  void* instance;
368  void (*handler)(void* instance, const WSB_Player_Event* event);
370 
371 /*----------------------------------------------------------------------
372 | functions
373 +---------------------------------------------------------------------*/
374 
393 WSB_EXPORT WSB_Result
395  WSB_Player_MsgThreadModel msg_model,
396  WSB_Player** playback);
397 
415 WSB_EXPORT WSB_Result
416 WSB_Player_PumpMessage(WSB_Player* playback, WSB_Int32 timeout);
417 
428 WSB_EXPORT WSB_Result
429 WSB_Player_SetInput(WSB_Player* playback, const char* name, const char* mime_type);
430 
461 WSB_EXPORT WSB_Result
463  const char* name,
464  const char* mime_type,
465  WSB_Int32 flags,
466  const void* license_data,
467  WSB_Size license_data_size,
468  WSB_Int32 audio_track,
469  WSB_Int32 video_track);
470 
479 WSB_EXPORT WSB_Result
480 WSB_Player_SetVideoOutput(WSB_Player* playback, const char* output_name);
481 
482 
490 WSB_EXPORT WSB_Result
491 WSB_Player_SetAudioOutput(WSB_Player* playback, const char* output_name);
492 
500 WSB_EXPORT WSB_Result
501 WSB_Player_SetVolume(WSB_Player* playback, float volume);
502 
516 #define WSB_PROPERTY_NAME_PLAYER_EXTRA_CONTENT_ACCESS_HTTP_HEADERS \
517  "Wasabi.Player.ExtraContentAccessHttpHeaders"
518 
532 WSB_EXPORT WSB_Result
534  WSB_Player_PropertyScope scope,
535  const char* target,
536  const char* name,
537  SHI_DataType type,
538  const SHI_DataValue* value);
539 
546 WSB_EXPORT WSB_Result
547 WSB_Player_Play(WSB_Player* playback);
548 
554 WSB_EXPORT WSB_Result
555 WSB_Player_Pause(WSB_Player* playback);
556 
562 WSB_EXPORT WSB_Result
563 WSB_Player_Stop(WSB_Player* playback);
564 
572 WSB_EXPORT WSB_Result
573 WSB_Player_SetFullscreen(WSB_Player* playback, WSB_Boolean fullscreen);
574 
590 WSB_EXPORT WSB_Result
591 WSB_Player_Seek(WSB_Player* playback, WSB_Int32 offset, WSB_Int32 range);
592 
599 WSB_EXPORT WSB_Result
600 WSB_Player_Destroy(WSB_Player* playback);
601 
604 #if defined(__cplusplus)
605 }
606 #endif
607 
608 #endif /* _WSB_MEDIA_PLAYBACK_H_ */
Definition: WsbMediaPlayback.h:131
Definition: WsbMediaPlayback.h:124
Definition: WsbMediaPlayback.h:123
Event data for reporting failure of a requested command.
Definition: WsbMediaPlayback.h:203
Definition: WsbMediaPlayback.h:120
Definition: WsbMediaPlayback.h:167
WSB_Player_DecoderState
Decoder state identifiers.
Definition: WsbMediaPlayback.h:137
Definition: WsbMediaPlayback.h:138
Definition: WsbMediaPlayback.h:140
WSB_StreamInfo info
Definition: WsbMediaPlayback.h:304
Definition: WsbMediaPlayback.h:156
Event data for reporting information about a property.
Definition: WsbMediaPlayback.h:352
WSB_Mask update_mask
Definition: WsbMediaPlayback.h:303
Definition: WsbTypes.h:157
Definition: WsbMediaPlayback.h:110
Definition: WsbMediaPlayback.h:111
SHI_DataValue value
Item data value.
Definition: WsbMediaPlayback.h:358
WSB_EXPORT WSB_Result WSB_Player_SetFullscreen(WSB_Player *playback, WSB_Boolean fullscreen)
Enters or exits fullscreen mode.
WSB_EXPORT WSB_Result WSB_Player_SetInput(WSB_Player *playback, const char *name, const char *mime_type)
Opens a named media file.
Definition: WsbMediaPlayback.h:105
Definition: WsbMediaPlayback.h:127
WSB_Boolean
Boolean type used for variables that can be true (WSB_TRUE) or false (WSB_FALSE). ...
Definition: WsbTypes.h:71
Definition: WsbMediaPlayback.h:103
WSB_Player_DecoderEventType
Decoder event type identifiers.
Definition: WsbMediaPlayback.h:147
void * instance
Definition: WsbMediaPlayback.h:367
Definition: WsbMediaPlayback.h:107
Event data for reporting the DRM state.
Definition: WsbMediaPlayback.h:314
WSB_EXPORT WSB_Result WSB_Player_SetVideoOutput(WSB_Player *playback, const char *output_name)
Sets the destination for the video output, such as a pointer to a window encoded as hex in the string...
WSB_EXPORT WSB_Result WSB_Player_Seek(WSB_Player *playback, WSB_Int32 offset, WSB_Int32 range)
Attempts to move the stream to the specified position.
WSB_Result result
Definition: WsbMediaPlayback.h:206
Event data for reporting the number of buffer bytes available versus the number needed.
Definition: WsbMediaPlayback.h:327
Definition: WsbMediaPlayback.h:118
Structure used as the base for all event structures.
Definition: WsbMediaPlayback.h:180
WSB_EXPORT WSB_Result WSB_Player_Destroy(WSB_Player *playback)
Destroys the specified WSB_Player object.
Definition: WsbTypes.h:162
Event data for reporting a seek to a particular time in a media presentation.
Definition: WsbMediaPlayback.h:276
Definition: WsbMediaPlayback.h:141
Union of different possible types of values encapsulated by a SHI_Data object.
Definition: ShiData.h:90
Definition: WsbMediaPlayback.h:104
WSB_Player_DecoderEventType type
Definition: WsbMediaPlayback.h:251
Definition: WsbMediaPlayback.h:108
WSB_EXPORT WSB_Result WSB_Player_SetVolume(WSB_Player *playback, float volume)
Sets the volume on the audio output.
WSB_EXPORT WSB_Result WSB_Player_PumpMessage(WSB_Player *playback, WSB_Int32 timeout)
Asks the WSB_Player instance to send a message in its queue to the listener registered in the call to...
SHI_DataType
Possible types of data in the value encapsulated by a SHI_Data object.
Definition: ShiData.h:37
WSB_Size available
Definition: WsbMediaPlayback.h:329
WSB_Player_CommandId
Command identifiers.
Definition: WsbMediaPlayback.h:117
WSB_Player_Event base
Definition: WsbMediaPlayback.h:353
WSB_Size needed
Definition: WsbMediaPlayback.h:330
WSB_Result result_code
Definition: WsbMediaPlayback.h:238
WSB_StreamPosition position
Definition: WsbMediaPlayback.h:290
WSB_Player_DRMState state
Definition: WsbMediaPlayback.h:316
Event data for reporting a seek to a particular position.
Definition: WsbMediaPlayback.h:288
Event data for reporting that the decoder sent a pong reply in response to a ping.
Definition: WsbMediaPlayback.h:217
Definition: WsbMediaPlayback.h:157
Definition: WsbMediaPlayback.h:129
SHI_DataType type
Type of item data value.
Definition: WsbMediaPlayback.h:357
Definition: WsbMediaPlayback.h:100
Error code and message for a decoder event notification.
Definition: WsbMediaPlayback.h:237
This structure pairs a listener instance value with a function pointer for receiving events...
Definition: WsbMediaPlayback.h:366
Definition: WsbMediaPlayback.h:126
Definition: WsbMediaPlayback.h:168
const char * name
Definition: WsbMediaPlayback.h:356
struct WSB_Player WSB_Player
A WSB_Player object can be used to play audio and video content, and to control such playback...
Definition: WsbMediaPlayback.h:38
WSB_EXPORT WSB_Result WSB_Player_SetInputEx(WSB_Player *playback, const char *name, const char *mime_type, WSB_Int32 flags, const void *license_data, WSB_Size license_data_size, WSB_Int32 audio_track, WSB_Int32 video_track)
Opens a named media file, and optionally specifies the particular audio and/or video track to be play...
WSB_Player_Event base
Definition: WsbMediaPlayback.h:204
Definition: WsbMediaPlayback.h:92
Event data for reporting information about a stream, and the update mask.
Definition: WsbMediaPlayback.h:301
Definition: WsbMediaPlayback.h:158
Definition: WsbMediaPlayback.h:101
Event data for reporting a successful command execution.
Definition: WsbMediaPlayback.h:191
float volume
Definition: WsbMediaPlayback.h:266
WSB_Player_Event base
Definition: WsbMediaPlayback.h:302
int WSB_Result
Signed integer value representing a function or method result (return value).
Definition: WsbTypes.h:83
Definition: WsbMediaPlayback.h:102
Definition: WsbMediaPlayback.h:130
Definition: WsbMediaPlayback.h:91
WSB_Player_Event base
Definition: WsbMediaPlayback.h:218
WSB_EXPORT WSB_Result WSB_Player_Play(WSB_Player *playback)
Commences play.
Definition: WsbMediaPlayback.h:109
Event data for reporting a decoder event type and error details.
Definition: WsbMediaPlayback.h:249
WSB_UInt32 WSB_Mask
An unsigned integer used to represent a bit mask.
Definition: WsbTypes.h:98
WSB_Player_DecoderState state
Definition: WsbMediaPlayback.h:231
WSB_TimeCode timecode
Definition: WsbMediaPlayback.h:278
WSB_EXPORT WSB_Result WSB_Player_SetProperty(WSB_Player *playback, WSB_Player_PropertyScope scope, const char *target, const char *name, SHI_DataType type, const SHI_DataValue *value)
Sets a property.
Definition: WsbMediaPlayback.h:99
WSB_Player_Event base
Definition: WsbMediaPlayback.h:250
const char * source
Definition: WsbMediaPlayback.h:355
Definition: WsbMediaPlayback.h:106
Event data for reporting a volume change.
Definition: WsbMediaPlayback.h:264
WSB_Player_Event base
Definition: WsbMediaPlayback.h:265
WSB_Player_EventType type
Definition: WsbMediaPlayback.h:181
WSB_Player_Event base
Definition: WsbMediaPlayback.h:289
WSB_Player_CommandId command
Definition: WsbMediaPlayback.h:205
WSB_Player_DecodingErrorDetails decoding_error
Definition: WsbMediaPlayback.h:253
Definition: WsbMediaPlayback.h:125
Event data for reporting a new decoder state.
Definition: WsbMediaPlayback.h:229
Definition: WsbMediaPlayback.h:148
const void * cookie
Definition: WsbMediaPlayback.h:219
WSB_Player_PropertyScope scope
Definition: WsbMediaPlayback.h:354
WSB_Player_Event base
Definition: WsbMediaPlayback.h:230
Event data for reporting a URL to which the player was directed.
Definition: WsbMediaPlayback.h:340
WSB_Player_Event base
Definition: WsbMediaPlayback.h:328
signed int WSB_Int32
32-bit (or more) signed integer
Definition: WsbTypes.h:37
Definition: WsbMediaPlayback.h:121
Definition: WsbMediaPlayback.h:122
WSB_Player_Event base
Definition: WsbMediaPlayback.h:277
Definition: WsbMediaPlayback.h:119
WSB_Player_CommandId command
Definition: WsbMediaPlayback.h:193
WSB_Player_MsgThreadModel
Thread model identifiers.
Definition: WsbMediaPlayback.h:90
WSB_EXPORT WSB_Result WSB_Player_SetAudioOutput(WSB_Player *playback, const char *output_name)
Sets the destination for the audio output.
Definition: WsbMediaPlayback.h:128
WSB_Player_PropertyScope
Scope identifiers for specifying the scope of a property.
Definition: WsbMediaPlayback.h:165
WSB_Player_Event base
Definition: WsbMediaPlayback.h:192
WSB_EXPORT WSB_Result WSB_Player_Stop(WSB_Player *playback)
Stops output.
Wasabi Result.
WSB_Player_EventType
Event type identifiers.
Definition: WsbMediaPlayback.h:98
Generic Data Objects.
WSB_Player_Event base
Definition: WsbMediaPlayback.h:315
WSB_EXPORT WSB_Result WSB_Player_Pause(WSB_Player *playback)
Pauses output (playback).
const char * message
Definition: WsbMediaPlayback.h:239
Definition: WsbMediaPlayback.h:166
WSB_UInt32 WSB_Size
An unsigned integer used to represent a measurable quantity (e.g., the size of a file).
Definition: WsbTypes.h:104
const char * goto_url
Definition: WsbMediaPlayback.h:342
WSB_Player_Event base
Definition: WsbMediaPlayback.h:341
WSB_Player_DRMState
DRM state identifiers.
Definition: WsbMediaPlayback.h:155
WSB_EXPORT WSB_Result WSB_Player_Create(WSB_Player_EventListener listener, WSB_Player_MsgThreadModel msg_model, WSB_Player **playback)
Creates an instance of a WSB_Player object, and registers the passed-in listener to be notified of pl...
Definition: WsbMediaPlayback.h:149
A timecode suitable for media stream position.
Definition: WsbTypes.h:150
Definition: WsbMediaPlayback.h:139