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_SERVER_SERVICE_I_PLAYBACK_SERVICE_H_
21 : #define FIREBOLT_RIALTO_SERVER_SERVICE_I_PLAYBACK_SERVICE_H_
22 :
23 : #include "IMediaPipelineService.h"
24 : #include "IPrivateMetricsService.h"
25 : #include "ISharedMemoryBuffer.h"
26 : #include "IWebAudioPlayerService.h"
27 : #include "MediaCommon.h"
28 : #include <cstdint>
29 : #include <memory>
30 : #include <string>
31 : #include <vector>
32 :
33 : namespace firebolt::rialto::server::service
34 : {
35 : class IPlaybackService
36 : {
37 : public:
38 226 : IPlaybackService() = default;
39 226 : virtual ~IPlaybackService() = default;
40 :
41 : IPlaybackService(const IPlaybackService &) = delete;
42 : IPlaybackService(IPlaybackService &&) = delete;
43 : IPlaybackService &operator=(const IPlaybackService &) = delete;
44 : IPlaybackService &operator=(IPlaybackService &&) = delete;
45 :
46 : virtual bool switchToActive() = 0;
47 : virtual void switchToInactive() = 0;
48 : virtual void setMaxPlaybacks(int maxPlaybacks) = 0;
49 : virtual void setMaxWebAudioPlayers(int maxWebAudio) = 0;
50 : virtual void setClientDisplayName(const std::string &clientDisplayName) const = 0;
51 : virtual void setResourceManagerAppName(const std::string &appName) const = 0;
52 :
53 : virtual bool isActive() const = 0;
54 : virtual bool getSharedMemory(int32_t &fd, uint32_t &size) const = 0;
55 : virtual int getMaxPlaybacks() const = 0;
56 : virtual int getMaxWebAudioPlayers() const = 0;
57 : virtual std::shared_ptr<ISharedMemoryBuffer> getShmBuffer() const = 0;
58 : virtual IMediaPipelineService &getMediaPipelineService() const = 0;
59 : virtual IWebAudioPlayerService &getWebAudioPlayerService() const = 0;
60 : virtual IPrivateMetricsService &getPrivateMetricsService() const = 0;
61 : virtual void ping(const std::shared_ptr<IHeartbeatProcedure> &heartbeatProcedure) const = 0;
62 : };
63 : } // namespace firebolt::rialto::server::service
64 :
65 : #endif // FIREBOLT_RIALTO_SERVER_SERVICE_I_PLAYBACK_SERVICE_H_
|