RDK Documentation (Open Sourced RDK Components)
MockStreamAbstractionAAMP.h
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 #ifndef AAMP_MOCK_STREAM_ABSTRACTION_AAMP_H
21 #define AAMP_MOCK_STREAM_ABSTRACTION_AAMP_H
22 
23 #include <gmock/gmock.h>
24 #include "StreamAbstractionAAMP.h"
25 
27 {
28 public:
29 
31 
32  MOCK_METHOD(void, NotifyPlaybackPaused, (bool paused));
33 
34  MOCK_METHOD(void, DumpProfiles, ());
35 
36  MOCK_METHOD(AAMPStatusType, Init, (TuneType tuneType));
37 
38  MOCK_METHOD(void, Start, ());
39 
40  MOCK_METHOD(void, Stop, (bool clearChannelData));
41 
42  MOCK_METHOD(void, GetStreamFormat, (StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxAudioOutputFormat, StreamOutputFormat &subtitleOutputFormat));
43 
44  MOCK_METHOD(double, GetStreamPosition, ());
45 
46  MOCK_METHOD(double, GetFirstPTS, ());
47 
48  MOCK_METHOD(double, GetStartTimeOfFirstPTS, ());
49 
50  MOCK_METHOD(MediaTrack*, GetMediaTrack, (TrackType type));
51 
52  MOCK_METHOD(double, GetBufferedDuration, ());
53 
54  MOCK_METHOD(int, GetBWIndex, (long bandwidth));
55 
56  MOCK_METHOD(std::vector<long>, GetVideoBitrates, ());
57 
58  MOCK_METHOD(std::vector<long>, GetAudioBitrates, ());
59 
60  MOCK_METHOD(void, StartInjection, ());
61 
62  MOCK_METHOD(void, StopInjection, ());
63 
64  MOCK_METHOD(void, SeekPosUpdate, (double secondsRelativeToTuneTime));
65 
66  MOCK_METHOD(std::vector<StreamInfo*>, GetAvailableVideoTracks, ());
67 
68  MOCK_METHOD(std::vector<StreamInfo*>, GetAvailableThumbnailTracks, ());
69 
70  MOCK_METHOD(bool, SetThumbnailTrack, (int));
71 
72  MOCK_METHOD(std::vector<ThumbnailData>, GetThumbnailRangeData, (double, double, std::string*, int*, int*, int*, int*));
73 
74  MOCK_METHOD(StreamInfo* , GetStreamInfo, (int idx));
75 
76  MOCK_METHOD(bool , Is4KStream, (int &height, long &bandwidth));
77 };
78 
79 extern MockStreamAbstractionAAMP *g_mockStreamAbstractionAAMP;
80 
81 #endif /* AAMP_MOCK_STREAM_ABSTRACTION_AAMP_H */
StreamAbstractionAAMP::GetMediaTrack
virtual MediaTrack * GetMediaTrack(TrackType type)=0
Return MediaTrack of requested type.
StreamOutputFormat
StreamOutputFormat
Media output format.
Definition: main_aamp.h:106
StreamInfo
Structure holding the information of a stream.
Definition: StreamAbstractionAAMP.h:69
StreamAbstractionAAMP::Stop
virtual void Stop(bool clearChannelData)=0
Stops streaming.
TuneType
TuneType
Tune Typea.
Definition: priv_aamp.h:190
StreamAbstractionAAMP::aamp
PrivateInstanceAAMP * aamp
Definition: StreamAbstractionAAMP.h:727
StreamAbstractionAAMP.h
Base classes of HLS/MPD collectors. Implements common caching/injection logic.
StreamAbstractionAAMP::GetVideoBitrates
virtual std::vector< long > GetVideoBitrates(void)=0
Get available video bitrates.
StreamAbstractionAAMP::GetBWIndex
virtual int GetBWIndex(long bandwidth)=0
Get profile index of given bandwidth.
MockStreamAbstractionAAMP
Definition: MockStreamAbstractionAAMP.h:26
StreamAbstractionAAMP::GetFirstPTS
virtual double GetFirstPTS()=0
Get PTS of first sample.
StreamAbstractionAAMP::Start
virtual void Start()=0
Start streaming.
StreamAbstractionAAMP::GetAvailableThumbnailTracks
virtual std::vector< StreamInfo * > GetAvailableThumbnailTracks(void)=0
Get available thumbnail bitrates.
StreamAbstractionAAMP::DumpProfiles
virtual void DumpProfiles(void)=0
Dump profiles for debugging. To be implemented by sub classes.
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
StreamAbstractionAAMP::StopInjection
virtual void StopInjection(void)=0
Stop injection of fragments.
StreamAbstractionAAMP::GetStartTimeOfFirstPTS
virtual double GetStartTimeOfFirstPTS()=0
Get Start time PTS of first sample.
StreamAbstractionAAMP::StartInjection
virtual void StartInjection(void)=0
Start injection of fragments.
MediaTrack
Base Class for Media Track.
Definition: StreamAbstractionAAMP.h:159
StreamAbstractionAAMP
StreamAbstraction class of AAMP.
Definition: StreamAbstractionAAMP.h:577
StreamAbstractionAAMP::StreamAbstractionAAMP
StreamAbstractionAAMP(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
StreamAbstractionAAMP constructor.
Definition: streamabstraction.cpp:1606
StreamAbstractionAAMP::GetStreamFormat
virtual void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxAudioOutputFormat, StreamOutputFormat &subtitleOutputFormat)=0
Get output format of stream.
TrackType
TrackType
Media Track Types.
Definition: StreamAbstractionAAMP.h:48
StreamAbstractionAAMP::SetThumbnailTrack
virtual bool SetThumbnailTrack(int)=0
Set thumbnail bitrate.
StreamAbstractionAAMP::GetBufferedDuration
virtual double GetBufferedDuration(void)=0
Function to get the buffer duration of stream.
StreamAbstractionAAMP::Is4KStream
virtual bool Is4KStream(int &height, long &bandwidth)=0
check if current stream have 4K content
StreamAbstractionAAMP::Init
virtual AAMPStatusType Init(TuneType tuneType)=0
Initialize a newly created object. To be implemented by sub classes.
StreamAbstractionAAMP::GetStreamInfo
virtual StreamInfo * GetStreamInfo(int idx)=0
Get stream information of a profile from subclass.
StreamAbstractionAAMP::NotifyPlaybackPaused
virtual void NotifyPlaybackPaused(bool paused)
Function called when playback is paused to update related flags.
Definition: streamabstraction.cpp:2245
StreamAbstractionAAMP::GetStreamPosition
virtual double GetStreamPosition()=0
Get current stream position.
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::SeekPosUpdate
virtual void SeekPosUpdate(double secondsRelativeToTuneTime)=0
Update seek position when player is initialized.
StreamAbstractionAAMP::GetAudioBitrates
virtual std::vector< long > GetAudioBitrates(void)=0
Get available audio bitrates.
StreamAbstractionAAMP::GetThumbnailRangeData
virtual std::vector< ThumbnailData > GetThumbnailRangeData(double, double, std::string *, int *, int *, int *, int *)=0
Get thumbnail data for duration value.