Pepper_42_C++_interfaces
Public Types | Public Member Functions | List of all members
pp::MediaPlayer_Samsung Class Reference

#include <media_player_samsung.h>

Inheritance diagram for pp::MediaPlayer_Samsung:
Inheritance graph
Collaboration diagram for pp::MediaPlayer_Samsung:
Collaboration graph

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_Samsungoperator= (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)
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Additional Inherited Members

- Protected Member Functions inherited from pp::Resource
 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...
 

Detailed Description

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:

Definition at line 37 of file media_player_samsung.h.

Member Typedef Documentation

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.

Constructor & Destructor Documentation

pp::MediaPlayer_Samsung::MediaPlayer_Samsung ( )
pp::MediaPlayer_Samsung::MediaPlayer_Samsung ( const InstanceHandle instance)
explicit
pp::MediaPlayer_Samsung::MediaPlayer_Samsung ( const MediaPlayer_Samsung other)
virtual pp::MediaPlayer_Samsung::~MediaPlayer_Samsung ( )
virtual

Member Function Documentation

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. ///

Parameters
[in]file_pathA path of the subtitles.
[in]encodingSubtitle encoding. May be empty string, which will cause subtitles to be interpreted as UTF-8 text.
[in]callbackA CompletionCallbackWithOutput to be called upon completion with added subtitles information.
Returns
PP_OK on success, otherwise an error code from 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:

  1. Detaching currently attached data source
  2. Performing initialization of newly bound data source (this step is specific to data source which is being bound).
Parameters
[in]data_sourceA MediaDataSource_Samsung identifying data source to be attached to the player.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA 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.
Returns
If >= 0, the number of the tracks is returned, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion with retrieved audio track information.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion with retrieved text/subtitles track information.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion with retrieved current time.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion with retrieved video track information.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWitOutput to be called upon completion with retrieved duration of the media.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion with retrieved player state.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA 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.
Returns
If >= 0, the number of the tracks is returned, otherwise an error code from 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.

Parameters
[in]callbackA 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.
Returns
If >= 0, the number of the tracks is returned, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]timeA time stamp from begging of the clip to from which playback should be resumed.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]track_typeA type of the stream for which activate track.
[in]track_indexAn 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]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]rectVideo region in which video will be displayed.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]drm_typeA DRM system to be used
[in]drm_operationA DRM specific operation to be performed.
[in]drm_data_sizeA size of data buffer passed to DRM system.
[in]drm_dataA data buffer passed to DRM system.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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

Parameters
[in]rateA rate of the playback.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]delayA delay to be set.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

Parameters
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from 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.

The documentation for this class was generated from the following file: