RDK Documentation (Open Sourced RDK Components)
StreamAbstractionAAMP_OTA Class Reference

Fragment collector for OTA. More...

#include <ota_shim.h>

Inheritance diagram for StreamAbstractionAAMP_OTA:
Inheritance graph
Collaboration diagram for StreamAbstractionAAMP_OTA:
Collaboration graph

Public Member Functions

 StreamAbstractionAAMP_OTA (AampLogManager *logObj, class PrivateInstanceAAMP *aamp, double seekpos, float rate)
 StreamAbstractionAAMP_OTA Constructor.
 
 ~StreamAbstractionAAMP_OTA ()
 StreamAbstractionAAMP_OTA Distructor.
 
 StreamAbstractionAAMP_OTA (const StreamAbstractionAAMP_OTA &)=delete
 Copy constructor disabled. More...
 
StreamAbstractionAAMP_OTAoperator= (const StreamAbstractionAAMP_OTA &)=delete
 assignment operator disabled More...
 
void DumpProfiles (void) override
 Stub implementation.
 
void Start () override
 Starts streaming.
 
void Stop (bool clearChannelData) override
 Stops streaming.
 
AAMPStatusType Init (TuneType tuneType) override
 Initialize a newly created object. More...
 
void GetStreamFormat (StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxOutputFormat, StreamOutputFormat &subtitleOutputFormat) override
 Get output format of stream. More...
 
double GetStreamPosition () override
 Get current stream position. More...
 
MediaTrackGetMediaTrack (TrackType type) override
 Return MediaTrack of requested type. More...
 
double GetFirstPTS () override
 Get PTS of first sample. More...
 
double GetStartTimeOfFirstPTS () override
 Get Start time PTS of first sample. More...
 
double GetBufferedDuration () override
 Get the Buffered time.
 
bool IsInitialCachingSupported () override
 Check if initial Caching is supports.
 
int GetBWIndex (long bitrate) override
 Get index of profile corresponds to bandwidth. More...
 
std::vector< long > GetVideoBitrates (void) override
 To get the available video bitrates. More...
 
std::vector< long > GetAudioBitrates (void) override
 To get the available audio bitrates. More...
 
long GetMaxBitrate (void) override
 Gets Max Bitrate avialable for current playback. More...
 
void StopInjection (void) override
 Stops injecting fragments to StreamSink.
 
void StartInjection (void) override
 Start injecting fragments to StreamSink.
 
void SeekPosUpdate (double)
 update the Seek position
 
void SetVideoRectangle (int x, int y, int w, int h) override
 SetVideoRectangle sets the position coordinates (x,y) & size (w,h) More...
 
void SetAudioTrack (int index) override
 SetAudioTrack sets a specific audio track. More...
 
void SetAudioTrackByLanguage (const char *lang) override
 SetAudioTrackByLanguage set the audio language. More...
 
std::vector< AudioTrackInfo > & GetAvailableAudioTracks (bool allTrack=false) override
 Get the list of available audio tracks. More...
 
int GetAudioTrack () override
 Get current audio track. More...
 
bool GetCurrentAudioTrack (AudioTrackInfo &audioTrack) override
 Get current audio track. More...
 
std::vector< TextTrackInfo > & GetAvailableTextTracks (bool all=false) override
 Get the list of available text tracks. More...
 
void SetPreferredAudioLanguages () override
 SetPreferredAudioLanguages set the preferred audio language list.
 
void DisableContentRestrictions (long grace, long time, bool eventChange) override
 Disable Restrictions (unlock) till seconds mentioned. More...
 
void EnableContentRestrictions () override
 Enable Content Restriction (lock)
 
std::vector< StreamInfo * > GetAvailableVideoTracks (void) override
 To get the available video tracks. More...
 
std::vector< StreamInfo * > GetAvailableThumbnailTracks (void) override
 To get the available thumbnail tracks. More...
 
bool SetThumbnailTrack (int) override
 Function to set thumbnail track for processing. More...
 
std::vector< ThumbnailDataGetThumbnailRangeData (double, double, std::string *, int *, int *, int *, int *) override
 To get the available thumbnail tracks. More...
 
