Pepper_42_C++_interfaces
|
#include <media_player_samsung.h>
Public Types | |
typedef std::vector < PP_VideoTrackInfo > | VideoTracksList |
typedef std::vector < PP_AudioTrackInfo > | AudioTracksList |
typedef std::vector < PP_TextTrackInfo > | TextTracksList |
Public Member Functions | |
MediaPlayer_Samsung () | |
MediaPlayer_Samsung (const InstanceHandle &instance) | |
MediaPlayer_Samsung (const MediaPlayer_Samsung &other) | |
MediaPlayer_Samsung & | operator= (const MediaPlayer_Samsung &other) |
virtual | ~MediaPlayer_Samsung () |
int32_t | AttachDataSource (const MediaDataSource_Samsung &data_source, const CompletionCallback &callback) |
int32_t | Play (const CompletionCallback &callback) |
int32_t | Pause (const CompletionCallback &callback) |
int32_t | Stop (const CompletionCallback &callback) |
int32_t | Seek (PP_TimeTicks time, const CompletionCallback &callback) |
int32_t | SetPlaybackRate (double rate, const CompletionCallback &callback) |
int32_t | GetDuration (const CompletionCallbackWithOutput< PP_TimeDelta > &callback) |
int32_t | GetCurrentTime (const CompletionCallbackWithOutput< PP_TimeTicks > &callback) |
int32_t | GetPlayerState (const CompletionCallbackWithOutput< PP_MediaPlayerState > &callback) |
int32_t | GetCurrentVideoTrackInfo (const CompletionCallbackWithOutput< PP_VideoTrackInfo > &callback) |
int32_t | GetVideoTracksList (const CompletionCallbackWithOutput< VideoTracksList > &callback) |
int32_t | GetCurrentAudioTrackInfo (const CompletionCallbackWithOutput< PP_AudioTrackInfo > &callback) |
int32_t | GetAudioTracksList (const CompletionCallbackWithOutput< AudioTracksList > &callback) |
int32_t | GetCurrentTextTrackInfo (const CompletionCallbackWithOutput< PP_TextTrackInfo > &callback) |
int32_t | GetTextTracksList (const CompletionCallbackWithOutput< TextTracksList > &callback) |
int32_t | SelectTrack (PP_ElementaryStream_Type_Samsung track_type, uint32_t track_index, const CompletionCallback &callback) |
int32_t | AddExternalSubtitles (const std::string &file_path, const std::string &encoding, const CompletionCallbackWithOutput< PP_TextTrackInfo > &callback) |
int32_t | SetSubtitlesDelay (PP_TimeDelta delay, const CompletionCallback &callback) |
int32_t | SetDisplayRect (const PP_Rect &rect, const CompletionCallback &callback) |
int32_t | SetDRMSpecificData (PP_MediaPlayerDRMType drm_type, PP_MediaPlayerDRMOperation drm_operation, uint32_t drm_data_size, const void *drm_data, const CompletionCallback &callback) |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
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 241 of file media_player_samsung.h.
typedef std::vector<PP_TextTrackInfo> pp::MediaPlayer_Samsung::TextTracksList |
Definition at line 273 of file media_player_samsung.h.
typedef std::vector<PP_VideoTrackInfo> pp::MediaPlayer_Samsung::VideoTracksList |
Definition at line 209 of file media_player_samsung.h.
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | ) |
|
explicit |
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | const MediaPlayer_Samsung & | other | ) |
|
virtual |
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. 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
. 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. 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. 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. 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. 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. 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). 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
. 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. 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. MediaPlayer_Samsung& pp::MediaPlayer_Samsung::operator= | ( | const MediaPlayer_Samsung & | other | ) |
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. 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. 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.
[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. 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
.
[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. 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
. 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. 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. 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. 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.