Pepper_47_C_interfaces
ppb_media_player_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2016 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppb_media_player_samsung.idl,
5  * modified Thu Nov 24 12:30:20 2016.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_
10 
12 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_instance.h"
15 #include "ppapi/c/pp_macros.h"
16 #include "ppapi/c/pp_point.h"
17 #include "ppapi/c/pp_rect.h"
18 #include "ppapi/c/pp_resource.h"
19 #include "ppapi/c/pp_size.h"
20 #include "ppapi/c/pp_stdint.h"
21 #include "ppapi/c/pp_time.h"
25 
26 #define PPB_MEDIAPLAYER_SAMSUNG_INTERFACE_1_0 "PPB_MediaPlayer_Samsung;1.0"
27 #define PPB_MEDIAPLAYER_SAMSUNG_INTERFACE_1_1 "PPB_MediaPlayer_Samsung;1.1"
28 #define PPB_MEDIAPLAYER_SAMSUNG_INTERFACE PPB_MEDIAPLAYER_SAMSUNG_INTERFACE_1_1
29 
30 /**
31  * @file
32  * This file defines the <code>PPB_MediaPlayer_Samsung</code> interface,
33  * which provides multimedia streaming, playback control capabilities.
34  *
35  * Part of Pepper Media Player interfaces (Samsung's extension).
36  *
37  * Basic idea:
38  * - <code>PPB_MediaPlayer_Samsung</code> is interface allowing application
39  * to control playback state, inquire about playback state and to
40  * set listeners for various playback related events (see
41  * <code>PPP_MediaEventsListener_Samsung</code>). It's also responsible for
42  * assigning data source which will feed player with media data.
43  *
44  * For full description of Data Sources see ppb_media_data_source_samsung.idl.
45  */
46 
47 
48 /**
49  * @addtogroup Interfaces
50  * @{
51  */
52 /**
53  * Interface representing player and providing functionality of playback
54  * control and attaching data source feeding player.
55  *
56  * Assumptions:
57  * - Video is displayed in area of embed/object element of HTML page
58  * in which plugin is embedded.
59  * - Video and graphics from module can be displayed simultaneously.
60  * (see <code>PPB_Instance.BindGraphics</code>). Application must
61  * set proper CSS style for embed element with NaCl application
62  * (mostly transparent background).
63  */
65  /**
66  * Creates a new media player resource and binds it to the instance.
67  *
68  * @param[in] instance A <code>PP_Instance</code> identifying the instance
69  * with the media player.
70  *
71  * @return A <code>PP_Resource</code> corresponding to a media player if
72  * successful or 0 otherwise.
73  */
75  /**
76  * Creates a new media player resource without binding it to the instance.
77  *
78  * @param[in] instance A <code>PP_Instance</code> identifying the instance
79  * with the media player.
80  *
81  * @return A <code>PP_Resource</code> corresponding to a media player if
82  * successful or 0 otherwise.
83  */
85  /**
86  * Determines if the given resource is a media player.
87  *
88  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
89  *
90  * @return <code>PP_TRUE</code> if the resource is a
91  * <code>PPB_MediaPlayer_Samsung</code>, <code>PP_FALSE</code>
92  * if the resource is invalid or some other type.
93  */
95  /**
96  * Attaches <code>PPP_MediaEventsListener_Samsung</code> to the player.
97  * After attaching plugin is notified about media playback related event.
98  * Previously attached listener (if any) is detached.
99  *
100  * All listeners will be called in the same thread. If this method was
101  * invoked in a thread with a running message loop, the listener will run in
102  * the current thread. Otherwise, it will run on the main thread.
103  *
104  * @param[in] player A <code>PP_Resource</code> identifying the media player.
105  * @param[in] listener A <code>PPP_MediaEventsListener_Samsung</code>
106  * interface whose methods will be notified about subscribed events.
107  * Passing <code>NULL</code> will detach currently set listener.
108  * @param[in] user_data A pointer to user data which will be passed
109  * to the listeners during method invocation (optional).
110  *
111  * @return <code>PP_TRUE</code> if listener has been successfully attached,
112  * <code>PP_FALSE</code> otherwise. This method will return false only when
113  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
114  */
116  PP_Resource player,
117  const struct PPP_MediaEventsListener_Samsung_1_0* listener,
118  void* user_data);
119  /**
120  * Attaches <code>PPP_SubtitleListener_Samsung</code> to the player.
121  * After attaching plugin is notified about subtitle texts that are parsed by
122  * the internal player subtitle parser at the time when they should be
123  * displayed. Only notifications regarding texts that originate from active
124  * text track are delivered this way.
125  * Previously attached listener (if any) is detached.
126  *
127  * All listeners will be called in the same thread. If this method was
128  * invoked in a thread with a running message loop, the listener will run in
129  * the current thread. Otherwise, it will run on the main thread.
130  *
131  * @param[in] player A <code>PP_Resource</code> identifying the media player.
132  * @param[in] listener A <code>PPP_SubtitleListener_Samsung</code>
133  * interface whose methods will be notified about subscribed events.
134  * Passing <code>NULL</code> will detach currently set listener.
135  * @param[in] user_data A pointer to user data which will be passed
136  * to the listeners during method invocation (optional).
137  *
138  * @return <code>PP_TRUE</code> if listener has been successfully attached,
139  * <code>PP_FALSE</code> otherwise. This method will return false only when
140  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
141  */
143  PP_Resource player,
144  const struct PPP_SubtitleListener_Samsung_1_0* listener,
145  void* user_data);
146  /**
147  * Attaches <code>PPP_BufferingListener_Samsung</code> to the player.
148  * After attaching plugin is notified about initial media buffering events.
149  * Previously attached listener (if any) is detached.
150  *
151  * All listeners will be called in the same thread. If this method was
152  * invoked in a thread with a running message loop, the listener will run in
153  * the current thread. Otherwise, it will run on the main thread.
154  *
155  * @param[in] player A <code>PP_Resource</code> identifying the media player.
156  * @param[in] listener A <code>PPP_BufferingListener_Samsung</code>
157  * interface whose methods will be notified about subscribed events.
158  * Passing <code>NULL</code> will detach currently set listener.
159  * @param[in] user_data A pointer to user data which will be passed
160  * to the listeners during method invocation (optional).
161  *
162  * @return <code>PP_TRUE</code> if listener has been successfully attached,
163  * <code>PP_FALSE</code> otherwise. This method will return false only when
164  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
165  */
167  PP_Resource data_source,
168  const struct PPP_BufferingListener_Samsung_1_0* listener,
169  void* user_data);
170  /**
171  * Attaches <code>PPP_DRMListener_Samsung</code> to the player.
172  * After attaching plugin is notified about DRM related events.
173  * Previously attached listener (if any) is detached.
174  *
175  * All listeners will be called in the same thread. If this method was
176  * invoked in a thread with a running message loop, the listener will run in
177  * the current thread. Otherwise, it will run on the main thread.
178  *
179  * @param[in] player A <code>PP_Resource</code> identifying the media player.
180  * @param[in] listener A <code>PPP_DRMListener_Samsung</code>
181  * interface whose methods will be notified about subscribed events.
182  * Passing <code>NULL</code> will detach currently set listener.
183  * @param[in] user_data A pointer to user data which will be passed
184  * to the listeners during method invocation (optional).
185  *
186  * @return <code>PP_TRUE</code> if listener has been successfully attached,
187  * <code>PP_FALSE</code> otherwise. This method will return false only when
188  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
189  */
191  const struct PPP_DRMListener_Samsung_1_0* listener,
192  void* user_data);
193  /**
194  * Attaches given <code>PPB_MediaDataSource</code> to the player.
195  *
196  * You can pass a <code>NULL</code> resource as buffer to detach currently
197  * attached data source. Reattaching data source will return
198  * <code>PP_OK</code> and do nothing.
199  *
200  * Attached data source must be valid. Otherwise
201  * <code>PP_ERROR_BADARGUMENT</code> will be returned. Attaching data source
202  * to the player will cause:
203  * 1. Detaching currently attached data source
204  * 2. Performing initialization of newly bound data source (this step
205  * is specific to data source which is being bound).
206  *
207  * @param[in] player A <code>PP_Resource</code> identifying the media player.
208  * @param[in] data_source A <code>PP_Resource</code> identifying data source
209  * to be attached to the player.
210  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
211  * completion.
212  *
213  * @return PP_OK on success, otherwise an error code from
214  * <code>pp_errors.h</code>.
215  */
216  int32_t (*AttachDataSource)(PP_Resource player,
217  PP_Resource data_source,
218  struct PP_CompletionCallback callback);
219  /* Playback control */
220  /**
221  * Requests to start playback of media from data source attached to the
222  * media player.
223  *
224  * @param[in] player A <code>PP_Resource</code> identifying the media player.
225  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
226  * completion.
227  *
228  * @return PP_OK on success, otherwise an error code from
229  * <code>pp_errors.h</code>. Meaning of errors:
230  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
231  * to the media player.
232  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
233  * supported by attached data source.
234  */
235  int32_t (*Play)(PP_Resource player, struct PP_CompletionCallback callback);
236  /**
237  * Requests to pause playback of media from data source attached to the
238  * media player.
239  *
240  * @param[in] player A <code>PP_Resource</code> identifying the media player.
241  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
242  * completion.
243  *
244  * @return PP_OK on success, otherwise an error code from
245  * <code>pp_errors.h</code>. Meaning of errors:
246  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
247  * to the media player.
248  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
249  * supported by attached data source.
250  */
251  int32_t (*Pause)(PP_Resource player, struct PP_CompletionCallback callback);
252  /**
253  * Requests to stop playback of media from data source attached to the
254  * media player.
255  *
256  * @param[in] player A <code>PP_Resource</code> identifying the media player.
257  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
258  * completion.
259  *
260  * @return PP_OK on success, otherwise an error code from
261  * <code>pp_errors.h</code>. Meaning of errors:
262  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
263  * to the media player.
264  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
265  * supported by attached data source.
266  */
267  int32_t (*Stop)(PP_Resource player, struct PP_CompletionCallback callback);
268  /**
269  * Requests to seek media from attached data source to the given time stamp.
270  * After calling Seek new packets should be sent to the player. Only after
271  * receiving a number of packets the player can complete a seek operation and
272  * run a callback.
273  *
274  * @param[in] player A <code>PP_Resource</code> identifying the media player.
275  * @param[in] time A time stamp from begging of the clip to from which
276  * playback should be resumed.
277  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
278  * completion.
279  *
280  * @return PP_OK on success, otherwise an error code from
281  * <code>pp_errors.h</code>. Meaning of errors:
282  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
283  * to the media player.
284  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
285  * supported by attached data source.
286  */
287  int32_t (*Seek)(PP_Resource player,
288  PP_TimeTicks time,
289  struct PP_CompletionCallback callback);
290  /**
291  * Sets playback rate, pass:
292  * |rate| == 1.0 to mark normal playback
293  * 0.0 < |rate| < 1.0 to mark speeds slower than normal
294  * |rate| > 1.0 to mark speeds faster than normal
295  *
296  * @param[in] player A <code>PP_Resource</code> identifying the media player.
297  * @param[in] rate A rate of the playback.
298  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
299  * completion.
300  *
301  * @return PP_OK on success, otherwise an error code from
302  * <code>pp_errors.h</code>. Meaning of errors:
303  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
304  * to the media player.
305  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
306  * supported by attached data source.
307  */
308  int32_t (*SetPlaybackRate)(PP_Resource player,
309  double rate,
310  struct PP_CompletionCallback callback);
311  /* Playback time info */
312  /**
313  * Retrieves duration of the media played from attached data source.
314  *
315  * @param[in] player A <code>PP_Resource</code> identifying the media player.
316  * @param[out] duration Retrieved duration of the media.
317  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
318  * completion.
319  *
320  * @return PP_OK on success, otherwise an error code from
321  * <code>pp_errors.h</code>. Meaning of errors:
322  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
323  * to the media player.
324  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
325  * supported by attached data source (e.g. live content playback).
326  */
327  int32_t (*GetDuration)(PP_Resource player,
328  PP_TimeDelta* duration,
329  struct PP_CompletionCallback callback);
330  /**
331  * Retrieves current time/position of the media played from attached
332  * data source.
333  *
334  * This operation can be performed only for media player in
335  * <code>PP_MEDIAPLAYERSTATE_PLAYING</code> or
336  * <code>PP_MEDIAPLAYERSTATE_PAUSED</code> states.
337  *
338  * @param[in] player A <code>PP_Resource</code> identifying the media player.
339  * @param[out] duration Retrieved current time/position of the media.
340  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
341  * completion.
342  *
343  * @return PP_OK on success, otherwise an error code from
344  * <code>pp_errors.h</code>. Meaning of errors:
345  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
346  * to the media player.
347  * - <code>PP_ERROR_NOTSUPPORTED</code> - if data can't be retrieved
348  * due to invalid player state.
349  */
350  int32_t (*GetCurrentTime)(PP_Resource player,
351  PP_TimeTicks* time,
352  struct PP_CompletionCallback callback);
353  /* Playback state info */
354  /**
355  * Retrieves current state the media player.
356  *
357  * @param[in] player A <code>PP_Resource</code> identifying the media player.
358  * @param[out] state Retrieved current state of the media player.
359  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
360  * completion.
361  *
362  * @return PP_OK on success, otherwise an error code from
363  * <code>pp_errors.h</code>.
364  */
365  int32_t (*GetPlayerState)(PP_Resource player,
366  PP_MediaPlayerState* state,
367  struct PP_CompletionCallback callback);
368  /* Tracks info */
369  /**
370  * Retrieves information of current video track from the media played from
371  * attached data source.
372  *
373  * @param[in] player A <code>PP_Resource</code> identifying the media player.
374  * @param[out] track_info Retrieved video track information.
375  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
376  * completion.
377  *
378  * @return PP_OK on success, otherwise an error code from
379  * <code>pp_errors.h</code>. Meaning of errors:
380  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
381  * to the media player.
382  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no video track is available
383  * in media played from attached data source.
384  */
386  struct PP_VideoTrackInfo* track_info,
387  struct PP_CompletionCallback callback);
388  /**
389  * Retrieves information of all video tracks from the media played from
390  * attached data source.
391  *
392  * @param[in] player A <code>PP_Resource</code> identifying the media player.
393  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
394  * supported <code>PP_VideoTrackInfo</code> tracks descriptions.
395  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
396  * completion.
397  *
398  * @return If >= 0, the number of the tracks is returned, otherwise an
399  * error code from <code>pp_errors.h</code>. Meaning of errors:
400  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
401  * to the media player.
402  */
403  int32_t (*GetVideoTracksList)(PP_Resource player,
404  struct PP_ArrayOutput output,
405  struct PP_CompletionCallback callback);
406  /**
407  * Retrieves information of current audio track from the media played from
408  * attached data source.
409  *
410  * @param[in] player A <code>PP_Resource</code> identifying the media player.
411  * @param[out] track_info Retrieved audio track information.
412  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
413  * completion.
414  *
415  * @return PP_OK on success, otherwise an error code from
416  * <code>pp_errors.h</code>. Meaning of errors:
417  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
418  * to the media player.
419  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no audio track is available
420  * in media played from attached data source.
421  */
423  struct PP_AudioTrackInfo* track_info,
424  struct PP_CompletionCallback callback);
425  /**
426  * Retrieves information of all audio tracks from the media played from
427  * attached data source.
428  *
429  * @param[in] player A <code>PP_Resource</code> identifying the media player.
430  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
431  * supported <code>PP_AudioTrackInfo</code> tracks descriptions.
432  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
433  * completion.
434  *
435  * @return If >= 0, the number of the tracks is returned, otherwise an
436  * error code from <code>pp_errors.h</code>. Meaning of errors:
437  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
438  * to the media player.
439  */
440  int32_t (*GetAudioTracksList)(PP_Resource player,
441  struct PP_ArrayOutput output,
442  struct PP_CompletionCallback callback);
443  /**
444  * Retrieves information of current text/subtitles track from the media played
445  * from attached data source.
446  *
447  * @param[in] player A <code>PP_Resource</code> identifying the media player.
448  * @param[out] track_info Retrieved video track information.
449  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
450  * completion.
451  *
452  * @return PP_OK on success, otherwise an error code from
453  * <code>pp_errors.h</code>. Meaning of errors:
454  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
455  * to the media player.
456  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no text/subtitles track
457  * is available in media played from attached data source.
458  */
460  struct PP_TextTrackInfo* track_info,
461  struct PP_CompletionCallback callback);
462  /**
463  * Retrieves information of all text/subtitles tracks from the media played
464  * from attached data source.
465  *
466  * @param[in] player A <code>PP_Resource</code> identifying the media player.
467  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
468  * supported <code>PP_TextTrackInfo</code> tracks descriptions.
469  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
470  * completion.
471  *
472  * @return If >= 0, the number of the tracks is returned, otherwise an
473  * error code from <code>pp_errors.h</code>. Meaning of errors:
474  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
475  * to the media player.
476  */
477  int32_t (*GetTextTracksList)(PP_Resource player,
478  struct PP_ArrayOutput output,
479  struct PP_CompletionCallback callback);
480  /**
481  * Selects a track for the given stream type to be activated for media
482  * played from the attached data source.
483  *
484  * Remarks:
485  * If activated track is a text track, it will be automatically activated and
486  * therefore it's subtitles will be delivered as events to the
487  * <code>PPP_SubtitleListener_Samsung</code>.
488  *
489  * Constraints:
490  * An ability to handle multiple video tracks at a time is not guaranteed to
491  * be supported on all platforms, therefore calling this method with a
492  * <code>PP_ElementaryStream_Type_Samsung_VIDEO</code> as a stream type may
493  * result with a <code>PP_ERROR_NOTSUPPORTED</code> error code.
494  *
495  * @param[in] player A <code>PP_Resource</code> identifying the media player.
496  * @param[in] track_type A type of the stream for which activate track.
497  * @param[in] track_index An index of the track which has to be activated.
498  * Valid track index can be obtained from one of PP_*TrackInfo structures
499  * returned by corresponding call to Get*TracksInfo.
500  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
501  * completion.
502  *
503  * @return PP_OK on success, otherwise an error code from
504  * <code>pp_errors.h</code>. Meaning of errors:
505  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
506  * to the media player or passed |track_type| or |track_index| are
507  * not valid.
508  * - <code>PP_ERROR_NOTSUPPORTED</code> - if called with
509  * <code>PP_ElementaryStream_Type_Samsung_VIDEO</code> on a platform that
510  * supports only one video track at a time.
511  */
512  int32_t (*SelectTrack)(PP_Resource player,
514  uint32_t track_index,
515  struct PP_CompletionCallback callback);
516  /* Subtitles (text track) control */
517  /**
518  * Adds external subtitles.
519  * Returns <code>PP_OK/code> in case of success and writes added text track
520  * information to |subtitles| param. After that newly added subtitles will be
521  * activated and <code>PPB_SubtitleListener_Samsung</code> will be
522  * notified about it's texts at the time those texts should be shown.
523  *
524  * Please note that player is responsible only for subtitle file parsing. No
525  * subtitles are displayed by the player. Application can use
526  * <code>PPB_SubtitleListener_Samsung</code> to get subtitle texts at correct
527  * playback times and display them manually.
528  *
529  * Constraints:
530  * Ability to add external subtitles after attaching data source is
531  * implementation dependent. If it is impossible to add external subtitles
532  * after data source is attached, this method will fail with
533  * <code>PP_ERROR_NOTSUPPORTED</code> error code. Therefore this method is
534  * guaranteed to succeed only before data source is attached.
535  *
536  * @param[in] player A <code>PP_Resource</code> identifying the media player.
537  * @param[in] file_path A path of the subtitles.
538  * @param[in] encoding Subtitle encoding. May be NULL or empty string, which
539  * will cause subtitles to be interpreted as UTF-8 text.
540  * @param[out] subtitles Added text/subtitles track information.
541  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
542  * completion.
543  *
544  * @return PP_OK on success, otherwise an error code from
545  * <code>pp_errors.h</code>. Meaning of errors:
546  * - <code>PP_ERROR_FILENOTFOUND</code> - if provided file_path is invalid.
547  * - <code>PP_ERROR_BADARGUMENT</code> - if provided encoding is invalid.
548  * - <code>PP_ERROR_NOTSUPPORTED</code> - if method was called after attaching
549  * a data source and such operation is not supported on the current
550  * implementation.
551  */
553  const char* file_path,
554  const char* encoding,
555  struct PP_TextTrackInfo* subtitles,
556  struct PP_CompletionCallback callback);
557  /**
558  * Sets subtitles (text stream) <code>PPP_SubtitleListener_Samsung</code>
559  * event emission delay regarding to the current media time.
560  *
561  * @param[in] player A <code>PP_Resource</code> identifying the media player.
562  * @param[in] delay A delay to be set.
563  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
564  * completion.
565  *
566  * @return PP_OK on success, otherwise an error code from
567  * <code>pp_errors.h</code>. Meaning of errors:
568  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
569  * to the media player.
570  */
571  int32_t (*SetSubtitlesDelay)(PP_Resource player,
572  PP_TimeDelta delay,
573  struct PP_CompletionCallback callback);
574  /* Other - player control */
575  /**
576  * Sets display region in which video will be displayed. Passed position
577  * is relative to the embed/object element of WebPage associated with given
578  * plugin.
579  *
580  * @param[in] player A <code>PP_Resource</code> identifying the media player.
581  * @param[in] rect Video region in which video will be displayed.
582  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
583  * completion.
584  *
585  * @return PP_OK on success, otherwise an error code from
586  * <code>pp_errors.h</code>.
587  */
588  int32_t (*SetDisplayRect)(PP_Resource player,
589  const struct PP_Rect* rect,
590  struct PP_CompletionCallback callback);
591  /**
592  * Calls DRM system specific operation.
593  *
594  * @param[in] player A <code>PP_Resource</code> identifying the media player.
595  * @param[in] drm_type A DRM system to be used
596  * @param[in] drm_operation A DRM specific operation to be performed.
597  * @param[in] drm_data_size A size of data buffer passed to DRM system.
598  * @param[in] drm_data A data buffer passed to DRM system.
599  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
600  * completion.
601  *
602  * @return PP_OK on success, otherwise an error code from
603  * <code>pp_errors.h</code>. Meaning of errors:
604  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
605  * to the media player.
606  */
607  int32_t (*SetDRMSpecificData)(PP_Resource player,
608  PP_MediaPlayerDRMType drm_type,
609  PP_MediaPlayerDRMOperation drm_operation,
610  uint32_t drm_data_size,
611  const void* drm_data,
612  struct PP_CompletionCallback callback);
613 };
614 
616 
621  PP_Resource player,
622  const struct PPP_MediaEventsListener_Samsung_1_0* listener,
623  void* user_data);
625  PP_Resource player,
626  const struct PPP_SubtitleListener_Samsung_1_0* listener,
627  void* user_data);
629  PP_Resource data_source,
630  const struct PPP_BufferingListener_Samsung_1_0* listener,
631  void* user_data);
633  const struct PPP_DRMListener_Samsung_1_0* listener,
634  void* user_data);
635  int32_t (*AttachDataSource)(PP_Resource player,
636  PP_Resource data_source,
637  struct PP_CompletionCallback callback);
638  int32_t (*Play)(PP_Resource player, struct PP_CompletionCallback callback);
639  int32_t (*Pause)(PP_Resource player, struct PP_CompletionCallback callback);
640  int32_t (*Stop)(PP_Resource player, struct PP_CompletionCallback callback);
641  int32_t (*Seek)(PP_Resource player,
642  PP_TimeTicks time,
643  struct PP_CompletionCallback callback);
644  int32_t (*SetPlaybackRate)(PP_Resource player,
645  double rate,
646  struct PP_CompletionCallback callback);
647  int32_t (*GetDuration)(PP_Resource player,
648  PP_TimeDelta* duration,
649  struct PP_CompletionCallback callback);
650  int32_t (*GetCurrentTime)(PP_Resource player,
651  PP_TimeTicks* time,
652  struct PP_CompletionCallback callback);
653  int32_t (*GetPlayerState)(PP_Resource player,
654  PP_MediaPlayerState* state,
655  struct PP_CompletionCallback callback);
657  struct PP_VideoTrackInfo* track_info,
658  struct PP_CompletionCallback callback);
659  int32_t (*GetVideoTracksList)(PP_Resource player,
660  struct PP_ArrayOutput output,
661  struct PP_CompletionCallback callback);
663  struct PP_AudioTrackInfo* track_info,
664  struct PP_CompletionCallback callback);
665  int32_t (*GetAudioTracksList)(PP_Resource player,
666  struct PP_ArrayOutput output,
667  struct PP_CompletionCallback callback);
669  struct PP_TextTrackInfo* track_info,
670  struct PP_CompletionCallback callback);
671  int32_t (*GetTextTracksList)(PP_Resource player,
672  struct PP_ArrayOutput output,
673  struct PP_CompletionCallback callback);
674  int32_t (*SelectTrack)(PP_Resource player,
676  uint32_t track_index,
677  struct PP_CompletionCallback callback);
679  const char* file_path,
680  const char* encoding,
681  struct PP_TextTrackInfo* subtitles,
682  struct PP_CompletionCallback callback);
683  int32_t (*SetSubtitlesDelay)(PP_Resource player,
684  PP_TimeDelta delay,
685  struct PP_CompletionCallback callback);
686  int32_t (*SetDisplayRect)(PP_Resource player,
687  const struct PP_Rect* rect,
688  struct PP_CompletionCallback callback);
689  int32_t (*SetDRMSpecificData)(PP_Resource player,
690  PP_MediaPlayerDRMType drm_type,
691  PP_MediaPlayerDRMOperation drm_operation,
692  uint32_t drm_data_size,
693  const void* drm_data,
694  struct PP_CompletionCallback callback);
695 };
696 /**
697  * @}
698  */
699 
700 #endif /* PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_ */
701 
int32_t(* GetCurrentVideoTrackInfo)(PP_Resource player, struct PP_VideoTrackInfo *track_info, struct PP_CompletionCallback callback)
int32_t(* GetAudioTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
PP_Bool(* SetMediaEventsListener)(PP_Resource player, const struct PPP_MediaEventsListener_Samsung_1_0 *listener, void *user_data)
PP_Bool(* SetBufferingListener)(PP_Resource data_source, const struct PPP_BufferingListener_Samsung_1_0 *listener, void *user_data)
int32_t(* AddExternalSubtitles)(PP_Resource player, const char *file_path, const char *encoding, struct PP_TextTrackInfo *subtitles, struct PP_CompletionCallback callback)
PP_Bool(* SetSubtitleListener)(PP_Resource player, const struct PPP_SubtitleListener_Samsung_1_0 *listener, void *user_data)
int32_t(* Pause)(PP_Resource player, struct PP_CompletionCallback callback)
PP_Resource(* Create)(PP_Instance instance)
int32_t(* SetSubtitlesDelay)(PP_Resource player, PP_TimeDelta delay, struct PP_CompletionCallback callback)
PP_Bool(* SetMediaEventsListener)(PP_Resource player, const struct PPP_MediaEventsListener_Samsung_1_0 *listener, void *user_data)
int32_t(* SetDisplayRect)(PP_Resource player, const struct PP_Rect *rect, struct PP_CompletionCallback callback)
int32_t(* GetDuration)(PP_Resource player, PP_TimeDelta *duration, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTextTrackInfo)(PP_Resource player, struct PP_TextTrackInfo *track_info, struct PP_CompletionCallback callback)
PP_Bool(* SetDRMListener)(PP_Resource data_source, const struct PPP_DRMListener_Samsung_1_0 *listener, void *user_data)
int32_t(* Stop)(PP_Resource player, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTime)(PP_Resource player, PP_TimeTicks *time, struct PP_CompletionCallback callback)
int32_t PP_Resource
Definition: pp_resource.h:40
int32_t(* AttachDataSource)(PP_Resource player, PP_Resource data_source, struct PP_CompletionCallback callback)
double PP_TimeTicks
Definition: pp_time.h:42
PP_MediaPlayerDRMOperation
int32_t(* SelectTrack)(PP_Resource player, PP_ElementaryStream_Type_Samsung track_type, uint32_t track_index, struct PP_CompletionCallback callback)
int32_t(* GetPlayerState)(PP_Resource player, PP_MediaPlayerState *state, struct PP_CompletionCallback callback)
int32_t(* GetCurrentAudioTrackInfo)(PP_Resource player, struct PP_AudioTrackInfo *track_info, struct PP_CompletionCallback callback)
int32_t(* GetCurrentAudioTrackInfo)(PP_Resource player, struct PP_AudioTrackInfo *track_info, struct PP_CompletionCallback callback)
int32_t(* GetDuration)(PP_Resource player, PP_TimeDelta *duration, struct PP_CompletionCallback callback)
int32_t(* GetTextTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTextTrackInfo)(PP_Resource player, struct PP_TextTrackInfo *track_info, struct PP_CompletionCallback callback)
int32_t(* GetVideoTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
int32_t(* GetVideoTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
int32_t(* SetSubtitlesDelay)(PP_Resource player, PP_TimeDelta delay, struct PP_CompletionCallback callback)
int32_t(* SetDRMSpecificData)(PP_Resource player, PP_MediaPlayerDRMType drm_type, PP_MediaPlayerDRMOperation drm_operation, uint32_t drm_data_size, const void *drm_data, struct PP_CompletionCallback callback)
PP_Bool(* IsMediaPlayer)(PP_Resource controller)
int32_t(* GetAudioTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
int32_t(* Seek)(PP_Resource player, PP_TimeTicks time, struct PP_CompletionCallback callback)
int32_t(* SetDRMSpecificData)(PP_Resource player, PP_MediaPlayerDRMType drm_type, PP_MediaPlayerDRMOperation drm_operation, uint32_t drm_data_size, const void *drm_data, struct PP_CompletionCallback callback)
int32_t(* AddExternalSubtitles)(PP_Resource player, const char *file_path, const char *encoding, struct PP_TextTrackInfo *subtitles, struct PP_CompletionCallback callback)
int32_t(* SelectTrack)(PP_Resource player, PP_ElementaryStream_Type_Samsung track_type, uint32_t track_index, struct PP_CompletionCallback callback)
int32_t(* SetPlaybackRate)(PP_Resource player, double rate, struct PP_CompletionCallback callback)
int32_t(* GetPlayerState)(PP_Resource player, PP_MediaPlayerState *state, struct PP_CompletionCallback callback)
int32_t(* Play)(PP_Resource player, struct PP_CompletionCallback callback)
PP_Bool(* IsMediaPlayer)(PP_Resource controller)
int32_t PP_Instance
Definition: pp_instance.h:34
int32_t(* SetPlaybackRate)(PP_Resource player, double rate, struct PP_CompletionCallback callback)
int32_t(* GetCurrentVideoTrackInfo)(PP_Resource player, struct PP_VideoTrackInfo *track_info, struct PP_CompletionCallback callback)
PP_Bool(* SetDRMListener)(PP_Resource data_source, const struct PPP_DRMListener_Samsung_1_0 *listener, void *user_data)
int32_t(* AttachDataSource)(PP_Resource player, PP_Resource data_source, struct PP_CompletionCallback callback)
PP_Bool
Definition: pp_bool.h:30
int32_t(* GetTextTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
double PP_TimeDelta
Definition: pp_time.h:49
int32_t(* Pause)(PP_Resource player, struct PP_CompletionCallback callback)
int32_t(* Play)(PP_Resource player, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTime)(PP_Resource player, PP_TimeTicks *time, struct PP_CompletionCallback callback)
PP_Resource(* CreateWithoutBindingToInstance)(PP_Instance instance)
PP_Bool(* SetSubtitleListener)(PP_Resource player, const struct PPP_SubtitleListener_Samsung_1_0 *listener, void *user_data)
PP_Resource(* Create)(PP_Instance instance)
int32_t(* SetDisplayRect)(PP_Resource player, const struct PP_Rect *rect, struct PP_CompletionCallback callback)
int32_t(* Seek)(PP_Resource player, PP_TimeTicks time, struct PP_CompletionCallback callback)
PP_ElementaryStream_Type_Samsung
PP_Bool(* SetBufferingListener)(PP_Resource data_source, const struct PPP_BufferingListener_Samsung_1_0 *listener, void *user_data)
int32_t(* Stop)(PP_Resource player, struct PP_CompletionCallback callback)