virtual bool Is4KStream (int &height, long &bandwidth) override
 check if current stream have 4K content More...
 
- Public Member Functions inherited from StreamAbstractionAAMP
 StreamAbstractionAAMP (AampLogManager *logObj, PrivateInstanceAAMP *aamp)
 StreamAbstractionAAMP constructor.
 
virtual ~StreamAbstractionAAMP ()
 StreamAbstractionAAMP destructor.
 
 StreamAbstractionAAMP (const StreamAbstractionAAMP &)=delete
 StreamAbstractionAAMP Copy Constructor.
 
StreamAbstractionAAMPoperator= (const StreamAbstractionAAMP &)=delete
 StreamAbstractionAAMP assignment operator overloading.
 
void WaitForVideoTrackCatchup ()
 Waits audio track injection until caught up with video track. Used internally by injection logic. More...
 
void ReassessAndResumeAudioTrack (bool abort)
 Unblock track if caught up with video or downloads are stopped. More...
 
void SetTsbBandwidth (long tsbBandwidth)
 When TSB is involved, use this to set bandwidth to be reported. More...
 
long GetTsbBandwidth ()
 When TSB is involved, use this to get bandwidth to be reported. More...
 
void SetESChangeStatus (void)
 Set elementary stream type change status for reconfigure the pipeline. More...
 
void ResetESChangeStatus (void)
 Reset elementary stream type change status once the pipeline reconfigured. More...
 
bool GetESChangeStatus (void)
 Get elementary stream type change status for reconfigure the pipeline.. More...
 
bool RampDownProfile (long http_error)
 Rampdown profile. More...
 
void GetDesiredProfileOnBuffer (int currProfileIndex, int &newProfileIndex)
 Get Desired Profile based on Buffer availability. More...
 
void GetDesiredProfileOnSteadyState (int currProfileIndex, int &newProfileIndex, long nwBandwidth)
 Get Desired Profile on steady state. More...
 
void ConfigureTimeoutOnBuffer ()
 Configure download timeouts based on buffer. More...
 
bool IsLowestProfile (int currentProfileIndex)
 Check whether the current profile is lowest. More...
 
long getOriginalCurlError (long http_error)
 Convert custom curl errors to original. More...
 
bool CheckForRampDownProfile (long http_error)
 Check for ramdown profile. More...
 
void CheckForProfileChange (void)
 Checks and update profile based on bandwidth. More...
 
int GetIframeTrack ()
 Get iframe track index. This shall be called only after UpdateIframeTracks() is done. More...
 
void UpdateIframeTracks ()
 Update iframe tracks. Subclasses shall invoke this after StreamInfo is populated . More...
 
double LastVideoFragParsedTimeMS (void)
 Get the last video fragment parsed time. More...
 
int GetDesiredProfile (bool getMidProfile)
 Get the desired profile to start fetching. More...
 
void UpdateRampdownProfileReason (void)
 Update rampdown profile on network failure. More...
 
void NotifyBitRateUpdate (int profileIndex, const StreamInfo &cacheFragStreamInfo, double position)
 Notify bitrate updates to application. Used internally by injection logic. More...
 
bool IsStreamerAtLivePoint ()
 Whether we are playing at live point or not. More...
 
virtual bool GetPreferredLiveOffsetFromConfig ()
 Set the offset value Live object. More...
 
virtual void NotifyPlaybackPaused (bool paused)
 Function called when playback is paused to update related flags. More...
 
bool CheckIfPlayerRunningDry (void)
 Check if player caches are running dry. More...
 
void CheckForPlaybackStall (bool fragmentParsed)
 Check if playback has stalled and update related flags. More...
 
void NotifyFirstFragmentInjected (void)
 MediaTracks shall call this to notify first fragment is injected. More...
 
double GetElapsedTime ()
 Get elapsed time of play-back. More...
 
virtual double GetFirstPeriodStartTime ()
 
virtual double GetFirstPeriodDynamicStartTime ()
 
virtual uint32_t GetCurrPeriodTimeScale ()
 
bool CheckForRampDownLimitReached ()
 Check for ramp down limit reached by player. More...
 
