Pepper_56_C_interfaces
Pepper_56_C_interfaces
|
#include <ppb_media_player_samsung.h>
Interface representing player and providing functionality of playback control and attaching data source feeding player.
Assumptions:
PPB_Instance.BindGraphics
). Application must set proper CSS style for embed element with NaCl application (mostly transparent background). int32_t(* PPB_MediaPlayer_Samsung_1_4::AddExternalSubtitles)(PP_Resource player, const char *file_path, const char *encoding, struct PP_TextTrackInfo *subtitles, struct PP_CompletionCallback callback) |
Adds external subtitles. Returns PP_OK/code> in case of success and writes added text track information to |subtitles| param. After that newly added subtitles will be activated and
PPB_SubtitleListener_Samsung
will be notified about it's texts at the time those texts should be shown.
Please note that player is responsible only for subtitle file parsing. No subtitles are displayed by the player. Application can use
PPB_SubtitleListener_Samsung
to get subtitle texts at correct playback times and display them manually.
Constraints: Ability to add external subtitles after attaching data source is implementation dependent. If it is impossible to add external subtitles after data source is attached, this method will fail with
PP_ERROR_NOTSUPPORTED
error code. Therefore this method is guaranteed to succeed only before data source is attached.
[in] | player | A PP_Resource identifying the media player. |
[in] | file_path | A path of the subtitles. |
[in] | encoding | Subtitle encoding can be selected:
|
[out] | subtitles | Added text/subtitles track information. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_FILENOTFOUND
- if provided file_path is invalid.PP_ERROR_BADARGUMENT
- if provided encoding is invalid.PP_ERROR_NOTSUPPORTED
- if method was called after attaching a data source and such operation is not supported on the current implementation. int32_t(* PPB_MediaPlayer_Samsung_1_4::AttachDataSource)(PP_Resource player, PP_Resource data_source, struct PP_CompletionCallback callback) |
Attaches given PPB_MediaDataSource
to the player.
You can pass a NULL
resource as buffer to detach currently attached data source. Reattaching data source will return PP_OK
and do nothing.
Attached data source must be valid. Otherwise PP_ERROR_BADARGUMENT
will be returned. Attaching data source to the player will cause:
[in] | player | A PP_Resource identifying the media player. |
[in] | data_source | A PP_Resource identifying data source to be attached to the player. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. PP_Resource(* PPB_MediaPlayer_Samsung_1_4::Create)(PP_Instance instance) |
Creates a new media player resource with PP_MEDIAPLAYERMODE_DEFAULT
player mode and binds it to the instance.
[in] | instance | A PP_Instance identifying the instance with the media player. |
PP_Resource
corresponding to a media player if successful or 0 otherwise. PP_Resource(* PPB_MediaPlayer_Samsung_1_4::CreateWithOptions)(PP_Instance instance, PP_MediaPlayerMode player_mode, PP_BindToInstanceMode bind_mode) |
Creates a player with specified modes of player and binding to pp::Instance.
[in] | instance | A PP_Instance identifying the instance with the media player. |
[in] | player_mode | A PP_MediaPlayerMode identifying the player mode used for media player instance. |
[in] | bind_mode | A PP_BindToInstanceMode specifying if binding to PPB_Instance graphics should be performed. |
PP_Resource
corresponding to a media player if successful or 0 otherwise. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetAudioTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
Retrieves information of all audio tracks from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[in] | output | A PP_ArrayOutput to receive list of the supported PP_AudioTrackInfo tracks descriptions. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetCurrentAudioTrackInfo)(PP_Resource player, struct PP_AudioTrackInfo *track_info, struct PP_CompletionCallback callback) |
Retrieves information of current audio track from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[out] | track_info | Retrieved audio track information. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if no audio track is available in media played from attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetCurrentTextTrackInfo)(PP_Resource player, struct PP_TextTrackInfo *track_info, struct PP_CompletionCallback callback) |
Retrieves information of current text/subtitles track from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[out] | track_info | Retrieved video track information. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if no text/subtitles track is available in media played from attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetCurrentTime)(PP_Resource player, PP_TimeTicks *time, struct PP_CompletionCallback callback) |
Retrieves current time/position of the media played from attached data source.
This operation can be performed only for media player in PP_MEDIAPLAYERSTATE_PLAYING
or PP_MEDIAPLAYERSTATE_PAUSED
states.
[in] | player | A PP_Resource identifying the media player. |
[out] | duration | Retrieved current time/position of the media. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if data can't be retrieved due to invalid player state. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetCurrentVideoTrackInfo)(PP_Resource player, struct PP_VideoTrackInfo *track_info, struct PP_CompletionCallback callback) |
Retrieves information of current video track from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[out] | track_info | Retrieved video track information. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if no video track is available in media played from attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetDuration)(PP_Resource player, PP_TimeDelta *duration, struct PP_CompletionCallback callback) |
Retrieves duration of the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[out] | duration | Retrieved duration of the media. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source (e.g. live content playback). int32_t(* PPB_MediaPlayer_Samsung_1_4::GetPlayerState)(PP_Resource player, PP_MediaPlayerState *state, struct PP_CompletionCallback callback) |
Retrieves current state the media player.
[in] | player | A PP_Resource identifying the media player. |
[out] | state | Retrieved current state of the media player. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetTextTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
Retrieves information of all text/subtitles tracks from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[in] | output | A PP_ArrayOutput to receive list of the supported PP_TextTrackInfo tracks descriptions. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. int32_t(* PPB_MediaPlayer_Samsung_1_4::GetVideoTracksList)(PP_Resource player, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
Retrieves information of all video tracks from the media played from attached data source.
[in] | player | A PP_Resource identifying the media player. |
[in] | output | A PP_ArrayOutput to receive list of the supported PP_VideoTrackInfo tracks descriptions. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. PP_Bool(* PPB_MediaPlayer_Samsung_1_4::IsMediaPlayer)(PP_Resource controller) |
Determines if the given resource is a media player.
[in] | resource | A PP_Resource identifying a resource. |
PP_TRUE
if the resource is a PPB_MediaPlayer_Samsung
, PP_FALSE
if the resource is invalid or some other type. int32_t(* PPB_MediaPlayer_Samsung_1_4::Pause)(PP_Resource player, struct PP_CompletionCallback callback) |
Requests to pause playback of media from data source attached to the media player.
[in] | player | A PP_Resource identifying the media player. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::Play)(PP_Resource player, struct PP_CompletionCallback callback) |
Requests to start playback of media from data source attached to the media player.
[in] | player | A PP_Resource identifying the media player. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::Seek)(PP_Resource player, PP_TimeTicks time, struct PP_CompletionCallback callback) |
Requests to seek media from attached data source to the given time stamp. After calling Seek new packets should be sent to the player. Only after receiving a number of packets the player can complete a seek operation and run a callback.
[in] | player | A PP_Resource identifying the media player. |
[in] | time | A time stamp from begging of the clip to from which playback should be resumed. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source. int32_t(* PPB_MediaPlayer_Samsung_1_4::SelectTrack)(PP_Resource player, PP_ElementaryStream_Type_Samsung track_type, uint32_t track_index, struct PP_CompletionCallback callback) |
Selects a track for the given stream type to be activated for media played from the attached data source.
Remarks: If activated track is a text track, it will be automatically activated and therefore it's subtitles will be delivered as events to the PPP_SubtitleListener_Samsung
.
Constraints: An ability to handle multiple video tracks at a time is not guaranteed to be supported on all platforms, therefore calling this method with a PP_ElementaryStream_Type_Samsung_VIDEO
as a stream type may result with a PP_ERROR_NOTSUPPORTED
error code.
[in] | player | A PP_Resource identifying the media player. |
[in] | track_type | A type of the stream for which activate track. |
[in] | track_index | An index of the track which has to be activated. Valid track index can be obtained from one of PP_*TrackInfo structures returned by corresponding call to Get*TracksInfo. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player or passed |track_type| or |track_index| are not valid.PP_ERROR_NOTSUPPORTED
- if called with PP_ElementaryStream_Type_Samsung_VIDEO
on a platform that supports only one video track at a time. PP_Bool(* PPB_MediaPlayer_Samsung_1_4::SetBufferingListener)(PP_Resource player, const struct PPP_BufferingListener_Samsung_1_0 *listener, void *user_data) |
Attaches PPP_BufferingListener_Samsung
to the player. After attaching plugin is notified about initial media buffering events. Previously attached listener (if any) is detached.
All listeners will be called in the same thread. If this method was invoked in a thread with a running message loop, the listener will run in the current thread. Otherwise, it will run on the main thread.
[in] | player | A PP_Resource identifying the media player. |
[in] | listener | A PPP_BufferingListener_Samsung interface whose methods will be notified about subscribed events. Passing NULL will detach currently set listener. |
[in] | user_data | A pointer to user data which will be passed to the listeners during method invocation (optional). |
PP_TRUE
if listener has been successfully attached, PP_FALSE
otherwise. This method will return false only when called on resource not representing PPB_MediaPlayer_Samsung
. int32_t(* PPB_MediaPlayer_Samsung_1_4::SetDisplayMode)(PP_Resource player, PP_MediaPlayerDisplayMode display_mode, struct PP_CompletionCallback callback) |
Sets a display mode which will be used by player. If no display mode is set, PP_MEDIAPLAYERDISPLAYMODE_STRETCH
is used.
[in] | player | A PP_Resource identifying the media player. |
[in] | display_mode | A display mode to be used. See PP_MediaPlayerDisplayMode enum for possible options. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. int32_t(* PPB_MediaPlayer_Samsung_1_4::SetDisplayRect)(PP_Resource player, const struct PP_Rect *rect, struct PP_CompletionCallback callback) |
Sets display region in which video will be displayed. Passed position is relative to the embed/object element of WebPage associated with given plugin.
[in] | player | A PP_Resource identifying the media player. |
[in] | rect | Video region in which video will be displayed. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. PP_Bool(* PPB_MediaPlayer_Samsung_1_4::SetDRMListener)(PP_Resource player, const struct PPP_DRMListener_Samsung_1_0 *listener, void *user_data) |
Attaches PPP_DRMListener_Samsung
to the player. After attaching plugin is notified about DRM related events. Previously attached listener (if any) is detached.
All listeners will be called in the same thread. If this method was invoked in a thread with a running message loop, the listener will run in the current thread. Otherwise, it will run on the main thread.
[in] | player | A PP_Resource identifying the media player. |
[in] | listener | A PPP_DRMListener_Samsung interface whose methods will be notified about subscribed events. Passing NULL will detach currently set listener. |
[in] | user_data | A pointer to user data which will be passed to the listeners during method invocation (optional). |
PP_TRUE
if listener has been successfully attached, PP_FALSE
otherwise. This method will return false only when called on resource not representing PPB_MediaPlayer_Samsung
. int32_t(* PPB_MediaPlayer_Samsung_1_4::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) |
Calls DRM system specific operation.
[in] | player | A PP_Resource identifying the media player. |
[in] | drm_type | A DRM system to be used |
[in] | drm_operation | A DRM specific operation to be performed. |
[in] | drm_data_size | A size of data buffer passed to DRM system. |
[in] | drm_data | A data buffer passed to DRM system. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. PP_Bool(* PPB_MediaPlayer_Samsung_1_4::SetMediaEventsListener)(PP_Resource player, const struct PPP_MediaEventsListener_Samsung_1_0 *listener, void *user_data) |
Attaches PPP_MediaEventsListener_Samsung
to the player. After attaching plugin is notified about media playback related event. Previously attached listener (if any) is detached.
All listeners will be called in the same thread. If this method was invoked in a thread with a running message loop, the listener will run in the current thread. Otherwise, it will run on the main thread.
[in] | player | A PP_Resource identifying the media player. |
[in] | listener | A PPP_MediaEventsListener_Samsung interface whose methods will be notified about subscribed events. Passing NULL will detach currently set listener. |
[in] | user_data | A pointer to user data which will be passed to the listeners during method invocation (optional). |
PP_TRUE
if listener has been successfully attached, PP_FALSE
otherwise. This method will return false only when called on resource not representing PPB_MediaPlayer_Samsung
. int32_t(* PPB_MediaPlayer_Samsung_1_4::SetPlaybackRate)(PP_Resource player, double rate, struct PP_CompletionCallback callback) |
Sets playback rate, pass: |rate| == 1.0 to mark normal playback 0.0 < |rate| < 1.0 to mark speeds slower than normal |rate| > 1.0 to mark speeds faster than normal
[in] | player | A PP_Resource identifying the media player. |
[in] | rate | A rate of the playback. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source. PP_Bool(* PPB_MediaPlayer_Samsung_1_4::SetSubtitleListener)(PP_Resource player, const struct PPP_SubtitleListener_Samsung_1_0 *listener, void *user_data) |
Attaches PPP_SubtitleListener_Samsung
to the player. After attaching plugin is notified about subtitle texts that are parsed by the internal player subtitle parser at the time when they should be displayed. Only notifications regarding texts that originate from active text track are delivered this way. Previously attached listener (if any) is detached.
All listeners will be called in the same thread. If this method was invoked in a thread with a running message loop, the listener will run in the current thread. Otherwise, it will run on the main thread.
[in] | player | A PP_Resource identifying the media player. |
[in] | listener | A PPP_SubtitleListener_Samsung interface whose methods will be notified about subscribed events. Passing NULL will detach currently set listener. |
[in] | user_data | A pointer to user data which will be passed to the listeners during method invocation (optional). |
PP_TRUE
if listener has been successfully attached, PP_FALSE
otherwise. This method will return false only when called on resource not representing PPB_MediaPlayer_Samsung
. int32_t(* PPB_MediaPlayer_Samsung_1_4::SetSubtitlesDelay)(PP_Resource player, PP_TimeDelta delay, struct PP_CompletionCallback callback) |
Sets subtitles (text stream) PPP_SubtitleListener_Samsung
event emission delay regarding to the current media time.
[in] | player | A PP_Resource identifying the media player. |
[in] | delay | A delay to be set. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. int32_t(* PPB_MediaPlayer_Samsung_1_4::Stop)(PP_Resource player, struct PP_CompletionCallback callback) |
Requests to stop playback of media from data source attached to the media player.
[in] | player | A PP_Resource identifying the media player. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player.PP_ERROR_NOTSUPPORTED
- if given operation is not supported by attached data source.