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 2024 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 : #include "tasks/generic/SetTextTrackIdentifier.h"
21 : #include "RialtoServerLogging.h"
22 : #include <gst/gst.h>
23 :
24 : namespace firebolt::rialto::server::tasks::generic
25 : {
26 3 : SetTextTrackIdentifier::SetTextTrackIdentifier(GenericPlayerContext &context,
27 : std::shared_ptr<firebolt::rialto::wrappers::IGlibWrapper> glibWrapper,
28 3 : const std::string &textTrackIdentifier)
29 3 : : m_context{context}, m_glibWrapper{glibWrapper}, m_textTrackIdentifier{textTrackIdentifier}
30 : {
31 3 : RIALTO_SERVER_LOG_DEBUG("Constructing SetTextTrackIdentifier");
32 : }
33 :
34 7 : SetTextTrackIdentifier::~SetTextTrackIdentifier()
35 : {
36 3 : RIALTO_SERVER_LOG_DEBUG("SetTextTrackIdentifier finished");
37 4 : }
38 :
39 2 : void SetTextTrackIdentifier::execute() const
40 : {
41 2 : RIALTO_SERVER_LOG_DEBUG("Executing SetTextTrackIdentifier");
42 :
43 2 : if (!m_context.subtitleSink)
44 : {
45 1 : RIALTO_SERVER_LOG_ERROR("There is no subtitle sink");
46 1 : return;
47 : }
48 :
49 1 : m_glibWrapper->gObjectSet(m_context.subtitleSink, "text-track-identifier", m_textTrackIdentifier.c_str(), nullptr);
50 : }
51 : } // namespace firebolt::rialto::server::tasks::generic
|