Pepper_47_C++_interfaces
|
#include <media_player_samsung.h>
Public Types | |
enum | DoNotBindToInstance { DO_NOT_BIND_TO_INSTANCE } |
typedef std::vector < PP_VideoTrackInfo > | VideoTracksList |
typedef std::vector < PP_AudioTrackInfo > | AudioTracksList |
typedef std::vector < PP_TextTrackInfo > | TextTracksList |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
MediaPlayer_Samsung
is type allowing application to control playback state, inquire about playback state. It's also responsible for assigning data source which will feed player with media data.
Assumptions:
PPB_Instance.BindGraphics
). Application must set proper CSS style for embed element with NaCl application (mostly transparent background). Definition at line 37 of file media_player_samsung.h.
typedef std::vector<PP_AudioTrackInfo> pp::MediaPlayer_Samsung::AudioTracksList |
Definition at line 265 of file media_player_samsung.h.
typedef std::vector<PP_TextTrackInfo> pp::MediaPlayer_Samsung::TextTracksList |
Definition at line 297 of file media_player_samsung.h.
typedef std::vector<PP_VideoTrackInfo> pp::MediaPlayer_Samsung::VideoTracksList |
Definition at line 233 of file media_player_samsung.h.
An enum that controls binding Media Player to pp::Instance in the constructor. See descriptions of MediaPlayer_Samsung( const InstanceHandle& instance)
and MediaPlayer_Samsung( const InstanceHandle& instance, DoNotBindToInstance)
.
Enumerator | |
---|---|
DO_NOT_BIND_TO_INSTANCE |
Definition at line 43 of file media_player_samsung.h.
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | ) |
Definition at line 33 of file media_player_samsung.cc.
|
explicit |
Creates a player bound to pp::Instance.
Definition at line 36 of file media_player_samsung.cc.
References pp::Resource::PassRefFromConstructor(), and pp::InstanceHandle::pp_instance().
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | const InstanceHandle & | instance, |
MediaPlayer_Samsung::DoNotBindToInstance | |||
) |
Creates a player not bound to pp::Instance. It can be useful when the player is used with other graphic resources that need to be bound to pp::Instance. See PPB_Instance::BindGraphics
and MediaPlayer_Samsung::BindToInstance
.
Definition at line 47 of file media_player_samsung.cc.
References pp::Resource::PassRefFromConstructor(), and pp::InstanceHandle::pp_instance().
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | const MediaPlayer_Samsung & | other | ) |
Definition at line 57 of file media_player_samsung.cc.
|
virtual |
Definition at line 67 of file media_player_samsung.cc.
int32_t pp::MediaPlayer_Samsung::AddExternalSubtitles | ( | const std::string & | file_path, |
const std::string & | encoding, | ||
const CompletionCallbackWithOutput< PP_TextTrackInfo > & | 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
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
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] | file_path | A path of the subtitles. |
[in] | encoding | Subtitle encoding. May be empty string, which will cause subtitles to be interpreted as UTF-8 text. |
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with added subtitles information. |
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. Definition at line 311 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::AttachDataSource | ( | const MediaDataSource_Samsung & | data_source, |
const CompletionCallback & | callback | ||
) |
Attaches given MediaDataSource_Samsung
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.
Attaching data source to the player will cause:
[in] | data_source | A MediaDataSource_Samsung identifying data source to be attached to the player. |
[in] | callback | A CompletionCallback to be called upon completion. |
pp_errors.h
. Definition at line 77 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
bool pp::MediaPlayer_Samsung::BindToInstance | ( | const InstanceHandle & | instance | ) |
Binds this resource to the pp::Instance as the current display surface. It is like PPB_Instance::BindGraphics
for media player resource. Normally, when the constructor is called without DoNotBindToInstance, there is no need to call this method.
Definition at line 70 of file media_player_samsung.cc.
References pp::InstanceHandle::pp_instance(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetAudioTracksList | ( | const CompletionCallbackWithOutput< AudioTracksList > & | callback | ) |
Retrieves information of all audio tracks from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with list of audio tracks available in currently attached data source. List will be empty if media played form attached data source doesn't have any audio tracks. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. Definition at line 248 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetCurrentAudioTrackInfo | ( | const CompletionCallbackWithOutput< PP_AudioTrackInfo > & | callback | ) |
Retrieves information of current audio track from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with retrieved audio track information. |
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. Definition at line 232 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetCurrentTextTrackInfo | ( | const CompletionCallbackWithOutput< PP_TextTrackInfo > & | callback | ) |
Retrieves information of current text/subtitles track from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with retrieved text/subtitles track information. |
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. Definition at line 262 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetCurrentTime | ( | const CompletionCallbackWithOutput< PP_TimeTicks > & | 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] | callback | A CompletionCallbackWithOutput to be called upon completion with retrieved current time. |
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. Definition at line 172 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetCurrentVideoTrackInfo | ( | const CompletionCallbackWithOutput< PP_VideoTrackInfo > & | callback | ) |
Retrieves information of current video track from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with retrieved video track information. |
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. Definition at line 202 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetDuration | ( | const CompletionCallbackWithOutput< PP_TimeDelta > & | callback | ) |
Retrieves duration of the media played from attached data source.
[in] | callback | A CompletionCallbackWitOutput to be called upon completion with retrieved duration of the media. |
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). Definition at line 159 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetPlayerState | ( | const CompletionCallbackWithOutput< PP_MediaPlayerState > & | callback | ) |
Retrieves current state the media player.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with retrieved player state. |
pp_errors.h
. Definition at line 187 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetTextTracksList | ( | const CompletionCallbackWithOutput< TextTracksList > & | callback | ) |
Retrieves information of all text/subtitles tracks from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with list of text/subtitles tracks available in currently attached data source. List will be empty if media played form attached data source doesn't have any text/subtitles tracks. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. Definition at line 278 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::GetVideoTracksList | ( | const CompletionCallbackWithOutput< VideoTracksList > & | callback | ) |
Retrieves information of all video tracks from the media played from attached data source.
[in] | callback | A CompletionCallbackWithOutput to be called upon completion with list of video tracks available in currently attached data source. List will be empty if media played form attached data source doesn't have any video tracks. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if no data source is connected to the media player. Definition at line 218 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallbackWithOutput< T >::output(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
MediaPlayer_Samsung & pp::MediaPlayer_Samsung::operator= | ( | const MediaPlayer_Samsung & | other | ) |
Definition at line 61 of file media_player_samsung.cc.
References pp::Resource::operator=().
int32_t pp::MediaPlayer_Samsung::Pause | ( | const CompletionCallback & | callback | ) |
Requests to pause playback of media from data source attached to the media player.
[in] | callback | A 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. Definition at line 107 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::Play | ( | const CompletionCallback & | callback | ) |
Requests to start playback of media from data source attached to the media player.
[in] | callback | A 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. Definition at line 95 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::Seek | ( | PP_TimeTicks | time, |
const 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] | time | A time stamp from begging of the clip to from which playback should be resumed. |
[in] | callback | A 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. Definition at line 131 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::SelectTrack | ( | PP_ElementaryStream_Type_Samsung | track_type, |
uint32_t | track_index, | ||
const 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 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] | 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 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. Definition at line 292 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::SetDisplayRect | ( | const PP_Rect & | rect, |
const 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] | rect | Video region in which video will be displayed. |
[in] | callback | A CompletionCallback to be called upon completion. |
pp_errors.h
. Definition at line 344 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::SetDRMSpecificData | ( | PP_MediaPlayerDRMType | drm_type, |
PP_MediaPlayerDRMOperation | drm_operation, | ||
uint32_t | drm_data_size, | ||
const void * | drm_data, | ||
const CompletionCallback & | callback | ||
) |
Calls DRM system specific operation.
[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 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. Definition at line 360 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::SetPlaybackRate | ( | double | rate, |
const 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] | rate | A rate of the playback. |
[in] | callback | A 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. Definition at line 144 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::SetSubtitlesDelay | ( | PP_TimeDelta | delay, |
const CompletionCallback & | callback | ||
) |
Sets subtitles (text stream) SubtitleListener
event emission delay regarding to the current media time.
[in] | delay | A delay to be set. |
[in] | callback | A 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. Definition at line 328 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
int32_t pp::MediaPlayer_Samsung::Stop | ( | const CompletionCallback & | callback | ) |
Requests to stop playback of media from data source attached to the media player.
[in] | callback | A 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. Definition at line 119 of file media_player_samsung.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().