Pepper_37_C_interfaces
ppb_media_player_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2015 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppb_media_player_samsung.idl,
5  * modified Fri Jul 31 16:00:48 2015.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_
10 
11 #include "ppapi/c/pp_array_output.h"
12 #include "ppapi/c/pp_bool.h"
13 #include "ppapi/c/pp_completion_callback.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"
22 #include "ppapi/c/samsung/pp_media_common_samsung.h"
23 #include "ppapi/c/samsung/pp_media_player_samsung.h"
24 #include "ppapi/c/samsung/ppp_media_player_samsung.h"
25 
26 #define PPB_MEDIAPLAYER_SAMSUNG_INTERFACE_0_1 "PPB_MediaPlayer_Samsung;0.1"
27 #define PPB_MEDIAPLAYER_SAMSUNG_INTERFACE PPB_MEDIAPLAYER_SAMSUNG_INTERFACE_0_1
28 
29 /**
30  * @file
31  * This file defines the <code>PPB_MediaPlayer_Samsung</code> interface,
32  * which provides multimedia streaming, playback control capabilities.
33  *
34  * Part of Pepper Media Player interfaces (Samsung's extension).
35  *
36  * Basic idea:
37  * - <code>PPB_MediaPlayer_Samsung</code> is interface allowing application
38  * to control playback state, inquire about playback state and to
39  * set listeners for various playback related events (see
40  * <code>PPP_MediaEventsListener_Samsung</code>). It's also responsible for
41  * assigning data source which will feed player with media data.
42  *
43  * For full description of Data Sources see ppb_media_data_source_samsung.idl.
44  */
45 
46 
47 /**
48  * @addtogroup Interfaces
49  * @{
50  */
51 /**
52  * Interface representing player and providing functionality of playback
53  * control and attaching data source feeding player.
54  *
55  * Assumptions:
56  * - Video is displayed in area of embed/object element of HTML page
57  * in which plugin is embedded.
58  * - Video and graphics from module can be displayed simultaneously.
59  * (see <code>PPB_Instance.BindGraphics</code>). Application must
60  * set proper CSS style for embed element with NaCl application
61  * (mostly transparent background).
62  */
64  /**
65  * Creates a new media player resource.
66  *
67  * @param[in] instance A <code>PP_Instance</code> identifying the instance
68  * with the media player.
69  *
70  * @return A <code>PP_Resource</code> corresponding to a media player if
71  * successful or 0 otherwise.
72  */
74  /**
75  * Determines if the given resource is a media player.
76  *
77  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
78  *
79  * @return <code>PP_TRUE</code> if the resource is a
80  * <code>PPB_MediaPlayer_Samsung</code>, <code>PP_FALSE</code>
81  * if the resource is invalid or some other type.
82  */
84  /**
85  * Attaches <code>PPP_MediaEventsListener_Samsung</code> to the player.
86  * After attaching plugin is notified about media playback related event.
87  * Previously attached listener (if any) is detached.
88  *
89  * All listener will be called in the same thread as was this method invoked.
90  *
91  * @param[in] player A <code>PP_Resource</code> identifying the media player.
92  * @param[in] listener A <code>PPP_MediaEventsListener_Samsung</code>
93  * interface whose methods will be notified about subscribed events.
94  * Passing <code>NULL</code> will detach currently set listener.
95  * @param[in] user_data A pointer to user data which will be passed
96  * to the listeners during method invocation (optional).
97  *
98  * @return <code>PP_TRUE</code> if listener has been successfully attached,
99  * <code>PP_FALSE</code> otherwise. This method will return false only when
100  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
101  */
103  PP_Resource player,
104  const struct PPP_MediaEventsListener_Samsung_0_1* listener,
105  void* user_data);
106  /**
107  * Attaches <code>PPP_MediaMetadataListener_Samsung</code> to the player.
108  * After attaching plugin is notified about media metadata changes events.
109  * Previously attached listener (if any) is detached.
110  *
111  * All listener will be called in the same thread as was this method invoked.
112  *
113  * @param[in] player A <code>PP_Resource</code> identifying the media player.
114  * @param[in] listener A <code>PPP_MediaMetadataListener_Samsung</code>
115  * interface whose methods will be notified about subscribed events.
116  * Passing <code>NULL</code> will detach currently set listener.
117  * @param[in] user_data A pointer to user data which will be passed
118  * to the listeners during method invocation (optional).
119  *
120  * @return <code>PP_TRUE</code> if listener has been successfully attached,
121  * <code>PP_FALSE</code> otherwise. This method will return false only when
122  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
123  */
125  PP_Resource data_source,
126  const struct PPP_MediaMetadataListener_Samsung_0_1* listener,
127  void* user_data);
128  /**
129  * Attaches <code>PPP_BufferingListener_Samsung</code> to the player.
130  * After attaching plugin is notified about initial media buffering events.
131  * Previously attached listener (if any) is detached.
132  *
133  * All listener will be called in the same thread as was this method invoked.
134  *
135  * @param[in] player A <code>PP_Resource</code> identifying the media player.
136  * @param[in] listener A <code>PPP_BufferingListener_Samsung</code>
137  * interface whose methods will be notified about subscribed events.
138  * Passing <code>NULL</code> will detach currently set listener.
139  * @param[in] user_data A pointer to user data which will be passed
140  * to the listeners during method invocation (optional).
141  *
142  * @return <code>PP_TRUE</code> if listener has been successfully attached,
143  * <code>PP_FALSE</code> otherwise. This method will return false only when
144  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
145  */
147  PP_Resource data_source,
148  const struct PPP_BufferingListener_Samsung_0_1* listener,
149  void* user_data);
150  /**
151  * Attaches <code>PPP_DRMListener_Samsung</code> to the player.
152  * After attaching plugin is notified about DRM related events.
153  * Previously attached listener (if any) is detached.
154  *
155  * All listener will be called in the same thread as was this method invoked.
156  *
157  * @param[in] player A <code>PP_Resource</code> identifying the media player.
158  * @param[in] listener A <code>PPP_DRMListener_Samsung</code>
159  * interface whose methods will be notified about subscribed events.
160  * Passing <code>NULL</code> will detach currently set listener.
161  * @param[in] user_data A pointer to user data which will be passed
162  * to the listeners during method invocation (optional).
163  *
164  * @return <code>PP_TRUE</code> if listener has been successfully attached,
165  * <code>PP_FALSE</code> otherwise. This method will return false only when
166  * called on resource not representing <code>PPB_MediaPlayer_Samsung</code>.
167  */
169  const struct PPP_DRMListener_Samsung_0_1* listener,
170  void* user_data);
171  /**
172  * Attaches given <code>PPB_MediaDataSource</code> to the player.
173  *
174  * You can pass a <code>NULL</code> resource as buffer to detach currently
175  * attached data source. Reattaching data source will return
176  * <code>PP_OK</code> and do nothing.
177  *
178  * Attached data source must be valid. Otherwise
179  * <code>PP_ERROR_BADARGUMENT</code> will be returned. Attaching data source
180  * to the player will cause:
181  * 1. Detaching currently attached data source
182  * 2. Performing initialization of newly bound data source (this step
183  * is specific to data source which is being bound).
184  *
185  * @param[in] player A <code>PP_Resource</code> identifying the media player.
186  * @param[in] data_source A <code>PP_Resource</code> identifying data source
187  * to be attached to the player.
188  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
189  * completion.
190  *
191  * @return PP_OK on success, otherwise an error code from
192  * <code>pp_errors.h</code>.
193  */
194  int32_t (*AttachDataSource)(PP_Resource player,
195  PP_Resource data_source,
196  struct PP_CompletionCallback callback);
197  /* Playback control */
198  /**
199  * Requests to start playback of media from data source attached to the
200  * media player.
201  *
202  * @param[in] player A <code>PP_Resource</code> identifying the media player.
203  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
204  * completion.
205  *
206  * @return PP_OK on success, otherwise an error code from
207  * <code>pp_errors.h</code>. Meaning of errors:
208  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
209  * to the media player.
210  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
211  * supported by attached data source.
212  */
213  int32_t (*Play)(PP_Resource player, struct PP_CompletionCallback callback);
214  /**
215  * Requests to pause playback of media from data source attached to the
216  * media player.
217  *
218  * @param[in] player A <code>PP_Resource</code> identifying the media player.
219  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
220  * completion.
221  *
222  * @return PP_OK on success, otherwise an error code from
223  * <code>pp_errors.h</code>. Meaning of errors:
224  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
225  * to the media player.
226  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
227  * supported by attached data source.
228  */
229  int32_t (*Pause)(PP_Resource player, struct PP_CompletionCallback callback);
230  /**
231  * Requests to stop playback of media from data source attached to the
232  * media player.
233  *
234  * @param[in] player A <code>PP_Resource</code> identifying the media player.
235  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
236  * completion.
237  *
238  * @return PP_OK on success, otherwise an error code from
239  * <code>pp_errors.h</code>. Meaning of errors:
240  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
241  * to the media player.
242  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
243  * supported by attached data source.
244  */
245  int32_t (*Stop)(PP_Resource player, struct PP_CompletionCallback callback);
246  /**
247  * Requests to seek media from attached data source to the given time stamp.
248  *
249  * @param[in] player A <code>PP_Resource</code> identifying the media player.
250  * @param[in] time A time stamp from begging of the clip to from which
251  * playback should be resumed.
252  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
253  * completion.
254  *
255  * @return PP_OK on success, otherwise an error code from
256  * <code>pp_errors.h</code>. Meaning of errors:
257  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
258  * to the media player.
259  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
260  * supported by attached data source.
261  */
262  int32_t (*Seek)(PP_Resource player,
263  PP_TimeTicks time,
264  struct PP_CompletionCallback callback);
265  /**
266  * Sets playback rate, pass:
267  * |rate| == 1.0 to mark normal playback
268  * 0.0 < |rate| < 1.0 to mark speeds slower than normal
269  * |rate| > 1.0 to mark speeds faster than normal
270  *
271  * @param[in] player A <code>PP_Resource</code> identifying the media player.
272  * @param[in] rate A rate of the playback.
273  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
274  * completion.
275  *
276  * @return PP_OK on success, otherwise an error code from
277  * <code>pp_errors.h</code>. Meaning of errors:
278  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
279  * to the media player.
280  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
281  * supported by attached data source.
282  */
283  int32_t (*SetPlaybackRate)(PP_Resource player,
284  double rate,
285  struct PP_CompletionCallback callback);
286  /* Playback time info */
287  /**
288  * Retrieves duration of the media played from attached data source.
289  *
290  * @param[in] player A <code>PP_Resource</code> identifying the media player.
291  * @param[out] duration Retrieved duration of the media.
292  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
293  * completion.
294  *
295  * @return PP_OK on success, otherwise an error code from
296  * <code>pp_errors.h</code>. Meaning of errors:
297  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
298  * to the media player.
299  * - <code>PP_ERROR_NOTSUPPORTED</code> - if given operation is not
300  * supported by attached data source (e.g. live content playback).
301  */
302  int32_t (*GetDuration)(PP_Resource player,
303  PP_TimeDelta* duration,
304  struct PP_CompletionCallback callback);
305  /**
306  * Retrieves current time/position of the media played from attached
307  * data source.
308  *
309  * This operation can be performed only for media player in
310  * <code>PP_MEDIAPLAYERSTATE_PLAYING</code> or
311  * <code>PP_MEDIAPLAYERSTATE_PAUSED</code> states.
312  *
313  * @param[in] player A <code>PP_Resource</code> identifying the media player.
314  * @param[out] duration Retrieved current time/position of the media.
315  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
316  * completion.
317  *
318  * @return PP_OK on success, otherwise an error code from
319  * <code>pp_errors.h</code>. Meaning of errors:
320  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
321  * to the media player.
322  * - <code>PP_ERROR_NOTSUPPORTED</code> - if data can't be retrieved
323  * due to invalid player state.
324  */
325  int32_t (*GetCurrentTime)(PP_Resource player,
326  PP_TimeTicks* time,
327  struct PP_CompletionCallback callback);
328  /* Playback state info */
329  /**
330  * Retrieves current state the media player.
331  *
332  * @param[in] player A <code>PP_Resource</code> identifying the media player.
333  * @param[out] state Retrieved current state of the media player.
334  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
335  * completion.
336  *
337  * @return PP_OK on success, otherwise an error code from
338  * <code>pp_errors.h</code>.
339  */
340  int32_t (*GetPlayerState)(PP_Resource player,
341  PP_MediaPlayerState* state,
342  struct PP_CompletionCallback callback);
343  /* Tracks info */
344  /**
345  * Retrieves information of current video track from the media played from
346  * attached data source.
347  *
348  * @param[in] player A <code>PP_Resource</code> identifying the media player.
349  * @param[out] track_info Retrieved video track information.
350  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
351  * completion.
352  *
353  * @return PP_OK on success, otherwise an error code from
354  * <code>pp_errors.h</code>. Meaning of errors:
355  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
356  * to the media player.
357  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no video track is available
358  * in media played from attached data source.
359  */
361  struct PP_VideoTrackInfo* track_info,
362  struct PP_CompletionCallback callback);
363  /**
364  * Retrieves information of all video tracks from the media played from
365  * attached data source.
366  *
367  * @param[in] player A <code>PP_Resource</code> identifying the media player.
368  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
369  * supported <code>PP_VideoTrackInfo</code> tracks descriptions.
370  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
371  * completion.
372  *
373  * @return If >= 0, the number of the tracks is returned, otherwise an
374  * error code from <code>pp_errors.h</code>. Meaning of errors:
375  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
376  * to the media player.
377  */
378  int32_t (*GetVideoTracksList)(PP_Resource player,
379  struct PP_ArrayOutput output,
380  struct PP_CompletionCallback callback);
381  /**
382  * Retrieves information of current audio track from the media played from
383  * attached data source.
384  *
385  * @param[in] player A <code>PP_Resource</code> identifying the media player.
386  * @param[out] track_info Retrieved audio track information.
387  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
388  * completion.
389  *
390  * @return PP_OK on success, otherwise an error code from
391  * <code>pp_errors.h</code>. Meaning of errors:
392  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
393  * to the media player.
394  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no audio track is available
395  * in media played from attached data source.
396  */
398  struct PP_AudioTrackInfo* track_info,
399  struct PP_CompletionCallback callback);
400  /**
401  * Retrieves information of all audio tracks from the media played from
402  * attached data source.
403  *
404  * @param[in] player A <code>PP_Resource</code> identifying the media player.
405  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
406  * supported <code>PP_AudioTrackInfo</code> tracks descriptions.
407  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
408  * completion.
409  *
410  * @return If >= 0, the number of the tracks is returned, otherwise an
411  * error code from <code>pp_errors.h</code>. Meaning of errors:
412  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
413  * to the media player.
414  */
415  int32_t (*GetAudioTracksList)(PP_Resource player,
416  struct PP_ArrayOutput output,
417  struct PP_CompletionCallback callback);
418  /**
419  * Retrieves information of current text/subtitles track from the media played
420  * from attached data source.
421  *
422  * @param[in] player A <code>PP_Resource</code> identifying the media player.
423  * @param[out] track_info Retrieved video track information.
424  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
425  * completion.
426  *
427  * @return PP_OK on success, otherwise an error code from
428  * <code>pp_errors.h</code>. Meaning of errors:
429  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
430  * to the media player.
431  * - <code>PP_ERROR_NOTSUPPORTED</code> - if no text/subtitles track
432  * is available in media played from attached data source.
433  */
435  struct PP_TextTrackInfo* track_info,
436  struct PP_CompletionCallback callback);
437  /**
438  * Retrieves information of all text/subtitles tracks from the media played
439  * from attached data source.
440  *
441  * If there are external subtitles tracks attached using
442  * <code>AddExternalSubtitles</code> they will be added to this list.
443  *
444  * @param[in] player A <code>PP_Resource</code> identifying the media player.
445  * @param[in] output A <code>PP_ArrayOutput</code> to receive list of the
446  * supported <code>PP_TextTrackInfo</code> tracks descriptions.
447  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
448  * completion.
449  *
450  * @return If >= 0, the number of the tracks is returned, otherwise an
451  * error code from <code>pp_errors.h</code>. Meaning of errors:
452  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
453  * to the media player.
454  */
455  int32_t (*GetTextTracksList)(PP_Resource player,
456  struct PP_ArrayOutput output,
457  struct PP_CompletionCallback callback);
458  /**
459  * Selects track for given stream type to by activated from media played
460  * from attached data source.
461  *
462  * @param[in] player A <code>PP_Resource</code> identifying the media player.
463  * @param[in] track_type A type of the stream for which activate track.
464  * @param[in] track_index An index of the track which has to be activated.
465  * Valid track index can be obtained from one of PP_*TrackInfo structures
466  * returned by corresponding call to Get*TracksInfo.
467  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
468  * completion.
469  *
470  * @return PP_OK on success, otherwise an error code from
471  * <code>pp_errors.h</code>. Meaning of errors:
472  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
473  * to the media player or passed |track_type| or |track_index| are
474  * not valid.
475  */
476  int32_t (*SelectTrack)(PP_Resource player,
478  uint32_t track_index,
479  struct PP_CompletionCallback callback);
480  /* Subtitles (text track) control */
481  /**
482  * Sets subtitles (text stream) visibility flag.
483  * Note - when subtitles are not displayed changing text track (by calling
484  * <code>SelectTrack</code>) will not automatically toggle this flag.
485  *
486  * Passing <code>PP_TRUE</code> will cause that subtitles will be displayed
487  * and <code>PP_FALSE</code> will hide them.
488  *
489  * @param[in] player A <code>PP_Resource</code> identifying the media player.
490  * @param[in] subtitles_visible visibility of the subtitles.
491  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
492  * completion.
493  *
494  * @return PP_OK on success, otherwise an error code from
495  * <code>pp_errors.h</code>. Meaning of errors:
496  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
497  * to the media player.
498  */
499  int32_t (*SetSubtitlesVisible)(PP_Resource player,
500  PP_Bool subtitles_visible,
501  struct PP_CompletionCallback callback);
502  /**
503  * Returns PP_OK in case of success and writes added text track information
504  * to |subtitles| argument. After that subtitles can be selected by calling
505  * <code>SelectTrack</code> and passing |track_index| field from |output|
506  * structure.
507  *
508  * Constraints:
509  * Calling this method before calling <code>Play</code> will set
510  * <code>subtitles.index</code> to <code>-1</code>. However such subtitles
511  * will be returned by call to <code>GetTextTrackList</code> after starting
512  * playback and they will have <code>is_external</code> flag set.
513  *
514  * @param[in] player A <code>PP_Resource</code> identifying the media player.
515  * @param[in] file_path A path of the subtitles.
516  * @param[out] subtitles Added text/subtitles track information.
517  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
518  * completion.
519  *
520  * @return PP_OK on success, otherwise an error code from
521  * <code>pp_errors.h</code>. Meaning of errors:
522  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
523  * to the media player.
524  */
526  const char* file_path,
527  struct PP_TextTrackInfo* subtitles,
528  struct PP_CompletionCallback callback);
529  /**
530  * Sets subtitles (text stream) display delay regarding to the current
531  * media time.
532  *
533  * @param[in] player A <code>PP_Resource</code> identifying the media player.
534  * @param[in] delay A delay to be set.
535  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
536  * completion.
537  *
538  * @return PP_OK on success, otherwise an error code from
539  * <code>pp_errors.h</code>. Meaning of errors:
540  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
541  * to the media player.
542  */
543  int32_t (*SetSubtitlesDelay)(PP_Resource player,
544  PP_TimeDelta delay,
545  struct PP_CompletionCallback callback);
546  /* Other - player control */
547  /**
548  * Sets display mode used to scale video to output area if necessary.
549  *
550  * @param[in] player A <code>PP_Resource</code> identifying the media player.
551  * @param[in] display_mode A display/scaling mode to be used.
552  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
553  * completion.
554  *
555  * @return PP_OK on success, otherwise an error code from
556  * <code>pp_errors.h</code>.
557  */
558  int32_t (*SetDisplayMode)(PP_Resource player,
559  PP_MediaPlayerDisplayMode display_mode,
560  struct PP_CompletionCallback callback);
561  /**
562  * Sets display region in which video will be displayed. Passed position
563  * is relative to the embed/object element of WebPage associated with given
564  * plugin.
565  *
566  * @param[in] player A <code>PP_Resource</code> identifying the media player.
567  * @param[in] rect Video region in which video will be displayed.
568  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
569  * completion.
570  *
571  * @return PP_OK on success, otherwise an error code from
572  * <code>pp_errors.h</code>.
573  */
574  int32_t (*SetDisplayRect)(PP_Resource player,
575  const struct PP_Rect* rect,
576  struct PP_CompletionCallback callback);
577  /**
578  * Calls DRM system specific operation.
579  *
580  * @param[in] player A <code>PP_Resource</code> identifying the media player.
581  * @param[in] drm_type A DRM system to be used
582  * @param[in] drm_operation A DRM specific operation to be performed.
583  * @param[in] drm_data_size A size of data buffer passed to DRM system.
584  * @param[in] drm_data A data buffer passed to DRM system.
585  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
586  * completion.
587  *
588  * @return PP_OK on success, otherwise an error code from
589  * <code>pp_errors.h</code>. Meaning of errors:
590  * - <code>PP_ERROR_BADARGUMENT</code> - if no data source is connected
591  * to the media player.
592  */
593  int32_t (*SetDRMSpecificData)(PP_Resource player,
594  PP_MediaPlayerDRMType drm_type,
595  PP_MediaPlayerDRMOperation drm_operation,
596  uint32_t drm_data_size,
597  const void* drm_data,
598  struct PP_CompletionCallback callback);
599 };
600 
602 /**
603  * @}
604  */
605 
606 #endif /* PPAPI_C_SAMSUNG_PPB_MEDIA_PLAYER_SAMSUNG_H_ */
607 
PP_Bool(* SetDRMListener)(PP_Resource data_source, const struct PPP_DRMListener_Samsung_0_1 *listener, void *user_data)
int32_t(* GetCurrentVideoTrackInfo)(PP_Resource player, struct PP_VideoTrackInfo *track_info, struct PP_CompletionCallback callback)
PP_Bool(* SetMediaEventsListener)(PP_Resource player, const struct PPP_MediaEventsListener_Samsung_0_1 *listener, void *user_data)
int32_t(* Seek)(PP_Resource player, PP_TimeTicks time, struct PP_CompletionCallback callback)
int32_t(* GetTextTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
PP_Bool(* IsMediaPlayer)(PP_Resource controller)
int32_t(* SetDisplayMode)(PP_Resource player, PP_MediaPlayerDisplayMode display_mode, struct PP_CompletionCallback callback)
PP_Bool(* SetBufferingListener)(PP_Resource data_source, const struct PPP_BufferingListener_Samsung_0_1 *listener, void *user_data)
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(* GetPlayerState)(PP_Resource player, PP_MediaPlayerState *state, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTime)(PP_Resource player, PP_TimeTicks *time, struct PP_CompletionCallback callback)
int32_t(* SetSubtitlesDelay)(PP_Resource player, PP_TimeDelta delay, struct PP_CompletionCallback callback)
PP_Bool(* SetMetadataListener)(PP_Resource data_source, const struct PPP_MediaMetadataListener_Samsung_0_1 *listener, void *user_data)
int32_t(* SetPlaybackRate)(PP_Resource player, double rate, struct PP_CompletionCallback callback)
int32_t(* GetAudioTracksList)(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 PP_Resource
Definition: pp_resource.h:40
double PP_TimeTicks
Definition: pp_time.h:42
PP_MediaPlayerDRMOperation
int32_t(* SetDisplayRect)(PP_Resource player, const struct PP_Rect *rect, struct PP_CompletionCallback callback)
int32_t(* GetCurrentTextTrackInfo)(PP_Resource player, struct PP_TextTrackInfo *track_info, 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(* GetCurrentAudioTrackInfo)(PP_Resource player, struct PP_AudioTrackInfo *track_info, struct PP_CompletionCallback callback)
int32_t(* AddExternalSubtitles)(PP_Resource player, const char *file_path, struct PP_TextTrackInfo *subtitles, struct PP_CompletionCallback callback)
int32_t PP_Instance
Definition: pp_instance.h:34
int32_t(* GetDuration)(PP_Resource player, PP_TimeDelta *duration, struct PP_CompletionCallback callback)
int32_t(* AttachDataSource)(PP_Resource player, PP_Resource data_source, struct PP_CompletionCallback callback)
PP_MediaPlayerDisplayMode
PP_Bool
Definition: pp_bool.h:30
double PP_TimeDelta
Definition: pp_time.h:49
int32_t(* SetSubtitlesVisible)(PP_Resource player, PP_Bool subtitles_visible, struct PP_CompletionCallback callback)
int32_t(* Stop)(PP_Resource player, struct PP_CompletionCallback callback)
int32_t(* Play)(PP_Resource player, struct PP_CompletionCallback callback)
PP_ElementaryStream_Type_Samsung
int32_t(* Pause)(PP_Resource player, struct PP_CompletionCallback callback)
PP_Resource(* Create)(PP_Instance instance)