RDK Documentation (Open Sourced RDK Components)
FakeAampGstPlayer.cpp
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 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 #include "aampgstplayer.h"
21 #include "MockAampGstPlayer.h"
22 #include "priv_aamp.h"
23 #include "AampLogManager.h"
24 
25 MockAAMPGstPlayer *g_mockAampGstPlayer = nullptr;
26 
28 {
29 }
30 
32 {
33 }
34 
35 void AAMPGstPlayer::Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation)
36 {
37 }
38 
39 bool AAMPGstPlayer::SendCopy( MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double duration)
40 {
41  return true;
42 }
43 
44 bool AAMPGstPlayer::SendTransfer(MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment, bool discontinuity)
45 {
46  return true;
47 }
48 
50 {
51 }
52 
53 void AAMPGstPlayer::Stream(void)
54 {
55 }
56 
57 void AAMPGstPlayer::Stop(bool keepLastFrame)
58 {
59 }
60 
62 {
63 }
64 
65 void AAMPGstPlayer::Flush(double position, int rate, bool shouldTearDown)
66 {
67 }
68 
69 bool AAMPGstPlayer::SetPlayBackRate ( double rate )
70 {
71  return true;
72 }
73 
74 bool AAMPGstPlayer::Pause(bool pause, bool forceStopGstreamerPreBuffering)
75 {
76  return true;
77 }
78 
80 {
81  return 0;
82 }
83 
85 {
86  return 0;
87 }
88 
89 long long AAMPGstPlayer::GetVideoPTS(void)
90 {
91  return 0;
92 }
93 
94 unsigned long AAMPGstPlayer::getCCDecoderHandle(void)
95 {
96  return 0;
97 }
98 
99 void AAMPGstPlayer::SetVideoRectangle(int x, int y, int w, int h)
100 {
101 }
102 
104 {
105 }
106 
107 void AAMPGstPlayer::SetVideoMute(bool muted)
108 {
109 }
110 
111 void AAMPGstPlayer::SetSubtitleMute(bool muted)
112 {
113 }
114 
115 void AAMPGstPlayer::SetSubtitlePtsOffset(std::uint64_t pts_offset)
116 {
117 }
118 
119 void AAMPGstPlayer::SetAudioVolume(int volume)
120 {
121 }
122 
123 bool AAMPGstPlayer::Discontinuity( MediaType mediaType)
124 {
125  return true;
126 }
127 
129 {
130  return true;
131 }
132 
134 {
135  return true;
136 }
137 
139 {
140 }
141 
143 {
144 }
145 
147 {
148 }
149 
150 void AAMPGstPlayer::GetVideoSize(int &w, int &h)
151 {
152 }
153 
154 void AAMPGstPlayer::QueueProtectionEvent(const char *protSystemId, const void *ptr, size_t len, MediaType type)
155 {
156 }
157 
159 {
160 }
161 
163 {
164 }
165 
166 void AAMPGstPlayer::SeekStreamSink(double position, double rate)
167 {
168 }
169 
171 {
172  return std::string();
173 }
174 
175 void AAMPGstPlayer::StopBuffering(bool forceStop)
176 {
177 }
178 
180 {
181 }
182 
AAMPGstPlayer::NotifyFragmentCachingOngoing
void NotifyFragmentCachingOngoing()
Set pipeline to PAUSED state to wait on NotifyFragmentCachingComplete()
Definition: aampgstplayer.cpp:4336
AAMPGstPlayer::EndOfStreamReached
void EndOfStreamReached(MediaType type)
Starts processing EOS for a particular stream type.
Definition: aampgstplayer.cpp:3027
AampLogManager.h
Log managed for Aamp.
AAMPGstPlayer::~AAMPGstPlayer
~AAMPGstPlayer()
AAMPGstPlayer Destructor.
Definition: aampgstplayer.cpp:362
StreamOutputFormat
StreamOutputFormat
Media output format.
Definition: main_aamp.h:106
AAMPGstPlayer::QueueProtectionEvent
void QueueProtectionEvent(const char *protSystemId, const void *ptr, size_t len, MediaType type)
Generate a protection event.
Definition: aampgstplayer.cpp:1955
AAMPGstPlayer::Stream
void Stream(void)
To start playback.
Definition: aampgstplayer.cpp:2824
AAMPGstPlayer::Configure
void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
Configure pipeline based on A/V formats.
Definition: aampgstplayer.cpp:2833
AAMPGstPlayer::SendTransfer
bool SendTransfer(MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment)
inject mp4 segment to gstreamer pipeline
Definition: aampgstplayer.cpp:2814
AAMPGstPlayer::DumpStatus
void DumpStatus(void)
Log the various info related to playback.
Definition: aampgstplayer.cpp:3326
AAMPGstPlayer::SetVideoMute
void SetVideoMute(bool muted)
Set video mute.
Definition: aampgstplayer.cpp:3863
AAMPGstPlayer::GetPositionMilliseconds
long GetPositionMilliseconds(void)
Get playback position in MS.
Definition: aampgstplayer.cpp:3590
AAMPGstPlayer::getCCDecoderHandle
unsigned long getCCDecoderHandle(void)
Retrieve the video decoder handle from pipeline.
Definition: aampgstplayer.cpp:1926
AAMPGstPlayer::GetDurationMilliseconds
long GetDurationMilliseconds(void)
Get playback duration in MS.
Definition: aampgstplayer.cpp:3545
AAMPGstPlayer::Pause
bool Pause(bool pause, bool forceStopGstreamerPreBuffering)
To pause/play pipeline.
Definition: aampgstplayer.cpp:3669
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AAMPGstPlayer::SignalTrickModeDiscontinuity
void SignalTrickModeDiscontinuity()
Signal trick mode discontinuity to gstreamer pipeline.
Definition: aampgstplayer.cpp:4551
VideoZoomMode
VideoZoomMode
Video zoom mode.
Definition: main_aamp.h:129
AAMPGstPlayer::Discontinuity
bool Discontinuity(MediaType mediaType)
Process discontinuity for a stream type.
Definition: aampgstplayer.cpp:4159
AAMPGstPlayer::SetSubtitlePtsOffset
void SetSubtitlePtsOffset(std::uint64_t pts_offset)
Definition: aampgstplayer.cpp:3830
MediaType
MediaType
Media types.
Definition: AampMediaType.h:37
AAMPGstPlayer::SetAudioVolume
void SetAudioVolume(int volume)
Set audio volume.
Definition: aampgstplayer.cpp:3890
AAMPGstPlayer::SetVideoRectangle
void SetVideoRectangle(int x, int y, int w, int h)
Set video display rectangle co-ordinates.
Definition: aampgstplayer.cpp:3738
AAMPGstPlayer::SetPlayBackRate
bool SetPlayBackRate(double rate)
Set playback rate to audio/video sinks.
Definition: aampgstplayer.cpp:4761
aampgstplayer.h
Gstreamer based player for AAMP.
AAMPGstPlayer::ClearProtectionEvent
void ClearProtectionEvent()
Cleanup generated protection event.
Definition: aampgstplayer.cpp:1998
AAMPGstPlayer::GetVideoPTS
virtual long long GetVideoPTS(void)
Gets Video PTS.
Definition: aampgstplayer.cpp:4230
AAMPGstPlayer::SetVideoZoom
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
Definition: aampgstplayer.cpp:3800
priv_aamp.h
Private functions and types used internally by AAMP.
AAMPGstPlayer::AAMPGstPlayer
AAMPGstPlayer(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
AAMPGstPlayer Constructor.
Definition: aampgstplayer.cpp:328
AAMPGstPlayer::GetVideoRectangle
std::string GetVideoRectangle()
Get the video rectangle co-ordinates.
Definition: aampgstplayer.cpp:4589
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
AAMPGstPlayer::SendCopy
bool SendCopy(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double fDuration)
inject HLS/ts elementary stream buffer to gstreamer pipeline
Definition: aampgstplayer.cpp:2805
AAMPGstPlayer::InitializeAAMPGstreamerPlugins
static void InitializeAAMPGstreamerPlugins(AampLogManager *logObj=NULL)
Increase the rank of AAMP decryptor plugins.
Definition: aampgstplayer.cpp:4391
AAMPGstPlayer::Stop
void Stop(bool keepLastFrame)
Stop playback and any idle handlers active at the time.
Definition: aampgstplayer.cpp:3072
AAMPGstPlayer::ResetEOSSignalledFlag
void ResetEOSSignalledFlag()
Reset EOS SignalledFlag.
Definition: aampgstplayer.cpp:4259
AAMPGstPlayer::Flush
void Flush(void)
Flush the buffers in pipeline.
Definition: aampgstplayer.cpp:3476
AAMPGstPlayer::CheckForPTSChangeWithTimeout
bool CheckForPTSChangeWithTimeout(long timeout)
Check if PTS is changing.
Definition: aampgstplayer.cpp:4193
AAMPGstPlayer::SeekStreamSink
void SeekStreamSink(double position, double rate)
Flush the data in case of a new tune pipeline.
Definition: aampgstplayer.cpp:4576
AAMPGstPlayer::IsCacheEmpty
bool IsCacheEmpty(MediaType mediaType)
Check if cache empty for a media type.
Definition: aampgstplayer.cpp:4267
AAMPGstPlayer::GetVideoSize
void GetVideoSize(int &w, int &h)
Get video display's width and height.
Definition: aampgstplayer.cpp:4349
AAMPGstPlayer::SetSubtitleMute
void SetSubtitleMute(bool mute)
Definition: aampgstplayer.cpp:3844
AAMPGstPlayer::NotifyFragmentCachingComplete
void NotifyFragmentCachingComplete()
Set pipeline to PLAYING state once fragment caching is complete.
Definition: aampgstplayer.cpp:4315
MockAAMPGstPlayer
Definition: MockAampGstPlayer.h:26
AAMPGstPlayer::StopBuffering
void StopBuffering(bool forceStop)
Un-pause pipeline and notify buffer end event to player.
Definition: aampgstplayer.cpp:4598