RDK Documentation (Open Sourced RDK Components)
compositein_shim.cpp
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 2021 RDK Management
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 /**
21  * @file compositein_shim.cpp
22  * @brief shim for dispatching UVE Composite input playback
23  */
24 #include "compositein_shim.h"
25 #include <stdlib.h>
26 #include <string.h>
27 #include <pthread.h>
28 #include <signal.h>
29 #include <assert.h>
30 
31 
32 #define COMPOSITEINPUT_CALLSIGN "org.rdk.CompositeInput.1"
33 
34 /**
35  * @brief StreamAbstractionAAMP_COMPOSITEIN Constructor
36  */
38  : StreamAbstractionAAMP_VIDEOIN("COMPOSITEIN", COMPOSITEINPUT_CALLSIGN, logObj, aamp,seek_pos,rate)
39 {
40  aamp->SetContentType("COMPOSITE_IN");
41 }
42 
43 /**
44  * @brief StreamAbstractionAAMP_COMPOSITEIN Destructor
45  */
47 {
48  AAMPLOG_WARN("destructor ");
49 }
50 
51 /**
52  * @brief Initialize a newly created object.
53  */
55 {
57  retval = InitHelper(tuneType);
58  return retval;
59 }
60 
61 /**
62  * @brief Starts streaming.
63  */
65 {
66  const char *url = aamp->GetManifestUrl().c_str();
67  int compositeInputPort = -1;
68  if( sscanf(url, "cvbsin://localhost/deviceid/%d", &compositeInputPort ) == 1 )
69  {
70  StartHelper(compositeInputPort,"startCompositeInput");
71  }
72 }
73 
74 /**
75  * @brief Stops streaming.
76  */
77 void StreamAbstractionAAMP_COMPOSITEIN::Stop(bool clearChannelData)
78 {
79  StopHelper("stopCompositeInput");
80 }
81 
82 /**
83  * @brief To get the available video tracks.
84  * @return available video tracks.
85  */
87 { // STUB
88  AAMPLOG_WARN("StreamAbstractionAAMP_COMPOSITEIN");
89  return std::vector<StreamInfo*>();
90 }
91 
92 /**
93  * @brief To get the available thumbnail tracks.
94  * @return available thunbnail tracks.
95  */
97 { // STUB
98  AAMPLOG_WARN("StreamAbstractionAAMP_COMPOSITEIN");
99  return std::vector<StreamInfo*>();
100 }
101 
102 /**
103  * @brief To set the available thumbnail tracks.
104  */
106 {
107  (void)thumbnailIndex; /* unused */
108  return false;
109 }
110 
111 /**
112  * @brief Function to fetch the thumbnail data.
113  *
114  * @return Updated vector of available thumbnail data.
115  */
116 std::vector<ThumbnailData> StreamAbstractionAAMP_COMPOSITEIN::GetThumbnailRangeData(double start, double end, std::string *baseurl, int *raw_w, int *raw_h, int *width, int *height)
117 {
118  return std::vector<ThumbnailData>();
119 }
120 
StreamAbstractionAAMP_COMPOSITEIN::GetAvailableVideoTracks
std::vector< StreamInfo * > GetAvailableVideoTracks(void) override
To get the available video tracks.
Definition: compositein_shim.cpp:86
compositein_shim.h
shim for dispatching UVE Composite input playback
StreamAbstractionAAMP_COMPOSITEIN::GetAvailableThumbnailTracks
std::vector< StreamInfo * > GetAvailableThumbnailTracks(void) override
To get the available thumbnail tracks.
Definition: compositein_shim.cpp:96
PrivateInstanceAAMP::SetContentType
void SetContentType(const char *contentType)
Set Content Type.
Definition: priv_aamp.cpp:6121
TuneType
TuneType
Tune Typea.
Definition: priv_aamp.h:190
StreamAbstractionAAMP::aamp
PrivateInstanceAAMP * aamp
Definition: StreamAbstractionAAMP.h:727
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
PrivateInstanceAAMP::GetManifestUrl
std::string & GetManifestUrl(void)
Get manifest URL.
Definition: priv_aamp.h:1890
StreamAbstractionAAMP_COMPOSITEIN::GetThumbnailRangeData
std::vector< ThumbnailData > GetThumbnailRangeData(double tStart, double tEnd, std::string *baseurl, int *raw_w, int *raw_h, int *width, int *height) override
Function to fetch the thumbnail data.
Definition: compositein_shim.cpp:116
StreamAbstractionAAMP_VIDEOIN::StartHelper
void StartHelper(int port, const std::string &methodName)
calls start on video in specified by port and method name
Definition: videoin_shim.cpp:113
eAAMPSTATUS_OK
@ eAAMPSTATUS_OK
Definition: priv_aamp.h:207
StreamAbstractionAAMP_COMPOSITEIN::StreamAbstractionAAMP_COMPOSITEIN
StreamAbstractionAAMP_COMPOSITEIN(AampLogManager *logObj, class PrivateInstanceAAMP *aamp, double seekpos, float rate)
StreamAbstractionAAMP_COMPOSITEIN Constructor.
Definition: compositein_shim.cpp:37
StreamAbstractionAAMP_COMPOSITEIN::Stop
void Stop(bool clearChannelData) override
Stops streaming.
Definition: compositein_shim.cpp:77
StreamAbstractionAAMP_VIDEOIN::StopHelper
void StopHelper(const std::string &methodName)
Stops streaming.
Definition: videoin_shim.cpp:129
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
AAMPStatusType
AAMPStatusType
AAMP Function return values.
Definition: priv_aamp.h:205
StreamAbstractionAAMP_COMPOSITEIN::SetThumbnailTrack
bool SetThumbnailTrack(int) override
To set the available thumbnail tracks.
Definition: compositein_shim.cpp:105
StreamAbstractionAAMP_COMPOSITEIN::~StreamAbstractionAAMP_COMPOSITEIN
~StreamAbstractionAAMP_COMPOSITEIN()
StreamAbstractionAAMP_COMPOSITEIN Destructor.
Definition: compositein_shim.cpp:46
StreamAbstractionAAMP_COMPOSITEIN::Start
void Start() override
Starts streaming.
Definition: compositein_shim.cpp:64
StreamAbstractionAAMP_VIDEOIN
Fragment collector for MPEG DASH.
Definition: videoin_shim.h:42
StreamAbstractionAAMP_COMPOSITEIN::Init
AAMPStatusType Init(TuneType tuneType) override
Initialize a newly created object.
Definition: compositein_shim.cpp:54