Rialto  0.1
Rialto media pipeline API
IMediaPipelineClient.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's LICENSE file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 Sky UK
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef FIREBOLT_RIALTO_I_MEDIA_PIPELINE_CLIENT_H_
21 #define FIREBOLT_RIALTO_I_MEDIA_PIPELINE_CLIENT_H_
22 
23 #include <MediaCommon.h>
24 #include <memory>
25 #include <stdint.h>
26 #include <string>
27 
38 namespace firebolt::rialto
39 {
40 /* Values representing custom duration values, used by IMediaPipelineClient::notifyDuration() method*/
45 constexpr int64_t kDurationUnknown{-1};
49 constexpr int64_t kDurationUnending{-2};
50 
59 {
60 public:
64  virtual ~IMediaPipelineClient() {}
65 
76  virtual void notifyDuration(int64_t duration) = 0;
77 
90  virtual void notifyPosition(int64_t position) = 0;
91 
104  virtual void notifyNativeSize(uint32_t width, uint32_t height, double aspect = 1.0) = 0;
105 
119  virtual void notifyNetworkState(NetworkState state) = 0;
120 
132  virtual void notifyPlaybackState(PlaybackState state) = 0;
133 
139  virtual void notifyVideoData(bool hasData) = 0;
140 
146  virtual void notifyAudioData(bool hasData) = 0;
147 
167  virtual void notifyNeedMediaData(int32_t sourceId, size_t frameCount, uint32_t needDataRequestId,
168  const std::shared_ptr<MediaPlayerShmInfo> &shmInfo) = 0;
169 
179  virtual void notifyCancelNeedMediaData(int32_t sourceId) = 0;
180 
189  virtual void notifyQos(int32_t sourceId, const QosInfo &qosInfo) = 0;
190 
198  virtual void notifyBufferUnderflow(int32_t sourceId) = 0;
199 
208  virtual void notifyPlaybackError(int32_t sourceId, PlaybackError error) = 0;
209 
217  virtual void notifySourceFlushed(int32_t sourceId) = 0;
218 };
219 
220 }; // namespace firebolt::rialto
221 
222 #endif // FIREBOLT_RIALTO_I_MEDIA_PIPELINE_CLIENT_H_
firebolt::rialto::IMediaPipelineClient::notifyDuration
virtual void notifyDuration(int64_t duration)=0
Notifies the client of the total duration of the media.
firebolt::rialto::PlaybackError
PlaybackError
None fatal asynchronous errors reported by the player.
Definition: MediaCommon.h:447
firebolt::rialto::QosInfo
The information provided in a QOS update.
Definition: MediaCommon.h:275
firebolt::rialto::IMediaPipelineClient
The Rialto media player client interface.
Definition: IMediaPipelineClient.h:58
firebolt::rialto::IMediaPipelineClient::notifyPosition
virtual void notifyPosition(int64_t position)=0
Notifies the client of the current playback position.
firebolt::rialto::IMediaPipelineClient::notifyNativeSize
virtual void notifyNativeSize(uint32_t width, uint32_t height, double aspect=1.0)=0
Notifies the client of the native size of the video and the pixel aspect ratio.
firebolt::rialto::IMediaPipelineClient::notifyPlaybackError
virtual void notifyPlaybackError(int32_t sourceId, PlaybackError error)=0
Notifies the client that a non-fatal error has occurred in the player.
firebolt::rialto::IMediaPipelineClient::notifyNeedMediaData
virtual void notifyNeedMediaData(int32_t sourceId, size_t frameCount, uint32_t needDataRequestId, const std::shared_ptr< MediaPlayerShmInfo > &shmInfo)=0
Notifies the client that we need media data.
firebolt::rialto::PlaybackState
PlaybackState
The Playback State.
Definition: MediaCommon.h:158
firebolt::rialto::kDurationUnending
constexpr int64_t kDurationUnending
Stream duration is unending or live.
Definition: IMediaPipelineClient.h:49
firebolt::rialto::IMediaPipelineClient::notifyAudioData
virtual void notifyAudioData(bool hasData)=0
Notifies the client that audio data is available.
firebolt::rialto::IMediaPipelineClient::notifyCancelNeedMediaData
virtual void notifyCancelNeedMediaData(int32_t sourceId)=0
Notifies the client to cancel any outstand need request.
firebolt::rialto::IMediaPipelineClient::~IMediaPipelineClient
virtual ~IMediaPipelineClient()
Virtual destructor.
Definition: IMediaPipelineClient.h:64
firebolt::rialto::IMediaPipelineClient::notifyPlaybackState
virtual void notifyPlaybackState(PlaybackState state)=0
Notifies the client of the playback state.
firebolt::rialto::IMediaPipelineClient::notifyVideoData
virtual void notifyVideoData(bool hasData)=0
Notifies the client that video data is available.
firebolt::rialto::NetworkState
NetworkState
The Network State.
Definition: MediaCommon.h:136
firebolt::rialto::IMediaPipelineClient::notifyBufferUnderflow
virtual void notifyBufferUnderflow(int32_t sourceId)=0
Notifies the client that buffer underflow occurred.
firebolt::rialto::IMediaPipelineClient::notifyQos
virtual void notifyQos(int32_t sourceId, const QosInfo &qosInfo)=0
Notifies the client of a Quality Of Service update from the Player.
firebolt::rialto::IMediaPipelineClient::notifyNetworkState
virtual void notifyNetworkState(NetworkState state)=0
Notifies the client of the network state.
MediaCommon.h
firebolt::rialto::kDurationUnknown
constexpr int64_t kDurationUnknown
Stream duration is unknown or undefined.
Definition: IMediaPipelineClient.h:45
firebolt::rialto::IMediaPipelineClient::notifySourceFlushed
virtual void notifySourceFlushed(int32_t sourceId)=0
Notifies the client that the source has been flushed.