Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
media_player_samsung.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_SAMSUNG_MEDIA_PLAYER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_MEDIA_PLAYER_SAMSUNG_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "ppapi/c/samsung/ppb_media_player_samsung.h"
13 #include "ppapi/cpp/resource.h"
14 
20 namespace pp {
21 
22 class InstanceHandle;
23 class MediaDataSource_Samsung;
24 
37 class MediaPlayer_Samsung : public Resource {
38  public:
43  enum DoNotBindToInstance { DO_NOT_BIND_TO_INSTANCE };
44 
46 
48  explicit MediaPlayer_Samsung(const InstanceHandle& instance);
49 
55 
66  MediaPlayer_Samsung(const InstanceHandle& instance,
67  PP_MediaPlayerMode player_mode,
68  PP_BindToInstanceMode bind_mode);
69 
71 
72  MediaPlayer_Samsung& operator=(const MediaPlayer_Samsung& other);
73 
74  virtual ~MediaPlayer_Samsung();
75 
80  bool BindToInstance(const InstanceHandle& instance);
81 
100  int32_t AttachDataSource(
101  const MediaDataSource_Samsung& data_source,
102  const CompletionCallback& callback);
103 
104  /* Playback control */
105 
118  int32_t Play(const CompletionCallback& callback);
119 
132  int32_t Pause(const CompletionCallback& callback);
133 
146  int32_t Stop(const CompletionCallback& callback);
147 
164  int32_t Seek(PP_TimeTicks time, const CompletionCallback& callback);
165 
181  int32_t SetPlaybackRate(double rate, const CompletionCallback& callback);
182 
183  /* Playback time info */
184 
196  int32_t GetDuration(
198 
215  int32_t GetCurrentTime(
217 
218  /* Playback state info */
219 
227  int32_t GetPlayerState(
229 
230  /* Tracks info */
231 
244  int32_t GetCurrentVideoTrackInfo(
246 
247  typedef std::vector<PP_VideoTrackInfo> VideoTracksList;
248 
261  int32_t GetVideoTracksList(
263 
276  int32_t GetCurrentAudioTrackInfo(
278 
279  typedef std::vector<PP_AudioTrackInfo> AudioTracksList;
280 
293  int32_t GetAudioTracksList(
295 
308  int32_t GetCurrentTextTrackInfo(
310 
311  typedef std::vector<PP_TextTrackInfo> TextTracksList;
312 
325  int32_t GetTextTracksList(
327 
357  int32_t SelectTrack(
358  PP_ElementaryStream_Type_Samsung track_type,
359  uint32_t track_index,
360  const CompletionCallback& callback);
361 
362  /* Subtitles control */
363 
401  int32_t AddExternalSubtitles(
402  const std::string& file_path,
403  const std::string& encoding,
405 
417  int32_t SetSubtitlesDelay(
418  PP_TimeDelta delay,
419  const CompletionCallback& callback);
420 
421  /* Other - player control */
422 
433  int32_t SetDisplayRect(
434  const PP_Rect& rect,
435  const CompletionCallback& callback);
436 
447  int32_t SetDisplayMode(
448  PP_MediaPlayerDisplayMode display_mode,
449  const CompletionCallback& callback);
450 
451  /* DRM Related */
452 
466  int32_t SetDRMSpecificData(
467  PP_MediaPlayerDRMType drm_type,
468  PP_MediaPlayerDRMOperation drm_operation,
469  uint32_t drm_data_size,
470  const void* drm_data,
471  const CompletionCallback& callback);
472 
473  /* Vr360 Control */
474 
487  int32_t SetVr360Mode(
488  PP_MediaPlayerVr360Mode display_mode,
489  const CompletionCallback& callback);
490 
502  int32_t SetVr360Rotation(
503  float horizontal_angle,
504  float vertical_angle,
505  const CompletionCallback& callback);
506 
517  int32_t SetVr360ZoomLevel(
518  uint32_t zoom_level,
519  const CompletionCallback& callback);
520 };
521 
522 } // namespace pp
523 
524 #endif // PPAPI_CPP_SAMSUNG_MEDIA_PLAYER_SAMSUNG_H_
Definition: media_data_source_samsung.h:22
int32_t SelectTrack(PP_ElementaryStream_Type_Samsung track_type, uint32_t track_index, const CompletionCallback &callback)
int32_t GetDuration(const CompletionCallbackWithOutput< PP_TimeDelta > &callback)
int32_t AddExternalSubtitles(const std::string &file_path, const std::string &encoding, const CompletionCallbackWithOutput< PP_TextTrackInfo > &callback)
int32_t Pause(const CompletionCallback &callback)
int32_t GetCurrentTextTrackInfo(const CompletionCallbackWithOutput< PP_TextTrackInfo > &callback)
Definition: completion_callback.h:189
int32_t GetCurrentVideoTrackInfo(const CompletionCallbackWithOutput< PP_VideoTrackInfo > &callback)
int32_t SetVr360Rotation(float horizontal_angle, float vertical_angle, const CompletionCallback &callback)
bool BindToInstance(const InstanceHandle &instance)
int32_t GetPlayerState(const CompletionCallbackWithOutput< PP_MediaPlayerState > &callback)
int32_t SetVr360ZoomLevel(uint32_t zoom_level, const CompletionCallback &callback)
int32_t AttachDataSource(const MediaDataSource_Samsung &data_source, const CompletionCallback &callback)
int32_t Stop(const CompletionCallback &callback)
int32_t Play(const CompletionCallback &callback)
Definition: completion_callback.h:26
int32_t GetTextTracksList(const CompletionCallbackWithOutput< TextTracksList > &callback)
int32_t SetDisplayRect(const PP_Rect &rect, const CompletionCallback &callback)
DoNotBindToInstance
Definition: media_player_samsung.h:43
Definition: instance_handle.h:44
int32_t SetDisplayMode(PP_MediaPlayerDisplayMode display_mode, const CompletionCallback &callback)
int32_t Seek(PP_TimeTicks time, const CompletionCallback &callback)
int32_t SetVr360Mode(PP_MediaPlayerVr360Mode display_mode, const CompletionCallback &callback)
int32_t SetSubtitlesDelay(PP_TimeDelta delay, const CompletionCallback &callback)
int32_t GetVideoTracksList(const CompletionCallbackWithOutput< VideoTracksList > &callback)
int32_t GetAudioTracksList(const CompletionCallbackWithOutput< AudioTracksList > &callback)
Definition: media_player_samsung.h:37
int32_t SetPlaybackRate(double rate, const CompletionCallback &callback)
A reference counted module resource.
Definition: resource.h:20
int32_t GetCurrentAudioTrackInfo(const CompletionCallbackWithOutput< PP_AudioTrackInfo > &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 GetCurrentTime(const CompletionCallbackWithOutput< PP_TimeTicks > &callback)