Wasabi ExpressPlay SDK for Desktop Systems
1.10
Main Page
Modules
Data Structures
Files
File List
Globals
Client
Source
Interface
Core
WsbMediaPlayback.h
Go to the documentation of this file.
1
/*****************************************************************
2
|
3
| Wasabi - Media Playback API
4
|
5
| $Id: WsbMediaPlayback.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_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
{
91
WSB_PLAYER_MSG_MODEL_NATIVE
,
92
WSB_PLAYER_MSG_MODEL_RAW
93
}
WSB_Player_MsgThreadModel
;
94
98
typedef
enum
{
99
WSB_PLAYER_EVENT_TYPE_ACK
,
100
WSB_PLAYER_EVENT_TYPE_NACK
,
101
WSB_PLAYER_EVENT_TYPE_PONG_NOTIFICATION
,
102
WSB_PLAYER_EVENT_TYPE_DECODER_STATE_NOTIFICATION
,
103
WSB_PLAYER_EVENT_TYPE_VOLUME_NOTIFICATION
,
104
WSB_PLAYER_EVENT_TYPE_STREAM_TIMECODE_NOTIFICATION
,
105
WSB_PLAYER_EVENT_TYPE_STREAM_POSITION_NOTIFICATION
,
106
WSB_PLAYER_EVENT_TYPE_STREAM_INFO_NOTIFICATION
,
107
WSB_PLAYER_EVENT_TYPE_DRM_STATE_NOTIFICATION
,
108
WSB_PLAYER_EVENT_TYPE_PROPERTY_NOTIFICATION
,
109
WSB_PLAYER_EVENT_TYPE_DECODER_EVENT_NOTIFICATION
,
110
WSB_PLAYER_EVENT_TYPE_BUFFERING
,
111
WSB_PLAYER_EVENT_TYPE_GOTO_URL_NOTIFICATION
112
}
WSB_Player_EventType
;
113
117
typedef
enum
{
118
WSB_PLAYER_COMMAND_ID_SET_INPUT
,
119
WSB_PLAYER_COMMAND_ID_SET_INPUT_EX
,
120
WSB_PLAYER_COMMAND_ID_SET_VIDEO_OUTPUT
,
121
WSB_PLAYER_COMMAND_ID_SET_AUDIO_OUTPUT
,
122
WSB_PLAYER_COMMAND_ID_SET_VOLUME
,
123
WSB_PLAYER_COMMAND_ID_PLAY
,
124
WSB_PLAYER_COMMAND_ID_PAUSE
,
125
WSB_PLAYER_COMMAND_ID_STOP
,
126
WSB_PLAYER_COMMAND_ID_PING
,
127
WSB_PLAYER_COMMAND_ID_SEEK_TO_TIME
,
128
WSB_PLAYER_COMMAND_ID_SEEK_TO_POSITION
,
129
WSB_PLAYER_COMMAND_ID_REGISTER_MODULE
,
130
WSB_PLAYER_COMMAND_ID_ADD_NODE
,
131
WSB_PLAYER_COMMAND_ID_SET_PROPERTY
132
}
WSB_Player_CommandId
;
133
137
typedef
enum
{
138
WSB_PLAYER_DECODER_STATE_STOPPED
,
139
WSB_PLAYER_DECODER_STATE_PLAYING
,
140
WSB_PLAYER_DECODER_STATE_PAUSED
,
141
WSB_PLAYER_DECODER_STATE_EOS
142
}
WSB_Player_DecoderState
;
143
147
typedef
enum
{
148
WSB_PLAYER_DECODER_EVENT_TYPE_DECODING_ERROR
,
149
WSB_PLAYER_DECODER_EVENT_TYPE_INIT_ERROR
150
}
WSB_Player_DecoderEventType
;
151
155
typedef
enum
{
156
WSB_PLAYER_DRM_STATE_INACTIVE
,
157
WSB_PLAYER_DRM_STATE_GETTING_LICENSE
,
158
WSB_PLAYER_DRM_STATE_REGISTERING
159
}
WSB_Player_DRMState
;
160
165
typedef
enum
{
166
WSB_PLAYER_PROPERTY_SCOPE_CORE
,
167
WSB_PLAYER_PROPERTY_SCOPE_STREAM
,
168
WSB_PLAYER_PROPERTY_SCOPE_MODULE
169
}
WSB_Player_PropertyScope
;
170
171
/*----------------------------------------------------------------------
172
| types
173
+---------------------------------------------------------------------*/
174
180
typedef
struct
{
181
WSB_Player_EventType
type
;
182
}
WSB_Player_Event
;
183
191
typedef
struct
{
192
WSB_Player_Event
base
;
193
WSB_Player_CommandId
command
;
194
}
WSB_Player_AckEvent
;
195
203
typedef
struct
{
204
WSB_Player_Event
base
;
205
WSB_Player_CommandId
command
;
206
WSB_Result
result
;
207
}
WSB_Player_NackEvent
;
208
217
typedef
struct
{
218
WSB_Player_Event
base
;
219
const
void
*
cookie
;
220
}
WSB_Player_PongNotificationEvent
;
221
229
typedef
struct
{
230
WSB_Player_Event
base
;
231
WSB_Player_DecoderState
state
;
232
}
WSB_Player_DecoderStateNotificationEvent
;
233
237
typedef
struct
{
238
WSB_Result
result_code
;
239
const
char
*
message
;
240
}
WSB_Player_DecodingErrorDetails
;
241
249
typedef
struct
{
250
WSB_Player_Event
base
;
251
WSB_Player_DecoderEventType
type
;
252
union
{
253
WSB_Player_DecodingErrorDetails
decoding_error
;
254
} details;
255
}
WSB_Player_DecoderEventNotificationEvent
;
256
264
typedef
struct
{
265
WSB_Player_Event
base
;
266
float
volume
;
267
}
WSB_Player_VolumeNotificationEvent
;
268
276
typedef
struct
{
277
WSB_Player_Event
base
;
278
WSB_TimeCode
timecode
;
279
}
WSB_Player_StreamTimeCodeNotificationEvent
;
280
288
typedef
struct
{
289
WSB_Player_Event
base
;
290
WSB_StreamPosition
position
;
291
}
WSB_Player_StreamPositionNotificationEvent
;
292
301
typedef
struct
{
302
WSB_Player_Event
base
;
303
WSB_Mask
update_mask
;
304
WSB_StreamInfo
info
;
305
}
WSB_Player_StreamInfoNotificationEvent
;
306
314
typedef
struct
{
315
WSB_Player_Event
base
;
316
WSB_Player_DRMState
state
;
317
}
WSB_Player_DRMStateNotificationEvent
;
318
327
typedef
struct
{
328
WSB_Player_Event
base
;
329
WSB_Size
available
;
330
WSB_Size
needed
;
331
}
WSB_Player_BufferingNotificationEvent
;
332
340
typedef
struct
{
341
WSB_Player_Event
base
;
342
const
char
*
goto_url
;
343
}
WSB_Player_GotoUrlNotificationEvent
;
344
352
typedef
struct
{
353
WSB_Player_Event
base
;
354
WSB_Player_PropertyScope
scope
;
355
const
char
*
source
;
356
const
char
*
name
;
357
SHI_DataType
type
;
358
SHI_DataValue
value
;
359
}
WSB_Player_PropertyNotificationEvent
;
360
366
typedef
struct
{
367
void
*
instance
;
368
void (*handler)(
void
* instance,
const
WSB_Player_Event
* event);
369
}
WSB_Player_EventListener
;
370
371
/*----------------------------------------------------------------------
372
| functions
373
+---------------------------------------------------------------------*/
374
393
WSB_EXPORT
WSB_Result
394
WSB_Player_Create
(
WSB_Player_EventListener
listener,
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
456
WSB_EXPORT
WSB_Result
457
WSB_Player_SetInputEx
(
WSB_Player
* playback,
458
const
char
* name,
459
const
char
* mime_type,
460
WSB_Int32
flags,
461
const
void
* license_data,
462
WSB_Size
license_data_size,
463
WSB_Int32
audio_track,
464
WSB_Int32
video_track);
465
474
WSB_EXPORT
WSB_Result
475
WSB_Player_SetVideoOutput
(
WSB_Player
* playback,
const
char
* output_name);
476
477
485
WSB_EXPORT
WSB_Result
486
WSB_Player_SetAudioOutput
(
WSB_Player
* playback,
const
char
* output_name);
487
495
WSB_EXPORT
WSB_Result
496
WSB_Player_SetVolume
(
WSB_Player
* playback,
float
volume);
497
511
WSB_EXPORT
WSB_Result
512
WSB_Player_SetProperty
(
WSB_Player
* playback,
513
WSB_Player_PropertyScope
scope,
514
const
char
* target,
515
const
char
* name,
516
SHI_DataType
type,
517
const
SHI_DataValue
* value);
518
525
WSB_EXPORT
WSB_Result
526
WSB_Player_Play
(
WSB_Player
* playback);
527
533
WSB_EXPORT
WSB_Result
534
WSB_Player_Pause
(
WSB_Player
* playback);
535
541
WSB_EXPORT
WSB_Result
542
WSB_Player_Stop
(
WSB_Player
* playback);
543
551
WSB_EXPORT
WSB_Result
552
WSB_Player_SetFullscreen
(
WSB_Player
* playback,
WSB_Boolean
fullscreen);
553
566
WSB_EXPORT
WSB_Result
567
WSB_Player_Seek
(
WSB_Player
* playback,
WSB_Int32
offset,
WSB_Int32
range);
568
575
WSB_EXPORT
WSB_Result
576
WSB_Player_Destroy
(
WSB_Player
* playback);
577
580
#if defined(__cplusplus)
581
}
582
#endif
583
584
#endif
/* _WSB_MEDIA_PLAYBACK_H_ */