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_I_GST_CAPABILITIES_H_
21 : #define FIREBOLT_RIALTO_SERVER_I_GST_CAPABILITIES_H_
22 :
23 : #include <MediaCommon.h>
24 : #include <memory>
25 : #include <string>
26 : #include <vector>
27 :
28 : namespace firebolt::rialto::server
29 : {
30 : class IGstCapabilities;
31 :
32 : /**
33 : * @brief IGstCapabilities factory class, returns a concrete implementation of IGstCapabilities
34 : */
35 : class IGstCapabilitiesFactory
36 : {
37 : public:
38 7 : IGstCapabilitiesFactory() = default;
39 7 : virtual ~IGstCapabilitiesFactory() = default;
40 :
41 : /**
42 : * @brief Gets the IGstCapabilitiesFactory instance.
43 : *
44 : * @retval the factory instance or null on error.
45 : */
46 : static std::shared_ptr<IGstCapabilitiesFactory> getFactory();
47 :
48 : /**
49 : * @brief Creates a IGstCapabilities object.
50 : *
51 : *
52 : * @retval the new gstreamer capabilities instance or null on error.
53 : */
54 : virtual std::unique_ptr<IGstCapabilities> createGstCapabilities() = 0;
55 : };
56 :
57 : class IGstCapabilities
58 : {
59 : public:
60 24 : IGstCapabilities() = default;
61 24 : virtual ~IGstCapabilities() = default;
62 :
63 : IGstCapabilities(const IGstCapabilities &) = delete;
64 : IGstCapabilities &operator=(const IGstCapabilities &) = delete;
65 : IGstCapabilities(IGstCapabilities &&) = delete;
66 : IGstCapabilities &operator=(IGstCapabilities &&) = delete;
67 :
68 : /**
69 : * @brief Gets vector of mime types supported by gstreamer
70 : *
71 : * @retval vector of mime types supported by gstreamer
72 : */
73 : virtual std::vector<std::string> getSupportedMimeTypes(MediaSourceType sourceType) = 0;
74 :
75 : /**
76 : * @brief Checks is \a mimeType is supported by gstreamer
77 : *
78 : * @retval True if mime type is supported by gstreamer
79 : */
80 : virtual bool isMimeTypeSupported(const std::string &mimeType) = 0;
81 :
82 : /**
83 : * @brief Check sinks and decoders for supported properties
84 : *
85 : * @param[in] mediaType : The media type to search. If set to UNKNOWN then both AUDIO and VIDEO are searched
86 : * @param[in] propertyNames : A vector of property names to look for
87 : *
88 : * @retval Returns the subset of propertyNames that are supported by the mediaType
89 : */
90 : virtual std::vector<std::string> getSupportedProperties(MediaSourceType mediaType,
91 : const std::vector<std::string> &propertyNames) = 0;
92 : };
93 :
94 : }; // namespace firebolt::rialto::server
95 :
96 : #endif // FIREBOLT_RIALTO_SERVER_I_GST_CAPABILITIES_H_
|