Pepper_56_C++_interfaces
Pepper_56_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 |
Public Member Functions | |
MediaPlayer_Samsung (const InstanceHandle &instance) | |
Creates a player bound to pp::Instance. | |
MediaPlayer_Samsung (const InstanceHandle &instance, DoNotBindToInstance) | |
MediaPlayer_Samsung (const InstanceHandle &instance, PP_MediaPlayerMode player_mode, PP_BindToInstanceMode bind_mode) | |
MediaPlayer_Samsung (const MediaPlayer_Samsung &other) | |
MediaPlayer_Samsung & | operator= (const MediaPlayer_Samsung &other) |
bool | BindToInstance (const InstanceHandle &instance) |
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 | SetDisplayMode (PP_MediaPlayerDisplayMode display_mode, 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) |
int32_t | SetVr360Mode (PP_MediaPlayerVr360Mode display_mode, const CompletionCallback &callback) |
int32_t | SetVr360Rotation (float horizontal_angle, float vertical_angle, const CompletionCallback &callback) |
int32_t | SetVr360ZoomLevel (uint32_t zoom_level, const CompletionCallback &callback) |
![]() | |
Resource () | |
The default constructor. | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. | |
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. | |
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). 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)
.
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | const InstanceHandle & | instance, |
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
.
pp::MediaPlayer_Samsung::MediaPlayer_Samsung | ( | const InstanceHandle & | instance, |
PP_MediaPlayerMode | player_mode, | ||
PP_BindToInstanceMode | bind_mode | ||
) |
Creates a player with given modes. Default values create a player that can be used in the most typical scenarios.
[in] | player_mode | Create a player that is either bound to instance or not. 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 for more details. |
[in] | bind_mode | Create a player that uses a specified playback mode. |
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 can be selected:
|
[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
. 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.
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. 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. 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. 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. int32_t pp::MediaPlayer_Samsung::SetDisplayMode | ( | PP_MediaPlayerDisplayMode | display_mode, |
const CompletionCallback & | callback | ||
) |
Sets a display mode which will be used by player. If no display mode is set, PP_MEDIAPLAYERDISPLAYMODE_STRETCH
is used.
[in] | display_mode | A display mode to be used. See PP_MediaPlayerDisplayMode enum for possible options. |
[in] | callback | A CompletionCallback to be called upon completion. |
pp_errors.h
. 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::SetVr360Mode | ( | PP_MediaPlayerVr360Mode | display_mode, |
const CompletionCallback & | callback | ||
) |
Set Vr360 mode. This function should be called player idle state.
[in] | player | A PP_Resource identifying the media player. |
[in] | vr360_mode | PP_MediaPlayerVr360Mode |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong.PP_ERROR_FAILED
- if player was is invalid state. int32_t pp::MediaPlayer_Samsung::SetVr360Rotation | ( | float | horizontal_angle, |
float | vertical_angle, | ||
const CompletionCallback & | callback | ||
) |
Set Vr360 rotation.
[in] | player | A PP_Resource identifying the media player. |
[in] | horizontal_angle | - horizontal angle of rotation. |
[in] | vertical_angle | - vrtical angle of rotation. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong. int32_t pp::MediaPlayer_Samsung::SetVr360ZoomLevel | ( | uint32_t | zoom_level, |
const CompletionCallback & | callback | ||
) |
Set Vr360 zoom.
[in] | player | A PP_Resource identifying the media player. |
[in] | zoom | - zoom level. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong. 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.