TizenRT Public API  v2.0 M2
MediaPlayerObserverInterface.h
Go to the documentation of this file.
1 /* ****************************************************************
2  *
3  * Copyright 2018 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ******************************************************************/
18 
29 #ifndef __MEDIA_MEDIAPLAYEROBSERVERINTERFACE_H
30 #define __MEDIA_MEDIAPLAYEROBSERVERINTERFACE_H
31 
32 namespace media {
33 class MediaPlayer;
34 enum player_error_e : int;
35 typedef enum player_error_e player_error_t;
36 enum buffer_state_e : int;
37 typedef enum buffer_state_e buffer_state_t;
38 
48 {
49 public:
55  virtual void onPlaybackStarted(MediaPlayer &mediaPlayer) = 0;
61  virtual void onPlaybackFinished(MediaPlayer &mediaPlayer) = 0;
67  virtual void onPlaybackError(MediaPlayer &mediaPlayer, player_error_t error) = 0;
73  virtual void onStartError(MediaPlayer &mediaPlayer, player_error_t error) = 0;
79  virtual void onStopError(MediaPlayer &mediaPlayer, player_error_t error) = 0;
85  virtual void onPauseError(MediaPlayer &mediaPlayer, player_error_t error) = 0;
91  virtual void onPlaybackPaused(MediaPlayer &mediaPlayer) = 0;
100  virtual void onPlaybackBufferDataReached(MediaPlayer& mediaPlayer, unsigned char *data, size_t size) {}
106  virtual void onPlaybackBufferOverrun(MediaPlayer &mediaPlayer) {}
112  virtual void onPlaybackBufferUnderrun(MediaPlayer &mediaPlayer) {}
118  virtual void onPlaybackBufferUpdated(MediaPlayer &mediaPlayer, size_t bytes) {}
124  virtual void onPlaybackBufferStateChanged(MediaPlayer &mediaPlayer, buffer_state_t state) {}
125 };
126 } // namespace media
127 
128 #endif
129  // end of MEDIA group
virtual void onPlaybackStarted(MediaPlayer &mediaPlayer)=0
informs the user of the playback has begun.
virtual void onStopError(MediaPlayer &mediaPlayer, player_error_t error)=0
informs the user of the error state of player operation
virtual void onStartError(MediaPlayer &mediaPlayer, player_error_t error)=0
informs the user of the error state of player operation
virtual void onPauseError(MediaPlayer &mediaPlayer, player_error_t error)=0
informs the user of the error state of player operation
virtual void onPlaybackBufferStateChanged(MediaPlayer &mediaPlayer, buffer_state_t state)
informs the user the playback buffer state changed
virtual void onPlaybackBufferDataReached(MediaPlayer &mediaPlayer, unsigned char *data, size_t size)
informs the user that data in the input-buffer reach the threshold, and it's possible to fetch data n...
virtual void onPlaybackBufferOverrun(MediaPlayer &mediaPlayer)
informs the user the playback buffer state: overrun.
virtual void onPlaybackBufferUpdated(MediaPlayer &mediaPlayer, size_t bytes)
informs the user the playback buffer updated.
virtual void onPlaybackFinished(MediaPlayer &mediaPlayer)=0
informs the user of the playback has finished.
virtual void onPlaybackBufferUnderrun(MediaPlayer &mediaPlayer)
informs the user the playback buffer state: underrun.
virtual void onPlaybackPaused(MediaPlayer &mediaPlayer)=0
informs the user of the playback has paused.
player_error_e
result of call the apis
Definition: MediaPlayer.h:43
virtual void onPlaybackError(MediaPlayer &mediaPlayer, player_error_t error)=0
informs the user of the error state of player operation