RDK Documentation (Open Sourced RDK Components)
|
MPD media track. More...
#include <MediaStreamContext.h>
Public Member Functions | |
MediaStreamContext (AampLogManager *logObj, TrackType type, StreamAbstractionAAMP_MPD *ctx, PrivateInstanceAAMP *aamp, const char *name) | |
MediaStreamContext Constructor. More... | |
~MediaStreamContext () | |
MediaStreamContext Destructor. | |
MediaStreamContext (const MediaStreamContext &)=delete | |
MediaStreamContext Copy Constructor. | |
MediaStreamContext & | operator= (const MediaStreamContext &)=delete |
MediaStreamContext Assignment operator overloading. | |
StreamAbstractionAAMP * | GetContext () |
Get the context of media track. To be implemented by subclasses. More... | |
void | InjectFragmentInternal (CachedFragment *cachedFragment, bool &fragmentDiscarded) |
Receives cached fragment and injects to sink. More... | |
bool | CacheFragment (std::string fragmentUrl, unsigned int curlInstance, double position, double duration, const char *range=NULL, bool initSegment=false, bool discontinuity=false, bool playingAd=false, double pto=0, uint32_t scale=0, bool overWriteTrackId=false) |
Fetch and cache a fragment. More... | |
bool | CacheFragmentChunk (MediaType actualType, char *ptr, size_t size, std::string remoteUrl, long long dnldStartTime) |
Cache Fragment Chunk. More... | |
void | ABRProfileChanged (void) |
Listener to ABR profile change. | |
double | GetBufferedDuration () |
Get duration of buffer. | |
void | SignalTrickModeDiscontinuity () |
Notify discontinuity during trick-mode as PTS re-stamping is done in sink. More... | |
bool | IsAtEndOfTrack () |
Returns if the end of track reached. More... | |
Public Member Functions inherited from MediaTrack | |
MediaTrack (AampLogManager *logObj, TrackType type, PrivateInstanceAAMP *aamp, const char *name) | |
MediaTrack Constructor. | |
virtual | ~MediaTrack () |
MediaTrack Destructor. | |
MediaTrack (const MediaTrack &)=delete | |
MediaTrack Copy Constructor. | |
MediaTrack & | operator= (const MediaTrack &)=delete |
MediaTrack assignment operator overloading. | |
void | StartInjectLoop () |
Start fragment injector loop. More... | |
void | StartInjectChunkLoop () |
Start fragment Chunk injector loop. More... | |
void | StopInjectLoop () |
Stop fragment injector loop. More... | |
void | StopInjectChunkLoop () |
Stop fragment chunk injector loop of track. More... | |
bool | Enabled () |
Check if a track is enabled. More... | |
bool | InjectFragment () |
Inject fragment into the gstreamer. More... | |
bool | ProcessFragmentChunk () |
Process next cached fragment chunk. | |
bool | InjectFragmentChunk () |
Inject fragment Chunk into the gstreamer. More... | |
double | GetTotalInjectedDuration () |
Get total fragment injected duration. More... | |
double | GetTotalInjectedChunkDuration () |
Get total fragment chunk injected duration. More... | |
void | RunInjectLoop () |
Injection loop - use internally by injection logic. More... | |
void | RunInjectChunkLoop () |
Run fragment injector loop. Injection loop - use internally by injection logic. More... | |
void | UpdateTSAfterFetch () |
Updates internal state after a fragment fetch. More... | |
void | UpdateTSAfterChunkFetch () |
Updates internal state after a fragment fetch. More... | |
bool | WaitForFreeFragmentAvailable (int timeoutMs=-1) |
Wait until a free fragment is available. More... | |
void | AbortWaitForCachedAndFreeFragment (bool immediate) |
Abort the waiting for cached fragments and free fragment slot. More... | |
int | GetTotalFragmentsFetched () |
Get number of fragments dpownloaded. More... | |
CachedFragment * | GetFetchBuffer (bool initialize) |
Get buffer to store the downloaded fragment content to cache next fragment. More... | |
CachedFragmentChunk * | GetFetchChunkBuffer (bool initialize) |
Get buffer to fetch and cache next fragment chunk. More... | |
void | SetCurrentBandWidth (int bandwidthBps) |
Set current bandwidth of track. More... | |
int | GetProfileIndexForBW (long mTsbBandwidth) |
Get profile index for TsbBandwidth. More... | |
int | GetCurrentBandWidth () |
Get current bandwidth in bps. More... | |
double | GetTotalFetchedDuration () |
Get total duration of fetched fragments. More... | |
double | GetTotalInjectedChunksDuration () |
Get total duration of fetched fragments. More... | |
bool | IsDiscontinuityProcessed () |
Check if discontinuity is being processed. More... | |
bool | isFragmentInjectorThreadStarted () |
void | MonitorBufferHealth () |
void | ScheduleBufferHealthMonitor () |
BufferHealthStatus | GetBufferStatus () |
Get buffer Status of track. More... | |
BufferHealthStatus | GetBufferHealthStatus () |
Get buffer health status. More... | |
void | AbortWaitForCachedFragment () |
Abort the waiting for cached fragments immediately. More... | |
bool | IsInjectionAborted () |
Check whether track data injection is aborted. More... | |
bool | CheckForFutureDiscontinuity (double &cacheDuration) |
To check for discontinuity in future fragments. More... | |
void | OnSinkBufferFull () |
Called if sink buffer is full. More... | |
void | FlushFragments () |
Flushes all cached fragments Flushes all media fragments and resets all relevant counters Only intended for use on subtitle streams. More... | |
void | FlushFragmentChunks () |
Flushes all cached fragment Chunks. More... | |
Data Fields | |
MediaType | mediaType |
CMCDHeaders * | pCMCDMetrics |
struct FragmentDescriptor | fragmentDescriptor |
const IAdaptationSet * | adaptationSet |
const IRepresentation * | representation |
int | fragmentIndex |
int | timeLineIndex |
int | fragmentRepeatCount |
uint64_t | fragmentOffset |
bool | eos |
bool | profileChanged |
bool | discontinuity |
GrowableBuffer | mDownloadedFragment |
double | fragmentTime |
double | downloadedDuration |
double | periodStartOffset |
uint64_t | timeStampOffset |
char * | index_ptr |
size_t | index_len |
uint64_t | lastSegmentTime |
uint64_t | lastSegmentNumber |
uint64_t | lastSegmentDuration |
int | adaptationSetIdx |
int | representationIndex |
StreamAbstractionAAMP_MPD * | context |
std::string | initialization |
uint32_t | adaptationSetId |
bool | mSkipSegmentOnError |
double | scaledPTO |
bool | failAdjacentSegment |
long | httpErrorCode |
Data Fields inherited from MediaTrack | |
bool | eosReached |
bool | enabled |
int | numberOfFragmentsCached |
int | numberOfFragmentChunksCached |
const char * | name |
double | fragmentDurationSeconds |
int | segDLFailCount |
int | segDrmDecryptFailCount |
int | mSegInjectFailCount |
TrackType | type |
std::unique_ptr< SubtitleParser > | mSubtitleParser |
bool | refreshSubtitles |
int | maxCachedFragmentsPerTrack |
int | maxCachedFragmentChunksPerTrack |
pthread_cond_t | fragmentChunkFetched |
uint32_t | totalMdatCount |
int | noMDATCount |
Additional Inherited Members | |
Protected Member Functions inherited from MediaTrack | |
void | UpdateTSAfterInject () |
Update segment cache and inject buffer to gstreamer. More... | |
void | UpdateTSAfterChunkInject () |
Update segment cache and inject buffer to gstreamer. More... | |
bool | WaitForCachedFragmentAvailable () |
Wait till cached fragment available. More... | |
bool | WaitForCachedFragmentChunkInjected (int timeoutMs=-1) |
Wait until a cached fragment chunk is Injected. More... | |
bool | WaitForCachedFragmentChunkAvailable () |
Wait till cached fragment chunk available. More... | |
void | InjectFragmentChunkInternal (MediaType mediaType, GrowableBuffer *buffer, double fpts, double fdts, double fDuration) |
To be implemented by derived classes to receive cached fragment Chunk Receives cached fragment and injects to sink. More... | |
Static Protected Member Functions inherited from MediaTrack | |
static int | GetDeferTimeMs (long maxTimeSeconds) |
Protected Attributes inherited from MediaTrack | |
AampLogManager * | mLogObj |
PrivateInstanceAAMP * | aamp |
CachedFragment * | cachedFragment |
CachedFragmentChunk | cachedFragmentChunks [20] |
GrowableBuffer | unparsedBufferChunk |
GrowableBuffer | parsedBufferChunk |
bool | abort |
pthread_mutex_t | mutex |
bool | ptsError |
bool | abortInject |
bool | abortInjectChunk |
MPD media track.
Definition at line 35 of file MediaStreamContext.h.
|
inline |
MediaStreamContext Constructor.
type | Type of track |
ctx | context MPD collector context |
aamp | Pointer to associated aamp instance |
name | Name of the track |
Definition at line 45 of file MediaStreamContext.h.
|
inlinevirtual |
Get the context of media track. To be implemented by subclasses.
Context | of track. |
Implements MediaTrack.
Definition at line 94 of file MediaStreamContext.h.
|
virtual |
Receives cached fragment and injects to sink.
[in] | cachedFragment | - contains fragment to be processed and injected |
[out] | fragmentDiscarded | - true if fragment is discarded. |
Implements MediaTrack.
Definition at line 33 of file MediaStreamContext.cpp.
MediaStreamContext::CacheFragment | ( | std::string | fragmentUrl, |
unsigned int | curlInstance, | ||
double | position, | ||
double | duration, | ||
const char * | range = NULL , |
||
bool | initSegment = false , |
||
bool | discontinuity = false , |
||
bool | playingAd = false , |
||
double | pto = 0 , |
||
uint32_t | scale = 0 , |
||
bool | overWriteTrackId = false |
||
) |
Fetch and cache a fragment.
fragmentUrl | url of fragment |
curlInstance | curl instance to be used to fetch |
position | position of fragment in seconds |
duration | duration of fragment in seconds |
range | byte range |
initSegment | true if fragment is init fragment |
discontinuity | true if fragment is discontinuous |
playingAd | flag if playing Ad |
pto | unscaled pto value from mpd |
scale | timeScale value from mpd |
overWriteTrackId | flag to overwrite the trackID of the init fragment with the current one if those are different |
true | on success |
Definition at line 55 of file MediaStreamContext.cpp.
bool MediaStreamContext::CacheFragmentChunk | ( | MediaType | actualType, |
char * | ptr, | ||
size_t | size, | ||
std::string | remoteUrl, | ||
long long | dnldStartTime | ||
) |
Cache Fragment Chunk.
actualType | MediaType type of cached media |
ptr | CURL provided chunk data |
size | CURL provided chunk data size |
remoteUrl | url of fragment |
dnldStartTime | of the download |
Definition at line 309 of file MediaStreamContext.cpp.
|
virtual |
Notify discontinuity during trick-mode as PTS re-stamping is done in sink.
Reimplemented from MediaTrack.
Definition at line 413 of file MediaStreamContext.cpp.
|
virtual |
Returns if the end of track reached.
Reimplemented from MediaTrack.
Definition at line 422 of file MediaStreamContext.cpp.
CMCDHeaders* MediaStreamContext::pCMCDMetrics |
pointer object to class CMCDHeaders
Definition at line 156 of file MediaStreamContext.h.