int GetMaxBWProfile ()
 Get profile index of highest bandwidth. More...
 
ABRManager & GetABRManager ()
 Get the ABRManager reference. More...
 
virtual int GetProfileCount ()
 Get number of profiles/ representations from subclass. More...
 
virtual int GetProfileIndexForBandwidth (long mTsbBandwidth)
 Get profile index for TsbBandwidth. More...
 
long GetCurProfIdxBW ()
 
long GetVideoBitrate (void)
 Get the bitrate of current video profile selected. More...
 
long GetAudioBitrate (void)
 Get the bitrate of current audio profile selected. More...
 
void SetVideoBitrate (long bitrate)
 Set a preferred bitrate for video. More...
 
bool IsStreamerStalled (void)
 Check if playback stalled in fragment collector side. More...
 
bool IsMuxedStream ()
 Check if current stream is muxed. More...
 
virtual void NotifyFirstVideoPTS (unsigned long long pts, unsigned long timeScale)
 Receives first video PTS for the current playback. More...
 
virtual void StartSubtitleParser ()
 Kicks off subtitle display - sent at start of video presentation. More...
 
virtual void PauseSubtitleParser (bool pause)
 Pause/unpause subtitles. More...
 
void WaitForAudioTrackCatchup (void)
 Waits subtitle track injection until caught up with muxed/audio track. Used internally by injection logic. More...
 
void AbortWaitForAudioTrackCatchup (bool force)
 Unblock subtitle track injector if downloads are stopped. More...
 
virtual void SetCDAIObject (CDAIObject *cdaiObj)
 Set Client Side DAI object instance. More...
 
virtual bool IsEOSReached ()
 Checks if streamer reached end of stream. More...
 
double GetLastInjectedFragmentPosition ()
 Function to returns last injected fragment position. More...
 
bool ProcessDiscontinuity (TrackType type)
 Function to process discontinuity. More...
 
void AbortWaitForDiscontinuity ()
 Function to abort any wait for discontinuity by injector theads. More...
 
void CheckForMediaTrackInjectionStall (TrackType type)
 Function to check if any media tracks are stalled on discontinuity. More...
 
double GetBufferedVideoDurationSec ()
 Get buffered video duration in seconds. More...
 
void UpdateStreamInfoBitrateData (int profileIndex, StreamInfo &cacheFragStreamInfo)
 Function to update stream info of current fetched fragment. More...
 
virtual bool GetCurrentTextTrack (TextTrackInfo &textTrack)
 Get current text track. More...
 
int GetTextTrack ()
 Get current text track. More...
 
void RefreshSubtitles ()
 Refresh subtitle track. More...
 
void MuteSubtitles (bool mute)
 Send a MUTE/UNMUTE packet to the subtitle renderer. More...
 
void WaitForVideoTrackCatchupForAux ()
 
virtual void ApplyContentRestrictions (std::vector< std::string > restrictions)
 Set Content Restrictions. More...
 
bool GetAudioFwdToAuxStatus ()
 Get audio forward to aux pipeline status. More...
 
void SetAudioFwdToAuxStatus (bool status)
 Set audio forward to aux pipeline status. More...
 
virtual void SetAudioTrackInfoFromMuxedStream (std::vector< AudioTrackInfo > &vector)
 Set AudioTrack info from Muxed stream. More...
 
void SetCurrentAudioTrackIndex (std::string &index)
 Set current audio track index. More...
 
virtual void ChangeMuxedAudioTrackIndex (std::string &index)
 Change muxed audio track index. More...
 
virtual void InitSubtitleParser (char *data)
 Initilaize subtitle parser for sidecar support. More...
 
virtual void ResetSubtitle ()
 reset subtitle parser created for sidecar support More...
 
virtual void MuteSubtitleOnPause ()
 mute subtitles on pause More...
 
virtual void ResumeSubtitleOnPlay (bool mute, char *data)
 resume subtitles on play More...
 
virtual void MuteSidecarSubtitles (bool mute)
 mute/unmute sidecar subtitles More...
 
virtual void ResumeSubtitleAfterSeek (bool mute, char *data)
 resume subtitles after trickplay More...
 
