RDK Documentation (Open Sourced RDK Components)
StreamAbstractionAAMP.h
Go to the documentation of this file.
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 2018 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 /**
21  * @file StreamAbstractionAAMP.h
22  * @brief Base classes of HLS/MPD collectors. Implements common caching/injection logic.
23  */
24 
25 #ifndef STREAMABSTRACTIONAAMP_H
26 #define STREAMABSTRACTIONAAMP_H
27 
28 #include "AampMemoryUtils.h"
29 #include "priv_aamp.h"
30 #include "AampJsonObject.h"
31 #include <map>
32 #include <iterator>
33 #include <vector>
34 
35 #include <glib.h>
36 #include "subtitleParser.h"
37 #include <CMCDHeaders.h>
38 #include <AudioCMCDHeaders.h>
39 #include <VideoCMCDHeaders.h>
40 #include <ManifestCMCDHeaders.h>
41 #include <SubtitleCMCDHeaders.h>
42 
43 
44 
45 /**
46  * @brief Media Track Types
47  */
48 typedef enum
49 {
50  eTRACK_VIDEO, /**< Video track */
51  eTRACK_AUDIO, /**< Audio track */
52  eTRACK_SUBTITLE, /**< Subtitle track */
53  eTRACK_AUX_AUDIO /**< Auxiliary audio track */
54 } TrackType;
55 
56 /**
57  * @brief Structure holding the resolution of stream
58  */
60 {
61  int width; /**< Width in pixels*/
62  int height; /**< Height in pixels*/
63  double framerate; /**< Frame Rate */
64 };
65 
66 /**
67  * @brief Structure holding the information of a stream.
68  */
69 struct StreamInfo
70 {
71  bool enabled; /**< indicates if the streamInfo profile is enabled */
72  bool isIframeTrack; /**< indicates if the stream is iframe stream*/
73  bool validity; /**< indicates profile validity against user configured profile range */
74  const char *codecs; /**< Codec String */
75  long bandwidthBitsPerSecond; /**< Bandwidth of the stream bps*/
76  StreamResolution resolution; /**< Resolution of the stream*/
77  BitrateChangeReason reason; /**< Reason for bitrate change*/
78 };
79 
80 /**
81 * \struct TileInfo
82 * \brief TileInfo structure for Thumbnail data
83 */
84 struct TileInfo
85 {
86  int numRows; /**< Number of Rows from Tile Inf */
87  int numCols; /**< Number of Cols from Tile Inf */
88  double posterDuration; /**< Duration of each Tile in Spritesheet */
89 
90  double tileSetDuration; /**<Duration of whole Tile set */
91  double startTime;
92  const char *url;
93 };
94 
95 /**
96  * @brief Structure of cached fragment data
97  * Holds information about a cached fragment
98  */
100 {
101  GrowableBuffer fragment; /**< Buffer to keep fragment content */
102  double position; /**< Position in the playlist */
103  double duration; /**< Fragment duration */
104  bool initFragment; /**< Is init frgment */
105  bool discontinuity; /**< PTS discontinuity status */
106  int profileIndex; /**< Profile index; Updated internally */
107 #ifdef AAMP_DEBUG_INJECT
108  std::string uri; /**< Fragment url */
109 #endif
110  StreamInfo cacheFragStreamInfo; /**< Bitrate info of the fragment */
111  MediaType type; /**< MediaType info of the fragment */
112 };
113 
114 /**
115  * @brief Structure of cached fragment data
116  * Holds information about a cached fragment
117  */
119 {
120  GrowableBuffer fragmentChunk; /**< Buffer to keep fragment content */
121  MediaType type; /**< MediaType info of the fragment */
122  long long downloadStartTime; /**< The start time of file download */
123 };
124 
125 /**
126  * @brief Playlist Types
127  */
128 typedef enum
129 {
130  ePLAYLISTTYPE_UNDEFINED, /**< Playlist type undefined */
131  ePLAYLISTTYPE_EVENT, /**< Playlist may grow via appended lines, but otherwise won't change */
132  ePLAYLISTTYPE_VOD, /**< Playlist will never change */
133 } PlaylistType;
134 
135 /**
136  * @brief Buffer health status
137  */
139 {
140  BUFFER_STATUS_GREEN, /**< Healthy state, where buffering is close to being maxed out */
141  BUFFER_STATUS_YELLOW, /**< Danger state, where buffering is close to being exhausted */
142  BUFFER_STATUS_RED /**< Failed state, where buffers have run dry, and player experiences underrun/stalled video */
143 };
144 
145 /**
146  * @brief Media Disconutinuity state
147  */
148 typedef enum
149 {
150  eDISCONTIUITY_FREE = 0, /**< No Discontinuity */
151  eDISCONTINUIY_IN_VIDEO = 1, /**< Discontinuity in Video */
152  eDISCONTINUIY_IN_AUDIO = 2, /**< Discontinuity in audio */
153  eDISCONTINUIY_IN_BOTH = 3 /**< Discontinuity in Both Audio and Video */
155 
156 /**
157  * @brief Base Class for Media Track
158  */
160 {
161 public:
162 
163  /**
164  * @fn MediaTrack
165  *
166  * @param[in] type - Media track type
167  * @param[in] aamp - Pointer to PrivateInstanceAAMP
168  * @param[in] name - Media track name
169  */
171 
172  /**
173  * @fn ~MediaTrack
174  */
175  virtual ~MediaTrack();
176 
177  /**
178  * @brief MediaTrack Copy Constructor
179  */
180  MediaTrack(const MediaTrack&) = delete;
181 
182  /**
183  * @brief MediaTrack assignment operator overloading
184  */
185  MediaTrack& operator=(const MediaTrack&) = delete;
186 
187  /**
188  * @fn StartInjectLoop
189  *
190  * @return void
191  */
192  void StartInjectLoop();
193 
194  /**
195  * @fn StartInjectChunkLoop
196  *
197  * @return void
198  */
199  void StartInjectChunkLoop();
200 
201  /**
202  * @fn StopInjectLoop
203  *
204  * @return void
205  */
206  void StopInjectLoop();
207 
208  /**
209  * @fn StopInjectChunkLoop
210  *
211  * @return void
212  */
213  void StopInjectChunkLoop();
214 
215  /**
216  * @fn Enabled
217  * @retval true if enabled, false if disabled
218  */
219  bool Enabled();
220 
221  /**
222  * @fn InjectFragment
223  *
224  * @return Success/Failure
225  */
226  bool InjectFragment();
227 
228  /**
229  * @fn ProcessFragmentChunk
230  */
231  bool ProcessFragmentChunk();
232 
233  /**
234  * @fn InjectFragmentChunk
235  *
236  * @return Success/Failure
237  */
238  bool InjectFragmentChunk();
239 
240  /**
241  * @brief Get total fragment injected duration
242  *
243  * @return Total duration in seconds
244  */
246 
247  /**
248  * @brief Get total fragment chunk injected duration
249  *
250  * @return Total duration in seconds
251  */
253 
254  /**
255  * @fn RunInjectLoop
256  *
257  * @return void
258  */
259  void RunInjectLoop();
260 
261  /**
262  * @fn RunInjectChunkLoop
263  *
264  * @return void
265  */
266  void RunInjectChunkLoop();
267 
268  /**
269  * @fn UpdateTSAfterFetch
270  *
271  * @return void
272  */
273  void UpdateTSAfterFetch();
274 
275  /**
276  * @fn UpdateTSAfterChunkFetch
277  *
278  * @return void
279  */
281 
282  /**
283  * @fn WaitForFreeFragmentAvailable
284  * @param timeoutMs - timeout in milliseconds. -1 for infinite wait
285  * @retval true if fragment available, false on abort.
286  */
287  bool WaitForFreeFragmentAvailable( int timeoutMs = -1);
288 
289  /**
290  * @fn AbortWaitForCachedAndFreeFragment
291  *
292  * @param[in] immediate - Forced or lazy abort as in a seek/ stop
293  * @return void
294  */
295  void AbortWaitForCachedAndFreeFragment(bool immediate);
296 
297  /**
298  * @brief Notifies profile changes to subclasses
299  *
300  * @return void
301  */
302  virtual void ABRProfileChanged(void) = 0;
303  virtual double GetBufferedDuration (void) = 0;
304 
305  /**
306  * @brief Get number of fragments dpownloaded
307  *
308  * @return Number of downloaded fragments
309  */
311 
312  /**
313  * @fn GetFetchBuffer
314  *
315  * @param[in] initialize - Buffer to to initialized or not
316  * @return Fragment cache buffer
317  */
318  CachedFragment* GetFetchBuffer(bool initialize);
319 
320  /**
321  * @fn GetFetchChunkBuffer
322  * @param[in] initialize true to initialize the fragment chunk
323  * @retval Pointer to fragment chunk buffer.
324  */
325  CachedFragmentChunk* GetFetchChunkBuffer(bool initialize);
326 
327  /**
328  * @fn SetCurrentBandWidth
329  *
330  * @param[in] bandwidthBps - Bandwidth in bps
331  * @return void
332  */
333  void SetCurrentBandWidth(int bandwidthBps);
334 
335  /**
336  * @fn GetProfileIndexForBW
337  * @param mTsbBandwidth - bandwidth to identify profile index from list
338  * @retval profile index of the current bandwidth
339  */
340  int GetProfileIndexForBW(long mTsbBandwidth);
341 
342  /**
343  * @fn GetCurrentBandWidth
344  *
345  * @return Bandwidth in bps
346  */
347  int GetCurrentBandWidth();
348 
349  /**
350  * @brief Get total duration of fetched fragments
351  *
352  * @return Total duration in seconds
353  */
355 
356  /**
357  * @brief Get total duration of fetched fragments
358  *
359  * @return Total duration in seconds
360  */
362 
363  /**
364  * @brief Check if discontinuity is being processed
365  *
366  * @return true if discontinuity is being processed
367  */
368  bool IsDiscontinuityProcessed() { return discontinuityProcessed; }
369 
370  bool isFragmentInjectorThreadStarted( ) { return fragmentInjectorThreadStarted;}
371  void MonitorBufferHealth();
372  void ScheduleBufferHealthMonitor();
373 
374  /**
375  * @fn GetBufferStatus
376  *
377  * @return BufferHealthStatus
378  */
380 
381  /**
382  * @brief Get buffer health status
383  *
384  * @return current buffer health status
385  */
387 
388  /**
389  * @fn AbortWaitForCachedFragment
390  *
391  * @return void
392  */
394 
395  /**
396  * @brief Check whether track data injection is aborted
397  *
398  * @return true if injection is aborted, false otherwise
399  */
400  bool IsInjectionAborted() { return (abort || abortInject); }
401 
402  /**
403  * @brief Returns if the end of track reached.
404  */
405  virtual bool IsAtEndOfTrack() { return eosReached;}
406 
407  /**
408  * @fn CheckForFutureDiscontinuity
409  *
410  * @param[out] cacheDuration - cached fragment duration in seconds
411  * @return bool - true if discontinuity present, false otherwise
412  */
413  bool CheckForFutureDiscontinuity(double &cacheDuration);
414 
415  /**
416  * @fn OnSinkBufferFull
417  *
418  * @return void
419  */
420  void OnSinkBufferFull();
421 
422  /**
423  * @fn FlushFragments
424  * @return void
425  */
426  void FlushFragments();
427 
428  /**
429  * @fn FlushFragmentChunks
430  *
431  * @return void
432  */
433  void FlushFragmentChunks();
434 
435 protected:
436 
437  /**
438  * @fn UpdateTSAfterInject
439  *
440  * @return void
441  */
442  void UpdateTSAfterInject();
443 
444  /**
445  * @brief Update segment cache and inject buffer to gstreamer
446  *
447  * @return void
448  */
450 
451  /**
452  * @fn WaitForCachedFragmentAvailable
453  *
454  * @return TRUE if fragment available, FALSE if aborted/fragment not available.
455  */
457 
458  /**
459  * @fn WaitForCachedFragmentChunkInjected
460  * @retval true if fragment chunk injected , false on abort.
461  */
462  bool WaitForCachedFragmentChunkInjected(int timeoutMs = -1);
463 
464  /**
465  * @fn WaitForCachedFragmentChunkAvailable
466  *
467  * @return TRUE if fragment chunk available, FALSE if aborted/fragment chunk not available.
468  */
470 
471  /**
472  * @brief Get the context of media track. To be implemented by subclasses
473  *
474  * @return Pointer to StreamAbstractionAAMP object
475  */
476  virtual class StreamAbstractionAAMP* GetContext() = 0;
477 
478  /**
479  * @brief To be implemented by derived classes to receive cached fragment.
480  *
481  * @param[in] cachedFragment - contains fragment to be processed and injected
482  * @param[out] fragmentDiscarded - true if fragment is discarded.
483  * @return void
484  */
485  virtual void InjectFragmentInternal(CachedFragment* cachedFragment, bool &fragmentDiscarded) = 0;
486 
487  /**
488  * @fn InjectFragmentChunkInternal
489  * @param[in] cachedFragmentChunk - contains fragment to be processed and injected
490  * @param[out] fragmentChunkDiscarded - true if fragment is discarded.
491  * @return void
492  */
493  void InjectFragmentChunkInternal(MediaType mediaType, GrowableBuffer* buffer, double fpts, double fdts, double fDuration);
494 
495 
496  static int GetDeferTimeMs(long maxTimeSeconds);
497 
498 
499  /**
500  * @brief To be implemented by derived classes if discontinuity on trick-play is to be notified.
501  *
502  */
504 
505 private:
506  /**
507  * @fn GetBufferHealthStatusString
508  *
509  * @return string representation of buffer status
510  */
511  static const char* GetBufferHealthStatusString(BufferHealthStatus status);
512 
513 public:
514  bool eosReached; /**< set to true when a vod asset has been played to completion */
515  bool enabled; /**< set to true if track is enabled */
516  int numberOfFragmentsCached; /**< Number of fragments cached in this track*/
517  int numberOfFragmentChunksCached; /**< Number of fragments cached in this track*/
518  const char* name; /**< Track name used for debugging*/
519  double fragmentDurationSeconds; /**< duration in seconds for current fragment-of-interest */
520  int segDLFailCount; /**< Segment download fail count*/
521  int segDrmDecryptFailCount; /**< Segment decryption failure count*/
522  int mSegInjectFailCount; /**< Segment Inject/Decode fail count */
523  TrackType type; /**< Media type of the track*/
524  std::unique_ptr<SubtitleParser> mSubtitleParser; /**< Parser for subtitle data*/
525  bool refreshSubtitles; /**< Switch subtitle track in the FetchLoop */
526  int maxCachedFragmentsPerTrack;
527  int maxCachedFragmentChunksPerTrack;
528  pthread_cond_t fragmentChunkFetched;/**< Signaled after a fragment Chunk is fetched*/
529  uint32_t totalMdatCount; /**< Total MDAT Chunk Found*/
530  int noMDATCount; /**< MDAT Chunk Not Found count continuously while chunk buffer processoing*/
531 
532 protected:
533  AampLogManager *mLogObj;
534  PrivateInstanceAAMP* aamp; /**< Pointer to the PrivateInstanceAAMP*/
535  CachedFragment *cachedFragment; /**< storage for currently-downloaded fragment */
537  GrowableBuffer unparsedBufferChunk; /**< Buffer to keep fragment content */
538  GrowableBuffer parsedBufferChunk; /**< Buffer to keep fragment content */
539  bool abort; /**< Abort all operations if flag is set*/
540  pthread_mutex_t mutex; /**< protection of track variables accessed from multiple threads */
541  bool ptsError; /**< flag to indicate if last injected fragment has ptsError */
542  bool abortInject; /**< Abort inject operations if flag is set*/
543  bool abortInjectChunk; /**< Abort inject operations if flag is set*/
544 
545 private:
546  pthread_cond_t fragmentFetched; /**< Signaled after a fragment is fetched*/
547  pthread_cond_t fragmentInjected; /**< Signaled after a fragment is injected*/
548  pthread_t fragmentInjectorThreadID; /**< Fragment injector thread id*/
549  pthread_cond_t fragmentChunkInjected; /**< Signaled after a fragment is injected*/
550  pthread_t fragmentChunkInjectorThreadID;/**< Fragment injector thread id*/
551  pthread_t bufferMonitorThreadID; /**< Buffer Monitor thread id */
552  int totalFragmentsDownloaded; /**< Total fragments downloaded since start by track*/
553  int totalFragmentChunksDownloaded; /**< Total fragments downloaded since start by track*/
554  bool fragmentInjectorThreadStarted; /**< Fragment injector's thread started or not*/
555  bool fragmentChunkInjectorThreadStarted;/**< Fragment Chunk injector's thread started or not*/
556  bool bufferMonitorThreadStarted; /**< Buffer Monitor thread started or not */
557  double totalInjectedDuration; /**< Total fragment injected duration*/
558  double totalInjectedChunksDuration; /**< Total fragment injected chunk duration*/
559  int currentInitialCacheDurationSeconds; /**< Current cached fragments duration before playing*/
560  bool sinkBufferIsFull; /**< True if sink buffer is full and do not want new fragments*/
561  bool cachingCompleted; /**< Fragment caching completed or not*/
562  int fragmentIdxToInject; /**< Write position */
563  int fragmentChunkIdxToInject; /**< Write position */
564  int fragmentIdxToFetch; /**< Read position */
565  int fragmentChunkIdxToFetch; /**< Read position */
566  int bandwidthBitsPerSecond; /**< Bandwidth of last selected profile*/
567  double totalFetchedDuration; /**< Total fragment fetched duration*/
568  bool discontinuityProcessed;
569  BufferHealthStatus bufferStatus; /**< Buffer status of the track*/
570  BufferHealthStatus prevBufferStatus; /**< Previous buffer status of the track*/
571  long long prevDownloadStartTime; /**< Previous file download Start time*/
572 };
573 
574 /**
575  * @brief StreamAbstraction class of AAMP
576  */
578 {
579 public:
580  /**
581  * @fn StreamAbstractionAAMP
582  * @param[in] aamp pointer to PrivateInstanceAAMP object associated with stream
583  */
585 
586  /**
587  * @fn ~StreamAbstractionAAMP
588  */
589  virtual ~StreamAbstractionAAMP();
590 
591  /**
592  * @brief StreamAbstractionAAMP Copy Constructor
593  */
595 
596  /**
597  * @brief StreamAbstractionAAMP assignment operator overloading
598  */
600 
601  /**
602  * @brief Dump profiles for debugging.
603  * To be implemented by sub classes
604  *
605  * @return void
606  */
607  virtual void DumpProfiles(void) = 0;
608 
609  /**
610  * @brief Initialize a newly created object.
611  * To be implemented by sub classes
612  *
613  * @param[in] tuneType - to set type of playback.
614  * @return true on success, false failure
615  */
616  virtual AAMPStatusType Init(TuneType tuneType) = 0;
617 
618  /**
619  * @brief Start streaming.
620  *
621  * @return void
622  */
623  virtual void Start() = 0;
624 
625  /**
626  * @brief Stops streaming.
627  *
628  * @param[in] clearChannelData - clear channel /drm data on stop.
629  * @return void
630  */
631  virtual void Stop(bool clearChannelData) = 0;
632 
633  /**
634  * @brief Get output format of stream.
635  *
636  * @param[out] primaryOutputFormat - format of primary track
637  * @param[out] audioOutputFormat - format of audio track
638  * @param[out] auxAudioOutputFormat - format of aux audio track
639  * @return void
640  */
641  virtual void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxAudioOutputFormat, StreamOutputFormat &subtitleOutputFormat) = 0;
642 
643  /**
644  * @brief Get current stream position.
645  *
646  * @return current position of stream.
647  */
648  virtual double GetStreamPosition() = 0;
649  /**
650  * @brief Get PTS of first sample.
651  *
652  * @return PTS of first sample
653  */
654  virtual double GetFirstPTS() = 0;
655  /**
656  * @brief Get Start time PTS of first sample.
657  *
658  * @retval start time of first sample
659  */
660  virtual double GetStartTimeOfFirstPTS() = 0;
661 
662  /**
663  * @brief Return MediaTrack of requested type
664  *
665  * @param[in] type - track type
666  * @return MediaTrack pointer.
667  */
668  virtual MediaTrack* GetMediaTrack(TrackType type) = 0;
669 
670  /**
671  * @brief Waits audio track injection until caught up with video track.
672  * Used internally by injection logic
673  *
674  * @param None
675  * @return void
676  */
678 
679  /**
680  * @fn ReassessAndResumeAudioTrack
681  *
682  * @return void
683  */
684  void ReassessAndResumeAudioTrack(bool abort);
685 
686  /**
687  * @brief When TSB is involved, use this to set bandwidth to be reported.
688  *
689  * @param[in] tsbBandwidth - Bandwidth of the track.
690  * @return void
691  */
692  void SetTsbBandwidth(long tsbBandwidth){ mTsbBandwidth = tsbBandwidth;}
693 
694  /**
695  * @brief When TSB is involved, use this to get bandwidth to be reported.
696  *
697  * @return Bandwidth of the track.
698  */
699  long GetTsbBandwidth() { return mTsbBandwidth ;}
700 
701  /**
702  * @brief Set elementary stream type change status for reconfigure the pipeline.
703  *
704  * @return void
705  */
707 
708  /**
709  * @brief Reset elementary stream type change status once the pipeline reconfigured.
710  *
711  * @return void
712  */
715  {
716  mESChangeStatus = false;
717  }
718  }
719 
720  /**
721  * @brief Get elementary stream type change status for reconfigure the pipeline..
722  *
723  * @retval mESChangeStatus flag value ( true or false )
724  */
725  bool GetESChangeStatus(void){ return mESChangeStatus;}
726 
727  PrivateInstanceAAMP* aamp; /**< Pointer to PrivateInstanceAAMP object associated with stream*/
728 
729  AampLogManager *mLogObj;
730  /**
731  * @fn RampDownProfile
732  *
733  * @param[in] http_error - Http error code
734  * @return True, if ramp down successful. Else false
735  */
736  bool RampDownProfile(long http_error);
737  /**
738  * @fn GetDesiredProfileOnBuffer
739  *
740  * @param [in] currProfileIndex
741  * @param [in] newProfileIndex
742  * @return None.
743  */
744  void GetDesiredProfileOnBuffer(int currProfileIndex, int &newProfileIndex);
745  /**
746  * @fn GetDesiredProfileOnSteadyState
747  *
748  * @param [in] currProfileIndex
749  * @param [in] newProfileIndex
750  * @param [in] nwBandwidth
751  * @return None.
752  */
753  void GetDesiredProfileOnSteadyState(int currProfileIndex, int &newProfileIndex, long nwBandwidth);
754  /**
755  * @fn ConfigureTimeoutOnBuffer
756  *
757  * @return None.
758  */
760  /**
761  * @brief Function to get the buffer duration of stream
762  *
763  * @return buffer value
764  */
765  virtual double GetBufferedDuration (void) = 0;
766 
767  /**
768  * @fn IsLowestProfile
769  *
770  * @param currentProfileIndex - current profile index to be checked.
771  * @return true if the given profile index is lowest.
772  */
774 
775  /**
776  * @fn getOriginalCurlError
777  *
778  * @param[in] http_error - Error code
779  * @return error code
780  */
781  long getOriginalCurlError(long http_error);
782 
783  /**
784  * @fn CheckForRampDownProfile
785  *
786  * @param http_error - Http error code
787  * @return true if rampdown needed in the case of fragment not available in higher profile.
788  */
789  bool CheckForRampDownProfile(long http_error);
790 
791  /**
792  * @fn CheckForProfileChange
793  *
794  * @return void
795  */
796  void CheckForProfileChange(void);
797 
798  /**
799  * @fn GetIframeTrack
800  *
801  * @return iframe track index.
802  */
803  int GetIframeTrack();
804 
805  /**
806  * @fn UpdateIframeTracks
807  *
808  * @return void
809  */
810  void UpdateIframeTracks();
811 
812  /**
813  * @fn LastVideoFragParsedTimeMS
814  *
815  * @return Last video fragment parsed time.
816  */
817  double LastVideoFragParsedTimeMS(void);
818 
819  /**
820  * @fn GetDesiredProfile
821  *
822  * @param getMidProfile - Get the middle profile(True/False)
823  * @return profile index to be used for the track.
824  */
825  int GetDesiredProfile(bool getMidProfile);
826 
827  /**
828  * @fn UpdateRampdownProfileReason
829  *
830  * @return void
831  */
832  void UpdateRampdownProfileReason(void);
833 
834  /**
835  * @fn NotifyBitRateUpdate
836  * Used internally by injection logic
837  *
838  * @param[in] profileIndex - profile index of last injected fragment.
839  * @param[in] cacheFragStreamInfo - stream info for the last injected fragment.
840  * @return void
841  */
842  void NotifyBitRateUpdate(int profileIndex, const StreamInfo &cacheFragStreamInfo, double position);
843 
844  /**
845  * @fn IsInitialCachingSupported
846  *
847  * @return true if is supported
848  */
849  virtual bool IsInitialCachingSupported();
850 
851  /**
852  * @brief Whether we are playing at live point or not.
853  *
854  * @return true if we are at live point.
855  */
857 
858  /**
859  * @fn Is4KStream
860  * @brief check if current stream have 4K content
861  * @param height - resolution of 4K stream if found
862  * @param bandwidth - bandwidth of 4K stream if foudd
863  * @return true on success
864  */
865  virtual bool Is4KStream(int &height, long &bandwidth) = 0;
866 
867  /**
868  * @fn GetPreferredLiveOffsetFromConfig
869  * @brief Set the offset value Live object
870  * @return none
871  */
872  virtual bool GetPreferredLiveOffsetFromConfig();
873 
874  /**
875  * @fn NotifyPlaybackPaused
876  *
877  * @param[in] paused - true, if playback was paused
878  * @return void
879  */
880  virtual void NotifyPlaybackPaused(bool paused);
881 
882  /**
883  * @fn CheckIfPlayerRunningDry
884  *
885  * @return true if player caches are dry, false otherwise.
886  */
887  bool CheckIfPlayerRunningDry(void);
888 
889  /**
890  * @fn CheckForPlaybackStall
891  *
892  * @param[in] fragmentParsed - true if next fragment was parsed, otherwise false
893  */
894  void CheckForPlaybackStall(bool fragmentParsed);
895 
896  /**
897  * @fn NotifyFirstFragmentInjected
898  * @return void
899  */
900  void NotifyFirstFragmentInjected(void);
901 
902  /**
903  * @fn GetElapsedTime
904  *
905  * @return elapsed time.
906  */
907  double GetElapsedTime();
908 
909  virtual double GetFirstPeriodStartTime() { return 0; }
910  virtual double GetFirstPeriodDynamicStartTime() { return 0; }
911  virtual uint32_t GetCurrPeriodTimeScale() { return 0; }
912  /**
913  * @fn CheckForRampDownLimitReached
914  * @return true if limit reached, false otherwise
915  */
917  bool trickplayMode; /**< trick play flag to be updated by subclasses*/
918  int currentProfileIndex; /**< current Video profile index of the track*/
919  int currentAudioProfileIndex; /**< current Audio profile index of the track*/
920  int currentTextTrackProfileIndex; /**< current SubTitle profile index of the track*/
921  int profileIdxForBandwidthNotification; /**< internal - profile index for bandwidth change notification*/
922  bool hasDrm; /**< denotes if the current asset is DRM protected*/
923 
924  bool mIsAtLivePoint; /**< flag that denotes if playback is at live point*/
925 
926  bool mIsPlaybackStalled; /**< flag that denotes if playback was stalled or not*/
927  bool mNetworkDownDetected; /**< Network down status indicator */
928  bool mCheckForRampdown; /**< flag to indicate if rampdown is attempted or not */
929  TuneType mTuneType; /**< Tune type of current playback, initialize by derived classes on Init()*/
930  int mRampDownCount; /**< Total number of rampdowns */
931  double mProgramStartTime; /**< Indicate program start time or availability start time */
932  int mTsbMaxBitrateProfileIndex; /**< Indicates the index of highest profile in the saved stream info */
933 
934 
935  /**
936  * @brief Get profile index of highest bandwidth
937  *
938  * @return Profile index
939  */
940  int GetMaxBWProfile();
941 
942  /**
943  * @brief Get profile index of given bandwidth.
944  *
945  * @param[in] bandwidth - Bandwidth
946  * @return Profile index
947  */
948  virtual int GetBWIndex(long bandwidth) = 0;
949 
950  /**
951  * @brief Get the ABRManager reference.
952  *
953  * @return The ABRManager reference.
954  */
955  ABRManager& GetABRManager() {
956  return aamp->mhAbrManager;
957  }
958 
959  /**
960  * @brief Get number of profiles/ representations from subclass.
961  *
962  * @return number of profiles.
963  */
964  virtual int GetProfileCount() {
965  return aamp->mhAbrManager.getProfileCount();
966  }
967 
968  /**
969  * @brief Get profile index for TsbBandwidth
970  * @param mTsbBandwidth - bandwidth to identify profile index from list
971  * @retval profile index of the current bandwidth
972  */
974  return aamp->mhAbrManager.getBestMatchedProfileIndexByBandWidth(mTsbBandwidth);
975  }
976 
977  long GetCurProfIdxBW(){
978  return aamp->mhAbrManager.getBandwidthOfProfile(this->currentProfileIndex);
979  }
980 
981 
982  /**
983  * @brief Gets Max bitrate supported
984  *
985  * @return max bandwidth
986  */
987  virtual long GetMaxBitrate(){
988  return aamp->mhAbrManager.getBandwidthOfProfile(aamp->mhAbrManager.getMaxBandwidthProfile());
989  }
990 
991  /**
992  * @fn GetVideoBitrate
993  *
994  * @return bitrate of current video profile.
995  */
996  long GetVideoBitrate(void);
997 
998  /**
999  * @fn GetAudioBitrate
1000  *
1001  * @return bitrate of current audio profile.
1002  */
1003  long GetAudioBitrate(void);
1004 
1005  /**
1006  * @brief Set a preferred bitrate for video.
1007  *
1008  * @param[in] bitrate preferred bitrate.
1009  */
1010  void SetVideoBitrate(long bitrate);
1011 
1012  /**
1013  * @brief Get available video bitrates.
1014  *
1015  * @return available video bitrates.
1016  */
1017  virtual std::vector<long> GetVideoBitrates(void) = 0;
1018 
1019  /**
1020  * @brief Get available audio bitrates.
1021  *
1022  * @return available audio bitrates.
1023  */
1024  virtual std::vector<long> GetAudioBitrates(void) = 0;
1025 
1026  /**
1027  * @brief Check if playback stalled in fragment collector side.
1028  *
1029  * @return true if stalled, false otherwise.
1030  */
1031  bool IsStreamerStalled(void) { return mIsPlaybackStalled; }
1032 
1033  /**
1034  * @brief Stop injection of fragments.
1035  */
1036  virtual void StopInjection(void) = 0;
1037 
1038  /**
1039  * @brief Start injection of fragments.
1040  */
1041  virtual void StartInjection(void) = 0;
1042 
1043  /**
1044  * @fn IsMuxedStream
1045  *
1046  * @return true if current stream is muxed
1047  */
1048  bool IsMuxedStream();
1049 
1050  /**
1051  * @brief Receives first video PTS for the current playback
1052  *
1053  * @param[in] pts - pts value
1054  * @param[in] timeScale - time scale value
1055  */
1056  virtual void NotifyFirstVideoPTS(unsigned long long pts, unsigned long timeScale) { };
1057 
1058  /**
1059  * @brief Kicks off subtitle display - sent at start of video presentation
1060  *
1061  */
1062  virtual void StartSubtitleParser() { };
1063 
1064  /**
1065  * @brief Pause/unpause subtitles
1066  *
1067  * @param pause - enable or disable pause
1068  * @return void
1069  */
1070  virtual void PauseSubtitleParser(bool pause) { };
1071 
1072  /**
1073  * @fn WaitForAudioTrackCatchup
1074  *
1075  * @return void
1076  */
1077  void WaitForAudioTrackCatchup(void);
1078 
1079  /**
1080  * @fn AbortWaitForAudioTrackCatchup
1081  *
1082  * @return void
1083  */
1084  void AbortWaitForAudioTrackCatchup(bool force);
1085 
1086  /**
1087  * @brief Set Client Side DAI object instance
1088  *
1089  * @param[in] cdaiObj - Pointer to Client Side DAI object.
1090  */
1091  virtual void SetCDAIObject(CDAIObject *cdaiObj) {};
1092 
1093  /**
1094  * @fn IsEOSReached
1095  *
1096  * @return true if end of stream reached, false otherwise
1097  */
1098  virtual bool IsEOSReached();
1099 
1100  /**
1101  * @brief Get available audio tracks.
1102  *
1103  * @return std::vector<AudioTrackInfo> list of audio tracks
1104  */
1105  virtual std::vector<AudioTrackInfo> &GetAvailableAudioTracks(bool allTrack = false) { return mAudioTracks; };
1106 
1107  /**
1108  * @brief Get available text tracks.
1109  *
1110  * @return std::vector<TextTrackInfo> list of text tracks
1111  */
1112  virtual std::vector<TextTrackInfo> &GetAvailableTextTracks(bool allTrack = false) { return mTextTracks; };
1113 
1114  /**
1115  * @brief Update seek position when player is initialized
1116  *
1117  * @param[in] secondsRelativeToTuneTime seekposition time.
1118  */
1119  virtual void SeekPosUpdate(double secondsRelativeToTuneTime) = 0;
1120 
1121  /**
1122  * @fn GetLastInjectedFragmentPosition
1123  *
1124  * @return double last injected fragment position in seconds
1125  */
1127 
1128  /**
1129  * @fn ProcessDiscontinuity
1130  *
1131  * @param[in] type - track type.
1132  */
1133  bool ProcessDiscontinuity(TrackType type);
1134 
1135  /**
1136  * @fn AbortWaitForDiscontinuity
1137  * @return void
1138  */
1140 
1141  /**
1142  * @fn CheckForMediaTrackInjectionStall
1143  *
1144  * @param[in] type - track type.
1145  */
1147 
1148  /**
1149  * @fn GetBufferedVideoDurationSec
1150  *
1151  * @return duration of currently buffered video in seconds
1152  */
1153  double GetBufferedVideoDurationSec();
1154 
1155  /**
1156  * @fn UpdateStreamInfoBitrateData
1157  *
1158  * @param[in] profileIndex - profile index of current fetched fragment
1159  * @param[out] cacheFragStreamInfo - stream info of current fetched fragment
1160  */
1161  void UpdateStreamInfoBitrateData(int profileIndex, StreamInfo &cacheFragStreamInfo);
1162 
1163  /**
1164  * @fn GetAudioTrack
1165  *
1166  * @return int - index of current audio track
1167  */
1168  virtual int GetAudioTrack();
1169 
1170  /**
1171  * @fn GetCurrentAudioTrack
1172  *
1173  * @param[out] audioTrack - current audio track
1174  * @return found or not
1175  */
1176  virtual bool GetCurrentAudioTrack(AudioTrackInfo &audioTrack);
1177 
1178  /**
1179  * @fn GetCurrentTextTrack
1180  *
1181  * @param[out] TextTrack - current text track
1182  * @return found or not
1183  */
1184  virtual bool GetCurrentTextTrack(TextTrackInfo &textTrack);
1185 
1186  /**
1187  * @fn GetTextTrack
1188  *
1189  * @return int - index of current text track
1190  */
1191  int GetTextTrack();
1192 
1193  /**
1194  * @fn RefreshSubtitles
1195  *
1196  * @return void
1197  */
1198  void RefreshSubtitles();
1199 
1200  /**
1201  * @brief setVideoRectangle sets the position coordinates (x,y) & size (w,h) for OTA streams only
1202  *
1203  * @param[in] x,y - position coordinates of video rectangle
1204  * @param[in] w,h - width & height of video rectangle
1205  */
1206  virtual void SetVideoRectangle(int x, int y, int w, int h) {}
1207 
1208  virtual std::vector<StreamInfo*> GetAvailableVideoTracks(void) = 0;
1209 
1210  /**
1211  * @brief Get available thumbnail bitrates.
1212  *
1213  * @return available thumbnail bitrates.
1214  */
1215  virtual std::vector<StreamInfo*> GetAvailableThumbnailTracks(void) = 0;
1216 
1217  /**
1218  * @brief Set thumbnail bitrate.
1219  *
1220  * @return none.
1221  */
1222  virtual bool SetThumbnailTrack(int) = 0;
1223 
1224  /**
1225  * @brief Get thumbnail data for duration value.
1226  *
1227  * @return thumbnail data.
1228  */
1229  virtual std::vector<ThumbnailData> GetThumbnailRangeData(double, double, std::string*, int*, int*, int*, int*) = 0;
1230 
1231  /**
1232  * @brief SetAudioTrack set the audio track using index value. [currently for OTA]
1233  *
1234  * @param[in] index - Index of audio track
1235  * @return void
1236  */
1237  virtual void SetAudioTrack (int index) {}
1238 
1239  /**
1240  * @brief SetAudioTrackByLanguage set the audio language. [currently for OTA]
1241  *
1242  * @param[in] lang Language to be set
1243  * @param[in]
1244  */
1245  virtual void SetAudioTrackByLanguage(const char* lang) {}
1246 
1247  /**
1248  * @brief SetPreferredAudioLanguages set the preferred audio languages and rendition. [currently for OTA]
1249  *
1250  * @param[in]
1251  * @param[in]
1252  */
1253  virtual void SetPreferredAudioLanguages() {}
1254 
1255  /**
1256  * @fn MuteSubtitles
1257  *
1258  * @param[in] mute mute/unmute
1259  */
1260  void MuteSubtitles(bool mute);
1261 
1262  /**
1263  * @fn WaitForVideoTrackCatchupForAux
1264  *
1265  * @return void
1266  */
1268 
1269  /**
1270  * @brief Set Content Restrictions
1271  * @param[in] restrictions - restrictions to be applied
1272  *
1273  * @return void
1274  */
1275  virtual void ApplyContentRestrictions(std::vector<std::string> restrictions){};
1276 
1277 
1278  /**
1279  * @brief Disable Content Restrictions - unlock
1280  * @param[in] grace - seconds from current time, grace period, grace = -1 will allow an unlimited grace period
1281  * @param[in] time - seconds from current time,time till which the channel need to be kept unlocked
1282  * @param[in] eventChange - disable restriction handling till next program event boundary
1283  * @return void
1284  */
1285  virtual void DisableContentRestrictions(long grace, long time, bool eventChange){};
1286 
1287  /**
1288  * @brief Enable Content Restrictions - lock
1289  * @return void
1290  */
1291  virtual void EnableContentRestrictions(){};
1292 
1293  /**
1294  * @brief Get audio forward to aux pipeline status
1295  *
1296  * @return bool true if audio buffers are to be forwarded
1297  */
1299 
1300  /**
1301  * @brief Set audio forward to aux pipeline status
1302  *
1303  * @param[in] status - enabled/disabled
1304  * @return void
1305  */
1306  void SetAudioFwdToAuxStatus(bool status) { mFwdAudioToAux = status; }
1307 
1308  /**
1309  * @brief Set AudioTrack info from Muxed stream
1310  *
1311  * @param[in] string index
1312  * @return void
1313  */
1314  virtual void SetAudioTrackInfoFromMuxedStream(std::vector<AudioTrackInfo>& vector);
1315 
1316  /**
1317  * @brief Set current audio track index
1318  *
1319  * @param[in] string index
1320  * @return void
1321  */
1322  void SetCurrentAudioTrackIndex(std::string& index) { mAudioTrackIndex = index; }
1323 
1324  /**
1325  * @brief Change muxed audio track index
1326  *
1327  * @param[in] string index
1328  * @return void
1329  */
1330  virtual void ChangeMuxedAudioTrackIndex(std::string& index){};
1331 
1332  //Apis for sidecar caption support
1333 
1334  /**
1335  * @brief Initilaize subtitle parser for sidecar support
1336  *
1337  * @param data - subtitle data received from application
1338  * @return void
1339  */
1340  virtual void InitSubtitleParser(char *data) { };
1341 
1342  /**
1343  * @brief reset subtitle parser created for sidecar support
1344  *
1345  * @return void
1346  */
1347  virtual void ResetSubtitle() { };
1348 
1349  /**
1350  * @brief mute subtitles on pause
1351  *
1352  * @return void
1353  */
1354  virtual void MuteSubtitleOnPause() { };
1355 
1356  /**
1357  * @brief resume subtitles on play
1358  *
1359  * @param mute - mute status
1360  * @param data - subtitle data received from application
1361  * @return void
1362  */
1363  virtual void ResumeSubtitleOnPlay(bool mute, char *data) { };
1364 
1365  /**
1366  * @brief mute/unmute sidecar subtitles
1367  * @param mute - mute/unmute
1368  *
1369  * @return void
1370  */
1371  virtual void MuteSidecarSubtitles(bool mute) { };
1372 
1373  /**
1374  * @brief resume subtitles after trickplay
1375  *
1376  * @param mute - mute status
1377  * @param data - subtitle data received from application
1378  * @return void
1379  */
1380  virtual void ResumeSubtitleAfterSeek(bool mute, char *data) { };
1381 
1382  /**
1383  * @fn SetTextStyle
1384  * @brief Set the text style of the subtitle to the options passed
1385  * @param[in] options - reference to the Json string that contains the information
1386  * @return - true indicating successful operation in passing options to the parser
1387  */
1388  virtual bool SetTextStyle(const std::string &options);
1389 
1390 protected:
1391  /**
1392  * @brief Get stream information of a profile from subclass.
1393  *
1394  * @param[in] idx - profile index.
1395  * @return stream information corresponding to index.
1396  */
1397  virtual StreamInfo* GetStreamInfo(int idx) = 0;
1398 
1399 private:
1400 
1401  /**
1402  * @fn GetDesiredProfileBasedOnCache
1403  *
1404  * @return Profile index based on cached duration
1405  */
1407 
1408  /**
1409  * @fn UpdateProfileBasedOnFragmentDownloaded
1410  *
1411  * @return void
1412  */
1414 
1415  /**
1416  * @fn UpdateProfileBasedOnFragmentCache
1417  *
1418  * @return true if profile was changed, false otherwise
1419  */
1421 
1422  pthread_mutex_t mLock; /**< lock for A/V track catchup logic*/
1423  pthread_cond_t mCond; /**< condition for A/V track catchup logic*/
1424  pthread_cond_t mSubCond; /**< condition for Audio/Subtitle track catchup logic*/
1425  pthread_cond_t mAuxCond; /**< condition for Aux and video track catchup logic*/
1426 
1427  // abr variables
1428  long mCurrentBandwidth; /**< stores current bandwidth*/
1429  int mLastVideoFragCheckedforABR; /**< Last video fragment for which ABR is checked*/
1430  long mTsbBandwidth; /**< stores bandwidth when TSB is involved*/
1431  long mNwConsistencyBypass; /**< Network consistency bypass**/
1432  int mABRHighBufferCounter; /**< ABR High buffer counter */
1433  int mABRLowBufferCounter; /**< ABR Low Buffer counter */
1434  int mMaxBufferCountCheck;
1435  int mABRMaxBuffer; /**< ABR ramp up buffer*/
1436  int mABRCacheLength; /**< ABR cache length*/
1437  int mABRMinBuffer; /**< ABR ramp down buffer*/
1438  int mABRNwConsistency; /**< ABR Network consistency*/
1439  bool mESChangeStatus; /**< flag value which is used to call pipeline configuration if the audio type changed in mid stream */
1440  unsigned int mAudiostateChangeCount;/**< variable to know how many times player need to reconfigure the pipeline for audio type change*/
1441  double mLastVideoFragParsedTimeMS; /**< timestamp when last video fragment was parsed */
1442 
1443  bool mIsPaused; /**< paused state or not */
1444  long long mTotalPausedDurationMS; /**< Total duration for which stream is paused */
1445  long long mStartTimeStamp; /**< stores timestamp at which injection starts */
1446  long long mLastPausedTimeStamp; /**< stores timestamp of last pause operation */
1447  pthread_mutex_t mStateLock; /**< lock for A/V track discontinuity injection*/
1448  pthread_cond_t mStateCond; /**< condition for A/V track discontinuity injection*/
1449  int mRampDownLimit; /**< stores ramp down limit value */
1450  BitrateChangeReason mBitrateReason; /**< holds the reason for last bitrate change */
1451 protected:
1452  std::vector<AudioTrackInfo> mAudioTracks; /**< Available audio tracks */
1453  std::vector<AudioTrackInfo> mAudioTracksAll; /**< Alternative variable to store audio track information from all period */
1454  std::vector<TextTrackInfo> mTextTracksAll; /**< Alternative variable to store text track information from all period */
1455  std::vector<TextTrackInfo> mTextTracks; /**< Available text tracks */
1456  MediaTrackDiscontinuityState mTrackState; /**< stores the discontinuity status of tracks*/
1457  std::string mAudioTrackIndex; /**< Current audio track index in track list */
1458  std::string mTextTrackIndex; /**< Current text track index in track list */
1459  bool mFwdAudioToAux; /**< If audio buffers are to be forwarded to auxiliary pipeline, happens if both are playing same language */
1460 };
1461 
1462 #endif // STREAMABSTRACTIONAAMP_H
subtitleParser.h
This file provides interfaces for a subtitle parser in AAMP.
StreamAbstractionAAMP::mTsbBandwidth
long mTsbBandwidth
Definition: StreamAbstractionAAMP.h:1430
MediaTrack::SetCurrentBandWidth
void SetCurrentBandWidth(int bandwidthBps)
Set current bandwidth of track.
Definition: streamabstraction.cpp:1361
StreamAbstractionAAMP::IsLowestProfile
bool IsLowestProfile(int currentProfileIndex)
Check whether the current profile is lowest.
Definition: streamabstraction.cpp:2097
StreamAbstractionAAMP::EnableContentRestrictions
virtual void EnableContentRestrictions()
Enable Content Restrictions - lock.
Definition: StreamAbstractionAAMP.h:1291
StreamAbstractionAAMP::mRampDownLimit
int mRampDownLimit
Definition: StreamAbstractionAAMP.h:1449
StreamInfo::codecs
const char * codecs
Definition: StreamAbstractionAAMP.h:74
DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK
#define DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK
Definition: AampDefine.h:146
StreamAbstractionAAMP::GetMediaTrack
virtual MediaTrack * GetMediaTrack(TrackType type)=0
Return MediaTrack of requested type.
StreamAbstractionAAMP::GetPreferredLiveOffsetFromConfig
virtual bool GetPreferredLiveOffsetFromConfig()
Set the offset value Live object.
Definition: streamabstraction.cpp:3115
CachedFragmentChunk::fragmentChunk
GrowableBuffer fragmentChunk
Definition: StreamAbstractionAAMP.h:120
StreamAbstractionAAMP::SetAudioTrackByLanguage
virtual void SetAudioTrackByLanguage(const char *lang)
SetAudioTrackByLanguage set the audio language. [currently for OTA].
Definition: StreamAbstractionAAMP.h:1245
StreamOutputFormat
StreamOutputFormat
Media output format.
Definition: main_aamp.h:106
MediaTrack::segDrmDecryptFailCount
int segDrmDecryptFailCount
Definition: StreamAbstractionAAMP.h:521
StreamAbstractionAAMP::SetAudioTrackInfoFromMuxedStream
virtual void SetAudioTrackInfoFromMuxedStream(std::vector< AudioTrackInfo > &vector)
Set AudioTrack info from Muxed stream.
Definition: streamabstraction.cpp:2460
MediaTrack::GetProfileIndexForBW
int GetProfileIndexForBW(long mTsbBandwidth)
Get profile index for TsbBandwidth.
Definition: streamabstraction.cpp:1369
StreamInfo
Structure holding the information of a stream.
Definition: StreamAbstractionAAMP.h:69
StreamAbstractionAAMP::mAudiostateChangeCount
unsigned int mAudiostateChangeCount
Definition: StreamAbstractionAAMP.h:1440
StreamAbstractionAAMP::mSubCond
pthread_cond_t mSubCond
Definition: StreamAbstractionAAMP.h:1424
StreamAbstractionAAMP::GetBufferedVideoDurationSec
double GetBufferedVideoDurationSec()
Get buffered video duration in seconds.
Definition: streamabstraction.cpp:2960
CachedFragmentChunk::downloadStartTime
long long downloadStartTime
Definition: StreamAbstractionAAMP.h:122
eTRACK_VIDEO
@ eTRACK_VIDEO
Definition: StreamAbstractionAAMP.h:50
MediaTrack::eosReached
bool eosReached
Definition: StreamAbstractionAAMP.h:514
MediaTrack::fragmentIdxToInject
int fragmentIdxToInject
Definition: StreamAbstractionAAMP.h:562
MediaTrack::sinkBufferIsFull
bool sinkBufferIsFull
Definition: StreamAbstractionAAMP.h:560
StreamAbstractionAAMP::GetDesiredProfileBasedOnCache
int GetDesiredProfileBasedOnCache(void)
Get desired profile based on cached duration.
Definition: streamabstraction.cpp:1954
MediaTrack::fragmentDurationSeconds
double fragmentDurationSeconds
Definition: StreamAbstractionAAMP.h:519
StreamAbstractionAAMP::SetCDAIObject
virtual void SetCDAIObject(CDAIObject *cdaiObj)
Set Client Side DAI object instance.
Definition: StreamAbstractionAAMP.h:1091
StreamAbstractionAAMP::LastVideoFragParsedTimeMS
double LastVideoFragParsedTimeMS(void)
Get the last video fragment parsed time.
Definition: streamabstraction.cpp:1673
CachedFragment::initFragment
bool initFragment
Definition: StreamAbstractionAAMP.h:104
StreamAbstractionAAMP::GetESChangeStatus
bool GetESChangeStatus(void)
Get elementary stream type change status for reconfigure the pipeline..
Definition: StreamAbstractionAAMP.h:725
MediaTrack::Enabled
bool Enabled()
Check if a track is enabled.
Definition: streamabstraction.cpp:1307
MediaTrack::UpdateTSAfterChunkInject
void UpdateTSAfterChunkInject()
Update segment cache and inject buffer to gstreamer.
Definition: streamabstraction.cpp:212
MediaTrack::WaitForCachedFragmentChunkInjected
bool WaitForCachedFragmentChunkInjected(int timeoutMs=-1)
Wait until a cached fragment chunk is Injected.
Definition: streamabstraction.cpp:490
StreamAbstractionAAMP::mCond
pthread_cond_t mCond
Definition: StreamAbstractionAAMP.h:1423
StreamAbstractionAAMP::GetAudioFwdToAuxStatus
bool GetAudioFwdToAuxStatus()
Get audio forward to aux pipeline status.
Definition: StreamAbstractionAAMP.h:1298
CachedFragment::duration
double duration
Definition: StreamAbstractionAAMP.h:103
StreamInfo::isIframeTrack
bool isIframeTrack
Definition: StreamAbstractionAAMP.h:72
MediaTrack::GetTotalInjectedChunkDuration
double GetTotalInjectedChunkDuration()
Get total fragment chunk injected duration.
Definition: StreamAbstractionAAMP.h:252
MediaTrack::cachedFragment
CachedFragment * cachedFragment
Definition: StreamAbstractionAAMP.h:535
StreamAbstractionAAMP::Stop
virtual void Stop(bool clearChannelData)=0
Stops streaming.
MediaTrack::ABRProfileChanged
virtual void ABRProfileChanged(void)=0
Notifies profile changes to subclasses.
MediaTrack::abortInject
bool abortInject
Definition: StreamAbstractionAAMP.h:542
StreamAbstractionAAMP::getOriginalCurlError
long getOriginalCurlError(long http_error)
Convert custom curl errors to original.
Definition: streamabstraction.cpp:2119
CachedFragmentChunk::type
MediaType type
Definition: StreamAbstractionAAMP.h:121
StreamAbstractionAAMP::AbortWaitForAudioTrackCatchup
void AbortWaitForAudioTrackCatchup(bool force)
Unblock subtitle track injector if downloads are stopped.
Definition: streamabstraction.cpp:2565
MediaTrack::prevDownloadStartTime
long long prevDownloadStartTime
Definition: StreamAbstractionAAMP.h:571
AudioTrackInfo
Structure for audio track information Holds information about an audio track in playlist.
Definition: main_aamp.h:178
StreamAbstractionAAMP::GetDesiredProfile
int GetDesiredProfile(bool getMidProfile)
Get the desired profile to start fetching.
Definition: streamabstraction.cpp:1681
StreamAbstractionAAMP::UpdateProfileBasedOnFragmentCache
bool UpdateProfileBasedOnFragmentCache(void)
Update profile based on fragment cache.
Definition: streamabstraction.cpp:2295
MediaTrack::fragmentIdxToFetch
int fragmentIdxToFetch
Definition: StreamAbstractionAAMP.h:564
TuneType
TuneType
Tune Typea.
Definition: priv_aamp.h:190
MediaTrack::mSegInjectFailCount
int mSegInjectFailCount
Definition: StreamAbstractionAAMP.h:522
StreamAbstractionAAMP::aamp
PrivateInstanceAAMP * aamp
Definition: StreamAbstractionAAMP.h:727
MediaTrack::fragmentInjectorThreadID
pthread_t fragmentInjectorThreadID
Definition: StreamAbstractionAAMP.h:548
ePLAYLISTTYPE_UNDEFINED
@ ePLAYLISTTYPE_UNDEFINED
Definition: StreamAbstractionAAMP.h:130
StreamAbstractionAAMP::SetTsbBandwidth
void SetTsbBandwidth(long tsbBandwidth)
When TSB is involved, use this to set bandwidth to be reported.
Definition: StreamAbstractionAAMP.h:692
StreamAbstractionAAMP::mABRLowBufferCounter
int mABRLowBufferCounter
Definition: StreamAbstractionAAMP.h:1433
StreamAbstractionAAMP::CheckIfPlayerRunningDry
bool CheckIfPlayerRunningDry(void)
Check if player caches are running dry.
Definition: streamabstraction.cpp:2273
MediaTrack::segDLFailCount
int segDLFailCount
Definition: StreamAbstractionAAMP.h:520
StreamAbstractionAAMP::WaitForAudioTrackCatchup
void WaitForAudioTrackCatchup(void)
Waits subtitle track injection until caught up with muxed/audio track. Used internally by injection l...
Definition: streamabstraction.cpp:2511
StreamAbstractionAAMP::GetAudioTrack
virtual int GetAudioTrack()
Get current audio track.
Definition: streamabstraction.cpp:3017
StreamAbstractionAAMP::IsEOSReached
virtual bool IsEOSReached()
Checks if streamer reached end of stream.
Definition: streamabstraction.cpp:2597
StreamAbstractionAAMP::mAuxCond
pthread_cond_t mAuxCond
Definition: StreamAbstractionAAMP.h:1425
BUFFER_STATUS_RED
@ BUFFER_STATUS_RED
Definition: StreamAbstractionAAMP.h:142
StreamAbstractionAAMP::CheckForMediaTrackInjectionStall
void CheckForMediaTrackInjectionStall(TrackType type)
Function to check if any media tracks are stalled on discontinuity.
Definition: streamabstraction.cpp:2828
StreamAbstractionAAMP::mTextTracks
std::vector< TextTrackInfo > mTextTracks
Definition: StreamAbstractionAAMP.h:1455
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.
StreamAbstractionAAMP::NotifyFirstFragmentInjected
void NotifyFirstFragmentInjected(void)
MediaTracks shall call this to notify first fragment is injected.
Definition: streamabstraction.cpp:2386
MediaTrack::StartInjectChunkLoop
void StartInjectChunkLoop()
Start fragment Chunk injector loop.
Definition: streamabstraction.cpp:1155
StreamAbstractionAAMP::mABRHighBufferCounter
int mABRHighBufferCounter
Definition: StreamAbstractionAAMP.h:1432
StreamAbstractionAAMP::SetCurrentAudioTrackIndex
void SetCurrentAudioTrackIndex(std::string &index)
Set current audio track index.
Definition: StreamAbstractionAAMP.h:1322
StreamAbstractionAAMP::IsStreamerStalled
bool IsStreamerStalled(void)
Check if playback stalled in fragment collector side.
Definition: StreamAbstractionAAMP.h:1031
MediaTrack::SignalTrickModeDiscontinuity
virtual void SignalTrickModeDiscontinuity()
To be implemented by derived classes if discontinuity on trick-play is to be notified.
Definition: StreamAbstractionAAMP.h:503
MediaTrack::StopInjectChunkLoop
void StopInjectChunkLoop()
Stop fragment chunk injector loop of track.
Definition: streamabstraction.cpp:1285
BUFFER_STATUS_GREEN
@ BUFFER_STATUS_GREEN
Definition: StreamAbstractionAAMP.h:140
StreamAbstractionAAMP::WaitForVideoTrackCatchup
void WaitForVideoTrackCatchup()
Waits audio track injection until caught up with video track. Used internally by injection logic.
Definition: streamabstraction.cpp:1561
StreamAbstractionAAMP::mNetworkDownDetected
bool mNetworkDownDetected
Definition: StreamAbstractionAAMP.h:927
StreamAbstractionAAMP::SetTextStyle
virtual bool SetTextStyle(const std::string &options)
Set the text style of the subtitle to the options passed.
Definition: streamabstraction.cpp:3192
MediaTrack::type
TrackType type
Definition: StreamAbstractionAAMP.h:523
StreamAbstractionAAMP::RefreshSubtitles
void RefreshSubtitles()
Refresh subtitle track.
Definition: streamabstraction.cpp:3055
StreamResolution::width
int width
Definition: StreamAbstractionAAMP.h:61
StreamAbstractionAAMP::mIsPlaybackStalled
bool mIsPlaybackStalled
Definition: StreamAbstractionAAMP.h:926
StreamAbstractionAAMP::NotifyFirstVideoPTS
virtual void NotifyFirstVideoPTS(unsigned long long pts, unsigned long timeScale)
Receives first video PTS for the current playback.
Definition: StreamAbstractionAAMP.h:1056
StreamAbstractionAAMP::GetFirstPTS
virtual double GetFirstPTS()=0
Get PTS of first sample.
StreamAbstractionAAMP::mProgramStartTime
double mProgramStartTime
Definition: StreamAbstractionAAMP.h:931
StreamAbstractionAAMP::Start
virtual void Start()=0
Start streaming.
StreamAbstractionAAMP::mLastPausedTimeStamp
long long mLastPausedTimeStamp
Definition: StreamAbstractionAAMP.h:1446
CachedFragmentChunk
Structure of cached fragment data Holds information about a cached fragment.
Definition: StreamAbstractionAAMP.h:118
eDISCONTINUIY_IN_AUDIO
@ eDISCONTINUIY_IN_AUDIO
Definition: StreamAbstractionAAMP.h:152
StreamAbstractionAAMP::ResetSubtitle
virtual void ResetSubtitle()
reset subtitle parser created for sidecar support
Definition: StreamAbstractionAAMP.h:1347
StreamInfo::resolution
StreamResolution resolution
Definition: StreamAbstractionAAMP.h:76
StreamAbstractionAAMP::GetAvailableThumbnailTracks
virtual std::vector< StreamInfo * > GetAvailableThumbnailTracks(void)=0
Get available thumbnail bitrates.
MediaTrack::UpdateTSAfterInject
void UpdateTSAfterInject()
Update segment cache and inject buffer to gstreamer.
Definition: streamabstraction.cpp:185
StreamAbstractionAAMP::mESChangeStatus
bool mESChangeStatus
Definition: StreamAbstractionAAMP.h:1439
eDISCONTIUITY_FREE
@ eDISCONTIUITY_FREE
Definition: StreamAbstractionAAMP.h:150
CachedFragment::discontinuity
bool discontinuity
Definition: StreamAbstractionAAMP.h:105
StreamAbstractionAAMP::mLock
pthread_mutex_t mLock
Definition: StreamAbstractionAAMP.h:1422
StreamAbstractionAAMP::mRampDownCount
int mRampDownCount
Definition: StreamAbstractionAAMP.h:930
MediaTrack::bufferMonitorThreadStarted
bool bufferMonitorThreadStarted
Definition: StreamAbstractionAAMP.h:556
StreamAbstractionAAMP::DumpProfiles
virtual void DumpProfiles(void)=0
Dump profiles for debugging. To be implemented by sub classes.
TileInfo::numCols
int numCols
Definition: StreamAbstractionAAMP.h:87
MediaTrack::GetTotalFragmentsFetched
int GetTotalFragmentsFetched()
Get number of fragments dpownloaded.
Definition: StreamAbstractionAAMP.h:310
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
MediaTrack::fragmentChunkInjectorThreadID
pthread_t fragmentChunkInjectorThreadID
Definition: StreamAbstractionAAMP.h:550
StreamAbstractionAAMP::SetESChangeStatus
void SetESChangeStatus(void)
Set elementary stream type change status for reconfigure the pipeline.
Definition: StreamAbstractionAAMP.h:706
StreamResolution::height
int height
Definition: StreamAbstractionAAMP.h:62
MediaTrack::numberOfFragmentChunksCached
int numberOfFragmentChunksCached
Definition: StreamAbstractionAAMP.h:517
StreamAbstractionAAMP::GetVideoBitrate
long GetVideoBitrate(void)
Get the bitrate of current video profile selected.
Definition: streamabstraction.cpp:2419
StreamAbstractionAAMP::CheckForPlaybackStall
void CheckForPlaybackStall(bool fragmentParsed)
Check if playback has stalled and update related flags.
Definition: streamabstraction.cpp:2339
StreamAbstractionAAMP::IsStreamerAtLivePoint
bool IsStreamerAtLivePoint()
Whether we are playing at live point or not.
Definition: StreamAbstractionAAMP.h:856
StreamAbstractionAAMP::IsInitialCachingSupported
virtual bool IsInitialCachingSupported()
Check if Initial Fragment Caching is supported.
Definition: streamabstraction.cpp:1777
TileInfo
TileInfo structure for Thumbnail data.
Definition: StreamAbstractionAAMP.h:84
MediaTrack::FlushFragmentChunks
void FlushFragmentChunks()
Flushes all cached fragment Chunks.
Definition: streamabstraction.cpp:1405
StreamAbstractionAAMP::mABRMaxBuffer
int mABRMaxBuffer
Definition: StreamAbstractionAAMP.h:1435
StreamAbstractionAAMP::InitSubtitleParser
virtual void InitSubtitleParser(char *data)
Initilaize subtitle parser for sidecar support.
Definition: StreamAbstractionAAMP.h:1340
MediaTrack::refreshSubtitles
bool refreshSubtitles
Definition: StreamAbstractionAAMP.h:525
StreamAbstractionAAMP::ConfigureTimeoutOnBuffer
void ConfigureTimeoutOnBuffer()
Configure download timeouts based on buffer.
Definition: streamabstraction.cpp:1902
StreamAbstractionAAMP::GetDesiredProfileOnBuffer
void GetDesiredProfileOnBuffer(int currProfileIndex, int &newProfileIndex)
Get Desired Profile based on Buffer availability.
Definition: streamabstraction.cpp:1844
StreamAbstractionAAMP::AbortWaitForDiscontinuity
void AbortWaitForDiscontinuity()
Function to abort any wait for discontinuity by injector theads.
Definition: streamabstraction.cpp:2817
StreamAbstractionAAMP::StopInjection
virtual void StopInjection(void)=0
Stop injection of fragments.
StreamAbstractionAAMP::GetTextTrack
int GetTextTrack()
Get current text track.
Definition: streamabstraction.cpp:3036
StreamAbstractionAAMP::GetElapsedTime
double GetElapsedTime()
Get elapsed time of play-back.
Definition: streamabstraction.cpp:2399
MediaTrack::CheckForFutureDiscontinuity
bool CheckForFutureDiscontinuity(double &cacheDuration)
To check for discontinuity in future fragments.
Definition: streamabstraction.cpp:2640
StreamAbstractionAAMP::GetStartTimeOfFirstPTS
virtual double GetStartTimeOfFirstPTS()=0
Get Start time PTS of first sample.
MediaTrack::GetFetchBuffer
CachedFragment * GetFetchBuffer(bool initialize)
Get buffer to store the downloaded fragment content to cache next fragment.
Definition: streamabstraction.cpp:1316
StreamAbstractionAAMP::SetAudioFwdToAuxStatus
void SetAudioFwdToAuxStatus(bool status)
Set audio forward to aux pipeline status.
Definition: StreamAbstractionAAMP.h:1306
MediaTrack::UpdateTSAfterChunkFetch
void UpdateTSAfterChunkFetch()
Updates internal state after a fragment fetch.
Definition: streamabstraction.cpp:324
StreamAbstractionAAMP::ReassessAndResumeAudioTrack
void ReassessAndResumeAudioTrack(bool abort)
Unblock track if caught up with video or downloads are stopped.
Definition: streamabstraction.cpp:1522
StreamAbstractionAAMP::WaitForVideoTrackCatchupForAux
void WaitForVideoTrackCatchupForAux()
Definition: streamabstraction.cpp:3067
StreamAbstractionAAMP::CheckForRampDownProfile
bool CheckForRampDownProfile(long http_error)
Check for ramdown profile.
Definition: streamabstraction.cpp:2143
StreamInfo::enabled
bool enabled
Definition: StreamAbstractionAAMP.h:71
StreamAbstractionAAMP::StartInjection
virtual void StartInjection(void)=0
Start injection of fragments.
MediaTrack
Base Class for Media Track.
Definition: StreamAbstractionAAMP.h:159
StreamAbstractionAAMP::mABRNwConsistency
int mABRNwConsistency
Definition: StreamAbstractionAAMP.h:1438
StreamAbstractionAAMP
StreamAbstraction class of AAMP.
Definition: StreamAbstractionAAMP.h:577
MediaTrack::FlushFragments
void FlushFragments()
Flushes all cached fragments Flushes all media fragments and resets all relevant counters Only intend...
Definition: streamabstraction.cpp:1387
MediaTrack::MediaTrack
MediaTrack(AampLogManager *logObj, TrackType type, PrivateInstanceAAMP *aamp, const char *name)
MediaTrack Constructor.
Definition: streamabstraction.cpp:1432
MediaTrack::WaitForCachedFragmentAvailable
bool WaitForCachedFragmentAvailable()
Wait till cached fragment available.
Definition: streamabstraction.cpp:458
StreamAbstractionAAMP::StreamAbstractionAAMP
StreamAbstractionAAMP(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
StreamAbstractionAAMP constructor.
Definition: streamabstraction.cpp:1606
eTRACK_SUBTITLE
@ eTRACK_SUBTITLE
Definition: StreamAbstractionAAMP.h:52
StreamAbstractionAAMP::GetStreamFormat
virtual void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxAudioOutputFormat, StreamOutputFormat &subtitleOutputFormat)=0
Get output format of stream.
MediaTrack::fragmentChunkInjectorThreadStarted
bool fragmentChunkInjectorThreadStarted
Definition: StreamAbstractionAAMP.h:555
MediaTrack::abortInjectChunk
bool abortInjectChunk
Definition: StreamAbstractionAAMP.h:543
MediaTrack::IsAtEndOfTrack
virtual bool IsAtEndOfTrack()
Returns if the end of track reached.
Definition: StreamAbstractionAAMP.h:405
StreamAbstractionAAMP::GetAudioBitrate
long GetAudioBitrate(void)
Get the bitrate of current audio profile selected.
Definition: streamabstraction.cpp:2428
StreamAbstractionAAMP::ChangeMuxedAudioTrackIndex
virtual void ChangeMuxedAudioTrackIndex(std::string &index)
Change muxed audio track index.
Definition: StreamAbstractionAAMP.h:1330
StreamAbstractionAAMP::PauseSubtitleParser
virtual void PauseSubtitleParser(bool pause)
Pause/unpause subtitles.
Definition: StreamAbstractionAAMP.h:1070
AampMemoryUtils.h
Header file of helper functions for memory management.
MediaTrack::abort
bool abort
Definition: StreamAbstractionAAMP.h:539
MediaTrack::GetBufferStatus
BufferHealthStatus GetBufferStatus()
Get buffer Status of track.
Definition: streamabstraction.cpp:83
StreamAbstractionAAMP::mStateLock
pthread_mutex_t mStateLock
Definition: StreamAbstractionAAMP.h:1447
MediaTrack::fragmentFetched
pthread_cond_t fragmentFetched
Definition: StreamAbstractionAAMP.h:546
CachedFragment::position
double position
Definition: StreamAbstractionAAMP.h:102
TrackType
TrackType
Media Track Types.
Definition: StreamAbstractionAAMP.h:48
MediaTrack::enabled
bool enabled
Definition: StreamAbstractionAAMP.h:515
StreamAbstractionAAMP::SetThumbnailTrack
virtual bool SetThumbnailTrack(int)=0
Set thumbnail bitrate.
StreamAbstractionAAMP::UpdateProfileBasedOnFragmentDownloaded
void UpdateProfileBasedOnFragmentDownloaded(void)
Update profile state based on bandwidth of fragments downloaded.
Definition: streamabstraction.cpp:1805
StreamAbstractionAAMP::mCurrentBandwidth
long mCurrentBandwidth
Definition: StreamAbstractionAAMP.h:1428
StreamAbstractionAAMP::operator=
StreamAbstractionAAMP & operator=(const StreamAbstractionAAMP &)=delete
StreamAbstractionAAMP assignment operator overloading.
TileInfo::posterDuration
double posterDuration
Definition: StreamAbstractionAAMP.h:88
StreamResolution::framerate
double framerate
Definition: StreamAbstractionAAMP.h:63
eTRACK_AUDIO
@ eTRACK_AUDIO
Definition: StreamAbstractionAAMP.h:51
StreamAbstractionAAMP::GetBufferedDuration
virtual double GetBufferedDuration(void)=0
Function to get the buffer duration of stream.
MediaType
MediaType
Media types.
Definition: AampMediaType.h:37
BitrateChangeReason
BitrateChangeReason
Different reasons for bitrate change.
Definition: priv_aamp.h:251
MediaTrack::cachingCompleted
bool cachingCompleted
Definition: StreamAbstractionAAMP.h:561
MediaTrack::mutex
pthread_mutex_t mutex
Definition: StreamAbstractionAAMP.h:540
AampJsonObject.h
File to handle Json format.
StreamAbstractionAAMP::mAudioTracksAll
std::vector< AudioTrackInfo > mAudioTracksAll
Definition: StreamAbstractionAAMP.h:1453
MediaTrack::fragmentInjected
pthread_cond_t fragmentInjected
Definition: StreamAbstractionAAMP.h:547
MediaTrack::fragmentChunkIdxToFetch
int fragmentChunkIdxToFetch
Definition: StreamAbstractionAAMP.h:565
MediaTrackDiscontinuityState
MediaTrackDiscontinuityState
Media Disconutinuity state.
Definition: StreamAbstractionAAMP.h:148
MediaTrack::InjectFragmentInternal
virtual void InjectFragmentInternal(CachedFragment *cachedFragment, bool &fragmentDiscarded)=0
To be implemented by derived classes to receive cached fragment.
StreamAbstractionAAMP::Is4KStream
virtual bool Is4KStream(int &height, long &bandwidth)=0
check if current stream have 4K content
BufferHealthStatus
BufferHealthStatus
Buffer health status.
Definition: StreamAbstractionAAMP.h:138
StreamAbstractionAAMP::ResetESChangeStatus
void ResetESChangeStatus(void)
Reset elementary stream type change status once the pipeline reconfigured.
Definition: StreamAbstractionAAMP.h:713
eTRACK_AUX_AUDIO
@ eTRACK_AUX_AUDIO
Definition: StreamAbstractionAAMP.h:53
StreamResolution
Structure holding the resolution of stream.
Definition: StreamAbstractionAAMP.h:59
StreamAbstractionAAMP::GetProfileCount
virtual int GetProfileCount()
Get number of profiles/ representations from subclass.
Definition: StreamAbstractionAAMP.h:964
MediaTrack::GetTotalFetchedDuration
double GetTotalFetchedDuration()
Get total duration of fetched fragments.
Definition: StreamAbstractionAAMP.h:354
MediaTrack::GetCurrentBandWidth
int GetCurrentBandWidth()
Get current bandwidth in bps.
Definition: streamabstraction.cpp:1377
StreamAbstractionAAMP::mBitrateReason
BitrateChangeReason mBitrateReason
Definition: StreamAbstractionAAMP.h:1450
StreamAbstractionAAMP::NotifyBitRateUpdate
void NotifyBitRateUpdate(int profileIndex, const StreamInfo &cacheFragStreamInfo, double position)
Notify bitrate updates to application. Used internally by injection logic.
Definition: streamabstraction.cpp:1740
MediaTrack::numberOfFragmentsCached
int numberOfFragmentsCached
Definition: StreamAbstractionAAMP.h:516
StreamAbstractionAAMP::mTextTrackIndex
std::string mTextTrackIndex
Definition: StreamAbstractionAAMP.h:1458
StreamAbstractionAAMP::mIsPaused
bool mIsPaused
Definition: StreamAbstractionAAMP.h:1443
StreamAbstractionAAMP::mIsAtLivePoint
bool mIsAtLivePoint
Definition: StreamAbstractionAAMP.h:924
StreamAbstractionAAMP::mFwdAudioToAux
bool mFwdAudioToAux
Definition: StreamAbstractionAAMP.h:1459
StreamInfo::bandwidthBitsPerSecond
long bandwidthBitsPerSecond
Definition: StreamAbstractionAAMP.h:75
MediaTrack::name
const char * name
Definition: StreamAbstractionAAMP.h:518
PrivateInstanceAAMP::mhAbrManager
HybridABRManager mhAbrManager
Definition: priv_aamp.h:820
StreamAbstractionAAMP::RampDownProfile
bool RampDownProfile(long http_error)
Rampdown profile.
Definition: streamabstraction.cpp:2019
StreamAbstractionAAMP::mAudioTrackIndex
std::string mAudioTrackIndex
Definition: StreamAbstractionAAMP.h:1457
MediaTrack::mSubtitleParser
std::unique_ptr< SubtitleParser > mSubtitleParser
Definition: StreamAbstractionAAMP.h:524
MediaTrack::GetBufferHealthStatusString
static const char * GetBufferHealthStatusString(BufferHealthStatus status)
Get string corresponding to buffer status.
Definition: streamabstraction.cpp:61
StreamAbstractionAAMP::CheckForRampDownLimitReached
bool CheckForRampDownLimitReached()
Check for ramp down limit reached by player.
Definition: streamabstraction.cpp:2943
StreamAbstractionAAMP::GetABRManager
ABRManager & GetABRManager()
Get the ABRManager reference.
Definition: StreamAbstractionAAMP.h:955
StreamAbstractionAAMP::GetProfileIndexForBandwidth
virtual int GetProfileIndexForBandwidth(long mTsbBandwidth)
Get profile index for TsbBandwidth.
Definition: StreamAbstractionAAMP.h:973
StreamAbstractionAAMP::GetCurrentAudioTrack
virtual bool GetCurrentAudioTrack(AudioTrackInfo &audioTrack)
Get current audio track information.
Definition: streamabstraction.cpp:2974
MediaTrack::~MediaTrack
virtual ~MediaTrack()
MediaTrack Destructor.
Definition: streamabstraction.cpp:1470
BUFFER_STATUS_YELLOW
@ BUFFER_STATUS_YELLOW
Definition: StreamAbstractionAAMP.h:141
StreamAbstractionAAMP::GetAvailableAudioTracks
virtual std::vector< AudioTrackInfo > & GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
Definition: StreamAbstractionAAMP.h:1105
StreamAbstractionAAMP::Init
virtual AAMPStatusType Init(TuneType tuneType)=0
Initialize a newly created object. To be implemented by sub classes.
MediaTrack::totalFetchedDuration
double totalFetchedDuration
Definition: StreamAbstractionAAMP.h:567
MediaTrack::RunInjectLoop
void RunInjectLoop()
Injection loop - use internally by injection logic.
Definition: streamabstraction.cpp:1174
StreamAbstractionAAMP::currentTextTrackProfileIndex
int currentTextTrackProfileIndex
Definition: StreamAbstractionAAMP.h:920
StreamAbstractionAAMP::UpdateStreamInfoBitrateData
void UpdateStreamInfoBitrateData(int profileIndex, StreamInfo &cacheFragStreamInfo)
Function to update stream info of current fetched fragment.
Definition: streamabstraction.cpp:1786
StreamAbstractionAAMP::mCheckForRampdown
bool mCheckForRampdown
Definition: StreamAbstractionAAMP.h:928
MediaTrack::StopInjectLoop
void StopInjectLoop()
Stop fragment injector loop.
Definition: streamabstraction.cpp:1263
StreamAbstractionAAMP::ResumeSubtitleOnPlay
virtual void ResumeSubtitleOnPlay(bool mute, char *data)
resume subtitles on play
Definition: StreamAbstractionAAMP.h:1363
StreamAbstractionAAMP::mLastVideoFragParsedTimeMS
double mLastVideoFragParsedTimeMS
Definition: StreamAbstractionAAMP.h:1441
priv_aamp.h
Private functions and types used internally by AAMP.
StreamAbstractionAAMP::GetStreamInfo
virtual StreamInfo * GetStreamInfo(int idx)=0
Get stream information of a profile from subclass.
MediaTrack::bufferMonitorThreadID
pthread_t bufferMonitorThreadID
Definition: StreamAbstractionAAMP.h:551
StreamAbstractionAAMP::GetIframeTrack
int GetIframeTrack()
Get iframe track index. This shall be called only after UpdateIframeTracks() is done.
Definition: streamabstraction.cpp:2227
StreamAbstractionAAMP::GetTsbBandwidth
long GetTsbBandwidth()
When TSB is involved, use this to get bandwidth to be reported.
Definition: StreamAbstractionAAMP.h:699
StreamAbstractionAAMP::~StreamAbstractionAAMP
virtual ~StreamAbstractionAAMP()
StreamAbstractionAAMP destructor.
Definition: streamabstraction.cpp:1657
StreamAbstractionAAMP::ResumeSubtitleAfterSeek
virtual void ResumeSubtitleAfterSeek(bool mute, char *data)
resume subtitles after trickplay
Definition: StreamAbstractionAAMP.h:1380
MediaTrack::GetTotalInjectedDuration
double GetTotalInjectedDuration()
Get total fragment injected duration.
Definition: StreamAbstractionAAMP.h:245
StreamAbstractionAAMP::NotifyPlaybackPaused
virtual void NotifyPlaybackPaused(bool paused)
Function called when playback is paused to update related flags.
Definition: streamabstraction.cpp:2245
StreamAbstractionAAMP::mStartTimeStamp
long long mStartTimeStamp
Definition: StreamAbstractionAAMP.h:1445
MediaTrack::fragmentChunkFetched
pthread_cond_t fragmentChunkFetched
Definition: StreamAbstractionAAMP.h:528
GrowableBuffer
Structure of GrowableBuffer.
Definition: AampMemoryUtils.h:39
MediaTrack::unparsedBufferChunk
GrowableBuffer unparsedBufferChunk
Definition: StreamAbstractionAAMP.h:537
StreamAbstractionAAMP::GetStreamPosition
virtual double GetStreamPosition()=0
Get current stream position.
MediaTrack::InjectFragment
bool InjectFragment()
Inject fragment into the gstreamer.
Definition: streamabstraction.cpp:895
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
StreamAbstractionAAMP::SetVideoRectangle
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
Definition: StreamAbstractionAAMP.h:1206
MediaTrack::parsedBufferChunk
GrowableBuffer parsedBufferChunk
Definition: StreamAbstractionAAMP.h:538
StreamAbstractionAAMP::trickplayMode
bool trickplayMode
Definition: StreamAbstractionAAMP.h:917
StreamAbstractionAAMP::GetAvailableTextTracks
virtual std::vector< TextTrackInfo > & GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
Definition: StreamAbstractionAAMP.h:1112
MediaTrack::AbortWaitForCachedFragment
void AbortWaitForCachedFragment()
Abort the waiting for cached fragments immediately.
Definition: streamabstraction.cpp:614
StreamAbstractionAAMP::GetMaxBWProfile
int GetMaxBWProfile()
Get profile index of highest bandwidth.
Definition: streamabstraction.cpp:1722
StreamInfo::reason
BitrateChangeReason reason
Definition: StreamAbstractionAAMP.h:77
StreamAbstractionAAMP::profileIdxForBandwidthNotification
int profileIdxForBandwidthNotification
Definition: StreamAbstractionAAMP.h:921
MediaTrack::noMDATCount
int noMDATCount
Definition: StreamAbstractionAAMP.h:530
MediaTrack::totalFragmentsDownloaded
int totalFragmentsDownloaded
Definition: StreamAbstractionAAMP.h:552
MediaTrack::GetContext
virtual class StreamAbstractionAAMP * GetContext()=0
Get the context of media track. To be implemented by subclasses.
MediaTrack::OnSinkBufferFull
void OnSinkBufferFull()
Called if sink buffer is full.
Definition: streamabstraction.cpp:2674
MediaTrack::WaitForFreeFragmentAvailable
bool WaitForFreeFragmentAvailable(int timeoutMs=-1)
Wait until a free fragment is available.
Definition: streamabstraction.cpp:351
StreamAbstractionAAMP::currentAudioProfileIndex
int currentAudioProfileIndex
Definition: StreamAbstractionAAMP.h:919
AAMPStatusType
AAMPStatusType
AAMP Function return values.
Definition: priv_aamp.h:205
StreamAbstractionAAMP::mAudioTracks
std::vector< AudioTrackInfo > mAudioTracks
Definition: StreamAbstractionAAMP.h:1452
MediaTrack::StartInjectLoop
void StartInjectLoop()
Start fragment injector loop.
Definition: streamabstraction.cpp:1136
MediaTrack::IsInjectionAborted
bool IsInjectionAborted()
Check whether track data injection is aborted.
Definition: StreamAbstractionAAMP.h:400
MediaTrack::totalFragmentChunksDownloaded
int totalFragmentChunksDownloaded
Definition: StreamAbstractionAAMP.h:553
StreamAbstractionAAMP::SeekPosUpdate
virtual void SeekPosUpdate(double secondsRelativeToTuneTime)=0
Update seek position when player is initialized.
MediaTrack::ProcessFragmentChunk
bool ProcessFragmentChunk()
Process next cached fragment chunk.
Definition: streamabstraction.cpp:641
StreamInfo::validity
bool validity
Definition: StreamAbstractionAAMP.h:73
MediaTrack::totalInjectedChunksDuration
double totalInjectedChunksDuration
Definition: StreamAbstractionAAMP.h:558
StreamAbstractionAAMP::mTotalPausedDurationMS
long long mTotalPausedDurationMS
Definition: StreamAbstractionAAMP.h:1444
eDISCONTINUIY_IN_BOTH
@ eDISCONTINUIY_IN_BOTH
Definition: StreamAbstractionAAMP.h:153
MediaTrack::RunInjectChunkLoop
void RunInjectChunkLoop()
Run fragment injector loop. Injection loop - use internally by injection logic.
Definition: streamabstraction.cpp:1242
StreamAbstractionAAMP::MuteSubtitleOnPause
virtual void MuteSubtitleOnPause()
mute subtitles on pause
Definition: StreamAbstractionAAMP.h:1354
MediaTrack::GetTotalInjectedChunksDuration
double GetTotalInjectedChunksDuration()
Get total duration of fetched fragments.
Definition: StreamAbstractionAAMP.h:361
StreamAbstractionAAMP::SetAudioTrack
virtual void SetAudioTrack(int index)
SetAudioTrack set the audio track using index value. [currently for OTA].
Definition: StreamAbstractionAAMP.h:1237
TextTrackInfo
Structure for text track information Holds information about a text track in playlist.
Definition: main_aamp.h:282
StreamAbstractionAAMP::GetMaxBitrate
virtual long GetMaxBitrate()
Gets Max bitrate supported.
Definition: StreamAbstractionAAMP.h:987
StreamAbstractionAAMP::MuteSubtitles
void MuteSubtitles(bool mute)
Send a MUTE/UNMUTE packet to the subtitle renderer.
Definition: streamabstraction.cpp:2585
MediaTrack::bufferStatus
BufferHealthStatus bufferStatus
Definition: StreamAbstractionAAMP.h:569
StreamAbstractionAAMP::mABRCacheLength
int mABRCacheLength
Definition: StreamAbstractionAAMP.h:1436
MediaTrack::operator=
MediaTrack & operator=(const MediaTrack &)=delete
MediaTrack assignment operator overloading.
StreamAbstractionAAMP::GetLastInjectedFragmentPosition
double GetLastInjectedFragmentPosition()
Function to returns last injected fragment position.
Definition: streamabstraction.cpp:2624
StreamAbstractionAAMP::UpdateRampdownProfileReason
void UpdateRampdownProfileReason(void)
Update rampdown profile on network failure.
Definition: streamabstraction.cpp:1836
MediaTrack::prevBufferStatus
BufferHealthStatus prevBufferStatus
Definition: StreamAbstractionAAMP.h:570
CDAIObject
Base class for the client side DAI object.
Definition: AdManagerBase.h:57
CachedFragment::profileIndex
int profileIndex
Definition: StreamAbstractionAAMP.h:106
MediaTrack::WaitForCachedFragmentChunkAvailable
bool WaitForCachedFragmentChunkAvailable()
Wait till cached fragment chunk available.
Definition: streamabstraction.cpp:543
StreamAbstractionAAMP::currentProfileIndex
int currentProfileIndex
Definition: StreamAbstractionAAMP.h:918
StreamAbstractionAAMP::mTuneType
TuneType mTuneType
Definition: StreamAbstractionAAMP.h:929
StreamAbstractionAAMP::mNwConsistencyBypass
long mNwConsistencyBypass
Definition: StreamAbstractionAAMP.h:1431
StreamAbstractionAAMP::mTrackState
MediaTrackDiscontinuityState mTrackState
Definition: StreamAbstractionAAMP.h:1456
MediaTrack::aamp
PrivateInstanceAAMP * aamp
Definition: StreamAbstractionAAMP.h:534
TileInfo::numRows
int numRows
Definition: StreamAbstractionAAMP.h:86
StreamAbstractionAAMP::mLastVideoFragCheckedforABR
int mLastVideoFragCheckedforABR
Definition: StreamAbstractionAAMP.h:1429
StreamAbstractionAAMP::MuteSidecarSubtitles
virtual void MuteSidecarSubtitles(bool mute)
mute/unmute sidecar subtitles
Definition: StreamAbstractionAAMP.h:1371
StreamAbstractionAAMP::mABRMinBuffer
int mABRMinBuffer
Definition: StreamAbstractionAAMP.h:1437
StreamAbstractionAAMP::IsMuxedStream
bool IsMuxedStream()
Check if current stream is muxed.
Definition: streamabstraction.cpp:2438
PlaylistType
PlaylistType
Playlist Types.
Definition: StreamAbstractionAAMP.h:128
CachedFragment::cacheFragStreamInfo
StreamInfo cacheFragStreamInfo
Definition: StreamAbstractionAAMP.h:110
MediaTrack::fragmentChunkInjected
pthread_cond_t fragmentChunkInjected
Definition: StreamAbstractionAAMP.h:549
CachedFragment
Structure of cached fragment data Holds information about a cached fragment.
Definition: StreamAbstractionAAMP.h:99
StreamAbstractionAAMP::StartSubtitleParser
virtual void StartSubtitleParser()
Kicks off subtitle display - sent at start of video presentation.
Definition: StreamAbstractionAAMP.h:1062
CachedFragment::fragment
GrowableBuffer fragment
Definition: StreamAbstractionAAMP.h:101
MediaTrack::fragmentInjectorThreadStarted
bool fragmentInjectorThreadStarted
Definition: StreamAbstractionAAMP.h:554
TileInfo::tileSetDuration
double tileSetDuration
Definition: StreamAbstractionAAMP.h:90
StreamAbstractionAAMP::GetDesiredProfileOnSteadyState
void GetDesiredProfileOnSteadyState(int currProfileIndex, int &newProfileIndex, long nwBandwidth)
Get Desired Profile on steady state.
Definition: streamabstraction.cpp:1856
MediaTrack::totalMdatCount
uint32_t totalMdatCount
Definition: StreamAbstractionAAMP.h:529
StreamAbstractionAAMP::GetAudioBitrates
virtual std::vector< long > GetAudioBitrates(void)=0
Get available audio bitrates.
StreamAbstractionAAMP::UpdateIframeTracks
void UpdateIframeTracks()
Update iframe tracks. Subclasses shall invoke this after StreamInfo is populated .
Definition: streamabstraction.cpp:2236
MediaTrack::bandwidthBitsPerSecond
int bandwidthBitsPerSecond
Definition: StreamAbstractionAAMP.h:566
StreamAbstractionAAMP::GetCurrentTextTrack
virtual bool GetCurrentTextTrack(TextTrackInfo &textTrack)
Get current text track.
Definition: streamabstraction.cpp:2996
CachedFragment::type
MediaType type
Definition: StreamAbstractionAAMP.h:111
StreamAbstractionAAMP::mTextTracksAll
std::vector< TextTrackInfo > mTextTracksAll
Definition: StreamAbstractionAAMP.h:1454
StreamAbstractionAAMP::SetVideoBitrate
void SetVideoBitrate(long bitrate)
Set a preferred bitrate for video.
StreamAbstractionAAMP::mStateCond
pthread_cond_t mStateCond
Definition: StreamAbstractionAAMP.h:1448
eDISCONTINUIY_IN_VIDEO
@ eDISCONTINUIY_IN_VIDEO
Definition: StreamAbstractionAAMP.h:151
MediaTrack::UpdateTSAfterFetch
void UpdateTSAfterFetch()
Updates internal state after a fragment fetch.
Definition: streamabstraction.cpp:248
MediaTrack::ptsError
bool ptsError
Definition: StreamAbstractionAAMP.h:541
ePLAYLISTTYPE_VOD
@ ePLAYLISTTYPE_VOD
Definition: StreamAbstractionAAMP.h:132
MediaTrack::GetBufferHealthStatus
BufferHealthStatus GetBufferHealthStatus()
Get buffer health status.
Definition: StreamAbstractionAAMP.h:386
StreamAbstractionAAMP::ApplyContentRestrictions
virtual void ApplyContentRestrictions(std::vector< std::string > restrictions)
Set Content Restrictions.
Definition: StreamAbstractionAAMP.h:1275
ePLAYLISTTYPE_EVENT
@ ePLAYLISTTYPE_EVENT
Definition: StreamAbstractionAAMP.h:131
MediaTrack::currentInitialCacheDurationSeconds
int currentInitialCacheDurationSeconds
Definition: StreamAbstractionAAMP.h:559
StreamAbstractionAAMP::GetThumbnailRangeData
virtual std::vector< ThumbnailData > GetThumbnailRangeData(double, double, std::string *, int *, int *, int *, int *)=0
Get thumbnail data for duration value.
MediaTrack::IsDiscontinuityProcessed
bool IsDiscontinuityProcessed()
Check if discontinuity is being processed.
Definition: StreamAbstractionAAMP.h:368
MediaTrack::GetFetchChunkBuffer
CachedFragmentChunk * GetFetchChunkBuffer(bool initialize)
Get buffer to fetch and cache next fragment chunk.
Definition: streamabstraction.cpp:1334
StreamAbstractionAAMP::SetPreferredAudioLanguages
virtual void SetPreferredAudioLanguages()
SetPreferredAudioLanguages set the preferred audio languages and rendition. [currently for OTA].
Definition: StreamAbstractionAAMP.h:1253
MediaTrack::InjectFragmentChunk
bool InjectFragmentChunk()
Inject fragment Chunk into the gstreamer.
Definition: streamabstraction.cpp:873
StreamAbstractionAAMP::ProcessDiscontinuity
bool ProcessDiscontinuity(TrackType type)
Function to process discontinuity.
Definition: streamabstraction.cpp:2708
StreamAbstractionAAMP::hasDrm
bool hasDrm
Definition: StreamAbstractionAAMP.h:922
StreamAbstractionAAMP::CheckForProfileChange
void CheckForProfileChange(void)
Checks and update profile based on bandwidth.
Definition: streamabstraction.cpp:2193
MediaTrack::InjectFragmentChunkInternal
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 in...
Definition: streamabstraction.cpp:238
StreamAbstractionAAMP::DisableContentRestrictions
virtual void DisableContentRestrictions(long grace, long time, bool eventChange)
Disable Content Restrictions - unlock.
Definition: StreamAbstractionAAMP.h:1285
MediaTrack::totalInjectedDuration
double totalInjectedDuration
Definition: StreamAbstractionAAMP.h:557
StreamAbstractionAAMP::mTsbMaxBitrateProfileIndex
int mTsbMaxBitrateProfileIndex
Definition: StreamAbstractionAAMP.h:932
MediaTrack::fragmentChunkIdxToInject
int fragmentChunkIdxToInject
Definition: StreamAbstractionAAMP.h:563
MediaTrack::AbortWaitForCachedAndFreeFragment
void AbortWaitForCachedAndFreeFragment(bool immediate)
Abort the waiting for cached fragments and free fragment slot.
Definition: streamabstraction.cpp:579