Line data Source code
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_CLIENT_I_MEDIA_PIPELINE_IPC_CLIENT_H_
21 : #define FIREBOLT_RIALTO_CLIENT_I_MEDIA_PIPELINE_IPC_CLIENT_H_
22 :
23 : #include <MediaCommon.h>
24 : #include <memory>
25 : #include <stdint.h>
26 : #include <string>
27 :
28 : /**
29 : * @file IMediaPipelineIpcClient.h
30 : *
31 : * The definition of the IMediaPipelineIpcClient interface.
32 : */
33 :
34 : namespace firebolt::rialto::client
35 : {
36 : /**
37 : * @brief The Rialto media player client ipc interface.
38 : */
39 : class IMediaPipelineIpcClient
40 : {
41 : public:
42 288 : IMediaPipelineIpcClient() = default;
43 288 : virtual ~IMediaPipelineIpcClient() = default;
44 :
45 : IMediaPipelineIpcClient(const IMediaPipelineIpcClient &) = delete;
46 : IMediaPipelineIpcClient &operator=(const IMediaPipelineIpcClient &) = delete;
47 : IMediaPipelineIpcClient(IMediaPipelineIpcClient &&) = delete;
48 : IMediaPipelineIpcClient &operator=(IMediaPipelineIpcClient &&) = delete;
49 :
50 : /**
51 : * @brief Notifies the rialto client of the playback state.
52 : *
53 : * @param[in] state : The new playback state.
54 : */
55 : virtual void notifyPlaybackState(PlaybackState state) = 0;
56 :
57 : /**
58 : * @brief Handler for a playback position update from the server.
59 : *
60 : * @param[in] event : The playback position changed event structure.
61 : */
62 : virtual void notifyPosition(int64_t position) = 0;
63 :
64 : /**
65 : * @brief Notifies the rialto client of the network state.
66 : *
67 : * @param[in] state : The new network state.
68 : */
69 : virtual void notifyNetworkState(NetworkState state) = 0;
70 :
71 : /**
72 : * @brief Notifies the rialto client of a need data request.
73 : *
74 : * @param[in] sourceId : The source to read data from.
75 : * @param[in] frameCount : The number of frames to read.
76 : * @param[in] requestId : Need data request id.
77 : * @param[in] shmInfo : Information for populating the shared memory (null if not applicable to the client).
78 : */
79 : virtual void notifyNeedMediaData(int32_t sourceId, size_t frameCount, uint32_t requestId,
80 : const std::shared_ptr<MediaPlayerShmInfo> &shmInfo) = 0;
81 :
82 : /**
83 : * @brief Notifies the rialto client of a Quality Of Service update.
84 : *
85 : * @param[in] sourceId : The id of the source that produced the Qos.
86 : * @param[in] qosInfo : The information provided in the update.
87 : */
88 : virtual void notifyQos(int32_t sourceId, const QosInfo &qosInfo) = 0;
89 :
90 : /**
91 : * @brief Notifies the client that buffer underflow occurred.
92 : *
93 : * Notification shall be sent whenever a video/audio buffer underflow occurs
94 : *
95 : * @param[in] sourceId : The id of the source that produced the buffer underflow
96 : */
97 : virtual void notifyBufferUnderflow(int32_t sourceId) = 0;
98 :
99 : /**
100 : * @brief Notifies the client that a non-fatal error has occurred in the player.
101 : *
102 : * PlaybackState remains unchanged when an error occurs.
103 : *
104 : * @param[in] sourceId : The id of the source that produced the error.
105 : * @param[in] error : The type of error that occurred.
106 : */
107 : virtual void notifyPlaybackError(int32_t sourceId, PlaybackError error) = 0;
108 :
109 : /**
110 : * @brief Notifies the client that the source has been flushed.
111 : *
112 : * Notification shall be sent whenever a flush procedure is finished.
113 : *
114 : * @param[in] sourceId : The id of the source that has been flushed.
115 : */
116 : virtual void notifySourceFlushed(int32_t sourceId) = 0;
117 : };
118 :
119 : }; // namespace firebolt::rialto::client
120 :
121 : #endif // FIREBOLT_RIALTO_CLIENT_I_MEDIA_PIPELINE_IPC_CLIENT_H_
|