virtual bool SetTextStyle (const std::string &options)
 Set the text style of the subtitle to the options passed. More...
 

Protected Member Functions

StreamInfoGetStreamInfo (int idx) override
 Get stream information of a profile from subclass. More...
 

Private Member Functions

void GetAudioTracks ()
 GetAudioTracks get the available audio tracks for the selected service / media. More...
 
int GetAudioTrackInternal ()
 GetAudioTrackInternal get the primary key for the selected audio.
 
void NotifyAudioTrackChange (const std::vector< AudioTrackInfo > &tracks)
 NotifyAudioTrackChange To notify audio track change.Currently not used as mediaplayer does not have support yet. More...
 
void GetTextTracks ()
 GetTextTracks get the available text tracks for the selected service / media. More...
 

Additional Inherited Members

- Data Fields inherited from StreamAbstractionAAMP
PrivateInstanceAAMPaamp
 
AampLogManagermLogObj
 
bool trickplayMode
 
int currentProfileIndex
 
int currentAudioProfileIndex
 
int currentTextTrackProfileIndex
 
int profileIdxForBandwidthNotification
 
bool hasDrm
 
bool mIsAtLivePoint
 
bool mIsPlaybackStalled
 
bool mNetworkDownDetected
 
bool mCheckForRampdown
 
TuneType mTuneType
 
int mRampDownCount
 
double mProgramStartTime
 
int mTsbMaxBitrateProfileIndex
 
- Protected Attributes inherited from StreamAbstractionAAMP
std::vector< AudioTrackInfomAudioTracks
 
std::vector< AudioTrackInfomAudioTracksAll
 
std::vector< TextTrackInfomTextTracksAll
 
std::vector< TextTrackInfomTextTracks
 
MediaTrackDiscontinuityState mTrackState
 
std::string mAudioTrackIndex
 
std::string mTextTrackIndex
 
bool mFwdAudioToAux
 

yes

Fragment collector for OTA.

Definition at line 52 of file ota_shim.h.

Constructor & Destructor Documentation

◆ StreamAbstractionAAMP_OTA()

StreamAbstractionAAMP_OTA::StreamAbstractionAAMP_OTA ( const StreamAbstractionAAMP_OTA )
delete

Copy constructor disabled.

Member Function Documentation

◆ operator=()

StreamAbstractionAAMP_OTA& StreamAbstractionAAMP_OTA::operator= ( const StreamAbstractionAAMP_OTA )
delete

assignment operator disabled

◆ Init()

AAMPStatusType StreamAbstractionAAMP_OTA::Init ( TuneType  tuneType)
overridevirtual

Initialize a newly created object.

Note
To be implemented by sub classes
Parameters
tuneTypeto set type of object.
Return values
trueon success
falseon failure

Implements StreamAbstractionAAMP.

Definition at line 303 of file ota_shim.cpp.

◆ GetStreamFormat()

void StreamAbstractionAAMP_OTA::GetStreamFormat ( StreamOutputFormat primaryOutputFormat,
StreamOutputFormat audioOutputFormat,
StreamOutputFormat auxOutputFormat,
StreamOutputFormat subtitleOutputFormat 
)
overridevirtual

Get output format of stream.

Parameters
[out]primaryOutputFormat- format of primary track
[out]audioOutputFormat- format of audio track
[out]auxOutputFormat- format of aux audio track
[out]subtitleOutputFormat- format of sutbtile track

Implements StreamAbstractionAAMP.

Definition at line 1020 of file ota_shim.cpp.

◆ GetStreamPosition()

double StreamAbstractionAAMP_OTA::GetStreamPosition ( )
overridevirtual

Get current stream position.

Return values
currentposition of stream.

Implements StreamAbstractionAAMP.

Definition at line 1039 of file ota_shim.cpp.

◆ GetMediaTrack()

MediaTrack * StreamAbstractionAAMP_OTA::GetMediaTrack ( TrackType  type)
overridevirtual

Return MediaTrack of requested type.

Parameters
[in]type- track type
Return values
MediaTrackpointer.

Implements StreamAbstractionAAMP.

Definition at line 1031 of file ota_shim.cpp.

◆ GetFirstPTS()

