|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
25 #ifndef STREAMABSTRACTIONAAMP_H
26 #define STREAMABSTRACTIONAAMP_H
37 #include <CMCDHeaders.h>
38 #include <AudioCMCDHeaders.h>
39 #include <VideoCMCDHeaders.h>
40 #include <ManifestCMCDHeaders.h>
41 #include <SubtitleCMCDHeaders.h>
107 #ifdef AAMP_DEBUG_INJECT
303 virtual double GetBufferedDuration (
void) = 0;
371 void MonitorBufferHealth();
372 void ScheduleBufferHealthMonitor();
496 static int GetDeferTimeMs(
long maxTimeSeconds);
526 int maxCachedFragmentsPerTrack;
527 int maxCachedFragmentChunksPerTrack;
568 bool discontinuityProcessed;
623 virtual void Start() = 0;
631 virtual void Stop(
bool clearChannelData) = 0;
865 virtual bool Is4KStream(
int &height,
long &bandwidth) = 0;
909 virtual double GetFirstPeriodStartTime() {
return 0; }
910 virtual double GetFirstPeriodDynamicStartTime() {
return 0; }
911 virtual uint32_t GetCurrPeriodTimeScale() {
return 0; }
977 long GetCurProfIdxBW(){
1119 virtual void SeekPosUpdate(
double secondsRelativeToTuneTime) = 0;
1208 virtual std::vector<StreamInfo*> GetAvailableVideoTracks(
void) = 0;
1229 virtual std::vector<ThumbnailData>
GetThumbnailRangeData(
double,
double, std::string*,
int*,
int*,
int*,
int*) = 0;
1434 int mMaxBufferCountCheck;
1462 #endif // STREAMABSTRACTIONAAMP_H
This file provides interfaces for a subtitle parser in AAMP.
bool IsLowestProfile(int currentProfileIndex)
Check whether the current profile is lowest.
virtual void EnableContentRestrictions()
Enable Content Restrictions - lock.
#define DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK
virtual MediaTrack * GetMediaTrack(TrackType type)=0
Return MediaTrack of requested type.
virtual bool GetPreferredLiveOffsetFromConfig()
Set the offset value Live object.
GrowableBuffer fragmentChunk
virtual void SetAudioTrackByLanguage(const char *lang)
SetAudioTrackByLanguage set the audio language. [currently for OTA].
StreamOutputFormat
Media output format.
virtual void SetAudioTrackInfoFromMuxedStream(std::vector< AudioTrackInfo > &vector)
Set AudioTrack info from Muxed stream.
Structure holding the information of a stream.
unsigned int mAudiostateChangeCount
double GetBufferedVideoDurationSec()
Get buffered video duration in seconds.
long long downloadStartTime
int GetDesiredProfileBasedOnCache(void)
Get desired profile based on cached duration.
virtual void SetCDAIObject(CDAIObject *cdaiObj)
Set Client Side DAI object instance.
double LastVideoFragParsedTimeMS(void)
Get the last video fragment parsed time.
bool GetESChangeStatus(void)
Get elementary stream type change status for reconfigure the pipeline..
bool GetAudioFwdToAuxStatus()
Get audio forward to aux pipeline status.
virtual void Stop(bool clearChannelData)=0
Stops streaming.
long getOriginalCurlError(long http_error)
Convert custom curl errors to original.
void AbortWaitForAudioTrackCatchup(bool force)
Unblock subtitle track injector if downloads are stopped.
Structure for audio track information Holds information about an audio track in playlist.
int GetDesiredProfile(bool getMidProfile)
Get the desired profile to start fetching.
bool UpdateProfileBasedOnFragmentCache(void)
Update profile based on fragment cache.
PrivateInstanceAAMP * aamp
@ ePLAYLISTTYPE_UNDEFINED
void SetTsbBandwidth(long tsbBandwidth)
When TSB is involved, use this to set bandwidth to be reported.
bool CheckIfPlayerRunningDry(void)
Check if player caches are running dry.
void WaitForAudioTrackCatchup(void)
Waits subtitle track injection until caught up with muxed/audio track. Used internally by injection l...
virtual int GetAudioTrack()
Get current audio track.
virtual bool IsEOSReached()
Checks if streamer reached end of stream.
void CheckForMediaTrackInjectionStall(TrackType type)
Function to check if any media tracks are stalled on discontinuity.
std::vector< TextTrackInfo > mTextTracks
virtual std::vector< long > GetVideoBitrates(void)=0
Get available video bitrates.
virtual int GetBWIndex(long bandwidth)=0
Get profile index of given bandwidth.
void NotifyFirstFragmentInjected(void)
MediaTracks shall call this to notify first fragment is injected.
int mABRHighBufferCounter
void SetCurrentAudioTrackIndex(std::string &index)
Set current audio track index.
bool IsStreamerStalled(void)
Check if playback stalled in fragment collector side.
void WaitForVideoTrackCatchup()
Waits audio track injection until caught up with video track. Used internally by injection logic.
bool mNetworkDownDetected
virtual bool SetTextStyle(const std::string &options)
Set the text style of the subtitle to the options passed.
void RefreshSubtitles()
Refresh subtitle track.
virtual void NotifyFirstVideoPTS(unsigned long long pts, unsigned long timeScale)
Receives first video PTS for the current playback.
virtual double GetFirstPTS()=0
Get PTS of first sample.
virtual void Start()=0
Start streaming.
long long mLastPausedTimeStamp
Structure of cached fragment data Holds information about a cached fragment.
virtual void ResetSubtitle()
reset subtitle parser created for sidecar support
StreamResolution resolution
virtual std::vector< StreamInfo * > GetAvailableThumbnailTracks(void)=0
Get available thumbnail bitrates.
virtual void DumpProfiles(void)=0
Dump profiles for debugging. To be implemented by sub classes.
void SetESChangeStatus(void)
Set elementary stream type change status for reconfigure the pipeline.
long GetVideoBitrate(void)
Get the bitrate of current video profile selected.
void CheckForPlaybackStall(bool fragmentParsed)
Check if playback has stalled and update related flags.
bool IsStreamerAtLivePoint()
Whether we are playing at live point or not.
virtual bool IsInitialCachingSupported()
Check if Initial Fragment Caching is supported.
TileInfo structure for Thumbnail data.
virtual void InitSubtitleParser(char *data)
Initilaize subtitle parser for sidecar support.
void ConfigureTimeoutOnBuffer()
Configure download timeouts based on buffer.
void GetDesiredProfileOnBuffer(int currProfileIndex, int &newProfileIndex)
Get Desired Profile based on Buffer availability.
void AbortWaitForDiscontinuity()
Function to abort any wait for discontinuity by injector theads.
virtual void StopInjection(void)=0
Stop injection of fragments.
int GetTextTrack()
Get current text track.
double GetElapsedTime()
Get elapsed time of play-back.
virtual double GetStartTimeOfFirstPTS()=0
Get Start time PTS of first sample.
void SetAudioFwdToAuxStatus(bool status)
Set audio forward to aux pipeline status.
void ReassessAndResumeAudioTrack(bool abort)
Unblock track if caught up with video or downloads are stopped.
void WaitForVideoTrackCatchupForAux()
bool CheckForRampDownProfile(long http_error)
Check for ramdown profile.
virtual void StartInjection(void)=0
Start injection of fragments.
StreamAbstraction class of AAMP.
StreamAbstractionAAMP(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
StreamAbstractionAAMP constructor.
virtual void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxAudioOutputFormat, StreamOutputFormat &subtitleOutputFormat)=0
Get output format of stream.
long GetAudioBitrate(void)
Get the bitrate of current audio profile selected.
virtual void ChangeMuxedAudioTrackIndex(std::string &index)
Change muxed audio track index.
virtual void PauseSubtitleParser(bool pause)
Pause/unpause subtitles.
Header file of helper functions for memory management.
pthread_mutex_t mStateLock
TrackType
Media Track Types.
virtual bool SetThumbnailTrack(int)=0
Set thumbnail bitrate.
void UpdateProfileBasedOnFragmentDownloaded(void)
Update profile state based on bandwidth of fragments downloaded.
StreamAbstractionAAMP & operator=(const StreamAbstractionAAMP &)=delete
StreamAbstractionAAMP assignment operator overloading.
virtual double GetBufferedDuration(void)=0
Function to get the buffer duration of stream.
BitrateChangeReason
Different reasons for bitrate change.
File to handle Json format.
std::vector< AudioTrackInfo > mAudioTracksAll
MediaTrackDiscontinuityState
Media Disconutinuity state.
virtual bool Is4KStream(int &height, long &bandwidth)=0
check if current stream have 4K content
BufferHealthStatus
Buffer health status.
void ResetESChangeStatus(void)
Reset elementary stream type change status once the pipeline reconfigured.
Structure holding the resolution of stream.
virtual int GetProfileCount()
Get number of profiles/ representations from subclass.
BitrateChangeReason mBitrateReason
void NotifyBitRateUpdate(int profileIndex, const StreamInfo &cacheFragStreamInfo, double position)
Notify bitrate updates to application. Used internally by injection logic.
std::string mTextTrackIndex
long bandwidthBitsPerSecond
HybridABRManager mhAbrManager
bool RampDownProfile(long http_error)
Rampdown profile.
std::string mAudioTrackIndex
bool CheckForRampDownLimitReached()
Check for ramp down limit reached by player.
ABRManager & GetABRManager()
Get the ABRManager reference.
virtual int GetProfileIndexForBandwidth(long mTsbBandwidth)
Get profile index for TsbBandwidth.
virtual bool GetCurrentAudioTrack(AudioTrackInfo &audioTrack)
Get current audio track information.
virtual std::vector< AudioTrackInfo > & GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
virtual AAMPStatusType Init(TuneType tuneType)=0
Initialize a newly created object. To be implemented by sub classes.
int currentTextTrackProfileIndex
void UpdateStreamInfoBitrateData(int profileIndex, StreamInfo &cacheFragStreamInfo)
Function to update stream info of current fetched fragment.
virtual void ResumeSubtitleOnPlay(bool mute, char *data)
resume subtitles on play
double mLastVideoFragParsedTimeMS
Private functions and types used internally by AAMP.
virtual StreamInfo * GetStreamInfo(int idx)=0
Get stream information of a profile from subclass.
int GetIframeTrack()
Get iframe track index. This shall be called only after UpdateIframeTracks() is done.
long GetTsbBandwidth()
When TSB is involved, use this to get bandwidth to be reported.
virtual ~StreamAbstractionAAMP()
StreamAbstractionAAMP destructor.
virtual void ResumeSubtitleAfterSeek(bool mute, char *data)
resume subtitles after trickplay
virtual void NotifyPlaybackPaused(bool paused)
Function called when playback is paused to update related flags.
long long mStartTimeStamp
Structure of GrowableBuffer.
virtual double GetStreamPosition()=0
Get current stream position.
Class representing the AAMP player's private instance, which is not exposed to outside world.
virtual void SetVideoRectangle(int x, int y, int w, int h)
setVideoRectangle sets the position coordinates (x,y) & size (w,h) for OTA streams only
virtual std::vector< TextTrackInfo > & GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
int GetMaxBWProfile()
Get profile index of highest bandwidth.
BitrateChangeReason reason
int profileIdxForBandwidthNotification
int currentAudioProfileIndex
AAMPStatusType
AAMP Function return values.
std::vector< AudioTrackInfo > mAudioTracks
virtual void SeekPosUpdate(double secondsRelativeToTuneTime)=0
Update seek position when player is initialized.
long long mTotalPausedDurationMS
virtual void MuteSubtitleOnPause()
mute subtitles on pause
virtual void SetAudioTrack(int index)
SetAudioTrack set the audio track using index value. [currently for OTA].
Structure for text track information Holds information about a text track in playlist.
virtual long GetMaxBitrate()
Gets Max bitrate supported.
void MuteSubtitles(bool mute)
Send a MUTE/UNMUTE packet to the subtitle renderer.
double GetLastInjectedFragmentPosition()
Function to returns last injected fragment position.
void UpdateRampdownProfileReason(void)
Update rampdown profile on network failure.
Base class for the client side DAI object.
long mNwConsistencyBypass
MediaTrackDiscontinuityState mTrackState
int mLastVideoFragCheckedforABR
virtual void MuteSidecarSubtitles(bool mute)
mute/unmute sidecar subtitles
bool IsMuxedStream()
Check if current stream is muxed.
PlaylistType
Playlist Types.
StreamInfo cacheFragStreamInfo
Structure of cached fragment data Holds information about a cached fragment.
virtual void StartSubtitleParser()
Kicks off subtitle display - sent at start of video presentation.
void GetDesiredProfileOnSteadyState(int currProfileIndex, int &newProfileIndex, long nwBandwidth)
Get Desired Profile on steady state.
virtual std::vector< long > GetAudioBitrates(void)=0
Get available audio bitrates.
void UpdateIframeTracks()
Update iframe tracks. Subclasses shall invoke this after StreamInfo is populated .
virtual bool GetCurrentTextTrack(TextTrackInfo &textTrack)
Get current text track.
std::vector< TextTrackInfo > mTextTracksAll
void SetVideoBitrate(long bitrate)
Set a preferred bitrate for video.
pthread_cond_t mStateCond
virtual void ApplyContentRestrictions(std::vector< std::string > restrictions)
Set Content Restrictions.
virtual std::vector< ThumbnailData > GetThumbnailRangeData(double, double, std::string *, int *, int *, int *, int *)=0
Get thumbnail data for duration value.
virtual void SetPreferredAudioLanguages()
SetPreferredAudioLanguages set the preferred audio languages and rendition. [currently for OTA].
bool ProcessDiscontinuity(TrackType type)
Function to process discontinuity.
void CheckForProfileChange(void)
Checks and update profile based on bandwidth.
virtual void DisableContentRestrictions(long grace, long time, bool eventChange)
Disable Content Restrictions - unlock.
int mTsbMaxBitrateProfileIndex