double StreamAbstractionAAMP_OTA::GetFirstPTS ( )
overridevirtual

Get PTS of first sample.

Return values
PTSof first sample

Implements StreamAbstractionAAMP.

Definition at line 1055 of file ota_shim.cpp.

◆ GetStartTimeOfFirstPTS()

double StreamAbstractionAAMP_OTA::GetStartTimeOfFirstPTS ( )
overridevirtual

Get Start time PTS of first sample.

Return values
starttime of first sample

Implements StreamAbstractionAAMP.

Definition at line 1063 of file ota_shim.cpp.

◆ GetBWIndex()

int StreamAbstractionAAMP_OTA::GetBWIndex ( long  bitrate)
overridevirtual

Get index of profile corresponds to bandwidth.

Parameters
[in]bitrateBitrate to lookup profile
Return values
profileindex

Implements StreamAbstractionAAMP.

Definition at line 1087 of file ota_shim.cpp.

◆ GetVideoBitrates()

std::vector< long > StreamAbstractionAAMP_OTA::GetVideoBitrates ( void  )
overridevirtual

To get the available video bitrates.

Returns
available video bitrates

Implements StreamAbstractionAAMP.

Definition at line 1095 of file ota_shim.cpp.

◆ GetAudioBitrates()

std::vector< long > StreamAbstractionAAMP_OTA::GetAudioBitrates ( void  )
overridevirtual

To get the available audio bitrates.

Returns
available audio bitrates

Implements StreamAbstractionAAMP.

Definition at line 1111 of file ota_shim.cpp.

◆ GetMaxBitrate()

long StreamAbstractionAAMP_OTA::GetMaxBitrate ( void  )
overridevirtual

Gets Max Bitrate avialable for current playback.

Returns
long MAX video bitrates

Reimplemented from StreamAbstractionAAMP.

Definition at line 1103 of file ota_shim.cpp.

◆ SetVideoRectangle()

void StreamAbstractionAAMP_OTA::SetVideoRectangle ( int  x,
int  y,
int  w,
int  h 
)
overridevirtual

SetVideoRectangle sets the position coordinates (x,y) & size (w,h)

Parameters
[in]x,y- position coordinates of video rectangle
[in]wxh- width & height of video rectangle

Reimplemented from StreamAbstractionAAMP.

Definition at line 529 of file ota_shim.cpp.

◆ SetAudioTrack()

void StreamAbstractionAAMP_OTA::SetAudioTrack ( int  index)
overridevirtual

SetAudioTrack sets a specific audio track.

Parameters
[in]Indexof the audio track.

Reimplemented from StreamAbstractionAAMP.

Definition at line 809 of file ota_shim.cpp.

◆ SetAudioTrackByLanguage()

void StreamAbstractionAAMP_OTA::SetAudioTrackByLanguage ( const char *  lang)
overridevirtual

SetAudioTrackByLanguage set the audio language.

Parameters
[in]lang: Audio Language to be set

Reimplemented from StreamAbstractionAAMP.

Definition at line 692 of file ota_shim.cpp.

◆ GetAvailableAudioTracks()

std::vector< AudioTrackInfo > & StreamAbstractionAAMP_OTA::GetAvailableAudioTracks ( bool  allTrack = false)
overridevirtual

Get the list of available audio tracks.

Returns
std::vector<AudioTrackInfo> List of available audio tracks

Reimplemented from StreamAbstractionAAMP.

Definition at line 577 of file ota_shim.cpp.

◆ GetAudioTrack()

int StreamAbstractionAAMP_OTA::GetAudioTrack ( )
overridevirtual

Get current audio track.

Returns
int - index of current audio track

Reimplemented from StreamAbstractionAAMP.

Definition at line 588 of file ota_shim.cpp.

◆ GetCurrentAudioTrack()

bool StreamAbstractionAAMP_OTA::GetCurrentAudioTrack ( AudioTrackInfo audioTrack)
overridevirtual

Get current audio track.

Returns
int - index of current audio track

Reimplemented from StreamAbstractionAAMP.

Definition at line 610 of file ota_shim.cpp.

◆ GetAvailableTextTracks()

std::vector< TextTrackInfo > & StreamAbstractionAAMP_OTA::GetAvailableTextTracks ( bool  all = false)
overridevirtual

Get the list of available text tracks.

Returns
std::vector<TextTrackInfo> List of available text tracks

Reimplemented from StreamAbstractionAAMP.

Definition at line 831 of file ota_shim.cpp.

◆ DisableContentRestrictions()

void StreamAbstractionAAMP_OTA::DisableContentRestrictions ( long  grace,
long  time,
bool  eventChange 
)
overridevirtual

Disable Restrictions (unlock) till seconds mentioned.

Parameters
[in]grace- seconds from current time, grace period, grace = -1 will allow an unlimited grace period
[in]time- seconds from current time,time till which the channel need to be kept unlocked
[in]eventChange- disable restriction handling till next program event boundary

Reimplemented from StreamAbstractionAAMP.

Definition at line 965 of file ota_shim.cpp.

◆ GetAvailableVideoTracks()

std::vector< StreamInfo * > StreamAbstractionAAMP_OTA::GetAvailableVideoTracks ( void  )
overridevirtual

To get the available video tracks.

Returns
available video tracks

Implements StreamAbstractionAAMP.

Definition at line 1119 of file ota_shim.cpp.

◆ GetAvailableThumbnailTracks()

std::vector< StreamInfo * > StreamAbstractionAAMP_OTA::GetAvailableThumbnailTracks ( void  )
overridevirtual

To get the available thumbnail tracks.

Returns
available thumbnail tracks

Implements StreamAbstractionAAMP.

Definition at line 1127 of file ota_shim.cpp.

◆ SetThumbnailTrack()

bool StreamAbstractionAAMP_OTA::SetThumbnailTrack ( int  thumbnailIndex)
overridevirtual

Function to set thumbnail track for processing.

Parameters
thumbnailindex value indicating the track to select
Returns
bool true on success.

Implements StreamAbstractionAAMP.

Definition at line 1135 of file ota_shim.cpp.

◆ GetThumbnailRangeData()

std::vector< ThumbnailData > StreamAbstractionAAMP_OTA::GetThumbnailRangeData ( double  start,
double  end,
std::string *  baseurl,
int *  raw_w,
int *  raw_h,
int *  width,
int *  height 
)
overridevirtual

To get the available thumbnail tracks.

Returns
available thumbnail tracks

Implements StreamAbstractionAAMP.

Definition at line 1144 of file ota_shim.cpp.

◆ Is4KStream()

StreamAbstractionAAMP_OTA::Is4KStream ( int &  height,
long &  bandwidth 
)
inlineoverridevirtual

check if current stream have 4K content

Parameters
height- resolution of 4K stream if found
bandwidth- bandwidth of 4K stream if foudd
Returns
true on success

Implements StreamAbstractionAAMP.

Definition at line 264 of file ota_shim.h.

◆ GetAudioTracks()

StreamAbstractionAAMP_OTA::GetAudioTracks ( )
private

GetAudioTracks get the available audio tracks for the selected service / media.

Returns
void

Definition at line 727 of file ota_shim.cpp.

◆ NotifyAudioTrackChange()

StreamAbstractionAAMP_OTA::NotifyAudioTrackChange ( const std::vector< AudioTrackInfo > &  tracks)
private

NotifyAudioTrackChange To notify audio track change.Currently not used as mediaplayer does not have support yet.

Parameters
[in]tracks- updated audio track info

Definition at line 565 of file ota_shim.cpp.

◆ GetTextTracks()

StreamAbstractionAAMP_OTA::GetTextTracks ( )
private

GetTextTracks get the available text tracks for the selected service / media.

Returns
voi
void

Definition at line 843 of file ota_shim.cpp.

◆ GetStreamInfo()

StreamInfo * StreamAbstractionAAMP_OTA::GetStreamInfo ( int  idx)
overrideprotectedvirtual

Get stream information of a profile from subclass.

Parameters
[in]idx- profile index.
Return values
streaminformation corresponding to index.

Implements StreamAbstractionAAMP.

Definition at line 1047 of file ota_shim.cpp.


The documentation for this class was generated from the following files: