|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
34 #include <IPVideoStat.h>
38 #include <semaphore.h>
39 #include <curl/curl.h>
42 #include <unordered_map>
51 #include <cjson/cJSON.h>
56 #include <type_traits>
59 #include <HybridABRManager.h>
62 #define aamp_pthread_setname(tid,name) pthread_setname_np(name)
64 #define aamp_pthread_setname(tid,name) pthread_setname_np(tid,name)
67 #define AAMP_TRACK_COUNT 4
68 #define DEFAULT_CURL_INSTANCE_COUNT (AAMP_TRACK_COUNT + 1)
69 #define AAMP_DRM_CURL_COUNT 4
71 #define DEFAULT_PLAYLIST_DL_TIMEOUT 10L
72 #define DEFAULT_CURL_TIMEOUT 5L
73 #define DEFAULT_CURL_CONNECTTIMEOUT 3L
74 #define EAS_CURL_TIMEOUT 3L
75 #define EAS_CURL_CONNECTTIMEOUT 2L
76 #define DEFAULT_INTERVAL_BETWEEN_PLAYLIST_UPDATES_MS (6*1000)
78 #define AAMP_SEEK_TO_LIVE_POSITION (-1)
80 #define MAX_SESSION_ID_LENGTH 128
81 #define MANIFEST_TEMP_DATA_LENGTH 100
82 #define AAMP_LOW_BUFFER_BEFORE_RAMPDOWN 10
83 #define AAMP_HIGH_BUFFER_BEFORE_RAMPUP 15
86 #define AAMP_USER_AGENT_MAX_CONFIG_LEN 512
87 #define SERVER_UTCTIME_DIRECT "urn:mpeg:dash:utc:direct:2014"
88 #define SERVER_UTCTIME_HTTP "urn:mpeg:dash:utc:http-xsdate:2014"
90 #define VSS_MARKER "?sz="
91 #define VSS_MARKER_LEN 4
92 #define VSS_MARKER_FOG "%3Fsz%3D"
93 #define VSS_VIRTUAL_STREAM_ID_KEY_STR "content:xcal:virtualStreamId"
94 #define VSS_VIRTUAL_STREAM_ID_PREFIX "urn:merlin:linear:stream:"
95 #define VSS_SERVICE_ZONE_KEY_STR "device:xcal:serviceZone"
98 #define LL_DASH_SERVICE_PROFILE "http://www.dashif.org/guidelines/low-latency-live-v5"
99 #define URN_UTC_HTTP_XSDATE "urn:mpeg:dash:utc:http-xsdate:2014"
100 #define URN_UTC_HTTP_ISO "urn:mpeg:dash:utc:http-iso:2014"
101 #define URN_UTC_HTTP_NTP "urn:mpeg:dash:utc:http-ntp:2014"
102 #define URN_UTC_HTTP_HEAD "urn:mpeg:dash:utc:http-head:2014"
103 #define MAX_LOW_LATENCY_DASH_CORRECTION_ALLOWED 100
104 #define MAX_LOW_LATENCY_DASH_RETUNE_ALLOWED 2
106 #define MAX_LOW_LATENCY_DASH_ABR_SPEEDSTORE_SIZE 10
114 #define MAX_DEBUG_LOG_BUFF_SIZE 1024
119 #define MAX_URL_LOG_SIZE 960
121 #define CONVERT_SEC_TO_MS(_x_) (_x_ * 1000)
122 #define DEFAULT_PREBUFFER_COUNT (2)
123 #define DEFAULT_PRECACHE_WINDOW (10)
124 #define DEFAULT_DOWNLOAD_RETRY_COUNT (1)
126 #define PARTIAL_FILE_CONNECTIVITY_AAMP (130)
127 #define PARTIAL_FILE_DOWNLOAD_TIME_EXPIRED_AAMP (131)
128 #define OPERATION_TIMEOUT_CONNECTIVITY_AAMP (132)
129 #define PARTIAL_FILE_START_STALL_TIMEOUT_AAMP (133)
130 #define AAMP_MINIMUM_AUDIO_LEVEL (0)
131 #define AAMP_MAXIMUM_AUDIO_LEVEL (100)
133 #define STRBGPLAYER "BACKGROUND"
134 #define STRFGPLAYER "FOREGROUND"
136 #define MUTE_SUBTITLES_TRACKID (-1)
242 eCURL_ABORT_REASON_NONE = 0,
243 eCURL_ABORT_REASON_STALL_TIMEDOUT,
244 eCURL_ABORT_REASON_START_TIMEDOUT,
245 eCURL_ABORT_REASON_LOW_BANDWIDTH_TIMEDOUT
253 eAAMP_BITRATE_CHANGE_BY_ABR = 0,
254 eAAMP_BITRATE_CHANGE_BY_RAMPDOWN = 1,
255 eAAMP_BITRATE_CHANGE_BY_TUNE = 2,
256 eAAMP_BITRATE_CHANGE_BY_SEEK = 3,
257 eAAMP_BITRATE_CHANGE_BY_TRICKPLAY = 4,
258 eAAMP_BITRATE_CHANGE_BY_BUFFER_FULL = 5,
259 eAAMP_BITRATE_CHANGE_BY_BUFFER_EMPTY = 6,
260 eAAMP_BITRATE_CHANGE_BY_FOG_ABR = 7,
261 eAAMP_BITRATE_CHANGE_BY_OTA = 8,
262 eAAMP_BITRATE_CHANGE_BY_HDMIIN = 9,
263 eAAMP_BITRATE_CHANGE_MAX = 10
331 std::shared_ptr<PrivateInstanceAAMP> aamp;
340 std::string periodId;
345 PeriodInfo() : periodId(
""), startTime(0), duration(0.0), timeScale(0)
359 uint64_t presentationTime;
360 EventBreakInfo() : payload(), name(), duration(0), presentationTime(0)
362 EventBreakInfo(std::string _data, std::string _name, uint64_t _presentationTime, uint32_t _dur) : payload(_data), name(_name), presentationTime(_presentationTime), duration(_dur)
367 std::vector<uint8_t> keyID;
368 std::map<std::string, std::string> licenseEndPoint;
369 std::string customData;
370 std::string authToken;
371 std::string licenseResponse;
372 DynamicDrmInfo() : keyID(), licenseEndPoint{}, customData(
""), authToken(
""), licenseResponse()
491 long last_sample_time_val;
493 long prevSampleTotalDownloaded;
494 long totalDownloaded;
500 double weightedBitsPerSecond;
501 std::vector< std::pair<double,long> > mChunkSpeedData;
503 SpeedCache() : last_sample_time_val(0), prev_dlnow(0), prevSampleTotalDownloaded(0), totalDownloaded(0), speed_now(0), start_val(0), bStart(
false) , totalWeight(0), weightedBitsPerSecond(0), mChunkSpeedData()
544 std::string language;
545 std::string rendition;
547 unsigned int bitrate;
548 unsigned int channel;
551 AudioTrackTuple(): language(
""),rendition(
""),codec(
""),bitrate(0), channel(0){}
553 void setAudioTrackTuple(std::string language=
"", std::string rendition=
"", std::string codec=
"",
unsigned int channel=0)
555 this->language = language;
556 this->rendition = rendition;
558 this->channel = channel;
565 this->rendition =
"";
580 std::string attrName;
582 attrNameData() : attrName(
""),isProcessed(false)
586 attrNameData(std::string argument) : attrName(argument), isProcessed(false)
590 bool operator==(
const attrNameData& rhs)
const {
return (this->attrName == rhs.attrName); }
601 std::string hostname;
605 eCurlHostMap():curl(NULL),hostname(
""),isRemotehost(
true),redirect(
true)
618 std::string hostname;
650 typedef struct __attribute__((__packed__)) _AAMP2ReceiverMsg
657 #define AAMP2ReceiverMsgHdrSz (sizeof(AAMP2ReceiverMsg)-1)
660 double mReportProgressPosn;
696 void Tune(
const char *url,
bool autoPlay,
const char *contentType = NULL,
bool bFirstAttempt =
true,
bool bFinalAttempt =
false,
const char *sessionUUID = NULL,
bool audioDecoderStreamSync =
true);
766 bool PausePipeline(
bool pause,
bool forceStopGstreamerPreBuffering);
799 unsigned char*
ReplaceKeyIDPsshData(
const unsigned char *InputData,
const size_t InputDataLength,
size_t & OutputDataLength);
801 std::vector< std::pair<long long,long> > mAbrBitrateData;
804 pthread_mutexattr_t mMutexAttr;
817 pthread_cond_t mDownloadsDisabled;
818 bool mDownloadsEnabled;
822 bool licenceFromManifest;
832 std::string mManifestUrl;
833 std::string mTunedManifestUrl;
834 std::string mTsbSessionRequestUrl;
835 std::string mSchemeIdUriDai;
838 bool isPreferredDRMConfigured;
841 bool mbDownloadsBlocked;
842 bool streamerIsActive;
846 long mNetworkTimeoutMs;
849 long mManifestTimeoutMs;
850 long mPlaylistTimeoutMs;
851 bool mAsyncTuneEnabled;
860 long long mUpdateTime;
861 double mSeekPosSeconds;
865 PositionInfo():mPosition(-1.0), mUpdateTime(0), mSeekPosSeconds(-1), mIsPopulated(
false){}
902 constexpr
double SEEK_POS_SECONDS_TOLERANCE = 0.01;
905 ((std::abs(
getSeekPositionSec() - LatestSeekPosSeconds)<SEEK_POS_SECONDS_TOLERANCE)) &&
925 void Update(TPOSITIONCACHE Pos,
double SeekPosSeconds)
927 std::lock_guard<std::mutex>lock(mMutex);
936 std::lock_guard<std::mutex>lock(mMutex);
945 std::lock_guard<std::mutex>lock(mMutex);
949 PositionCache<long long> mPrevPositionMilliseconds;
950 std::mutex mGetPositionMillisecondsMutexHard;
951 std::mutex mGetPositionMillisecondsMutexSoft;
957 bool mSetPlayerRateAfterFirstframe;
963 int mMaxLanguageCount;
978 std::vector<struct DynamicDrmInfo> vDynamicDrmData;
984 bool subtitles_muted;
986 std::vector<std::string> subscribedTags;
987 std::vector<TimedMetadata> timedMetadata;
988 std::vector<TimedMetadata> timedMetadataNew;
989 std::vector<ContentGapInfo> contentGaps;
990 std::vector<std::string> responseHeaders;
991 std::vector<long>bitrateList;
992 std::map<std::string, std::string> httpHeaderResponses;
1001 long long trickStartUTCMS;
1002 double durationSeconds;
1003 double culledSeconds;
1004 double culledOffset;
1005 double mProgramDateTime;
1006 std::vector<struct PeriodInfo> mMPDPeriodsInfo;
1007 float maxRefreshPlaylistIntervalSecs;
1013 long long mAdPrevProgressTime;
1015 uint32_t mAdDuration;
1016 std::string mAdProgressId;
1017 bool discardEnteringLiveEvt;
1018 bool mIsRetuneInProgress;
1019 pthread_cond_t mCondDiscontinuity;
1020 guint mDiscontinuityTuneOperationId;
1023 std::string mSubLanguage;
1037 std::vector <attrNameData> aesCtrAttrDataList;
1038 pthread_mutex_t drmParserMutex;
1039 bool fragmentCdmEncrypted;
1041 pthread_t mPreCachePlaylistThreadId;
1042 bool mPreCachePlaylistThreadFlag;
1044 #if defined(AAMP_MPD_DRM) || defined(AAMP_HLS_DRM) || defined(USE_OPENCDM)
1045 pthread_t createDRMSessionThreadID;
1046 bool drmSessionThreadStarted;
1054 bool mAutoResumeTaskPending;
1057 int mthumbIndexValue;
1087 bool mLanguageChangeInProgress;
1091 long long mTimedMetadataDuration;
1097 std::vector<std::string> mDynamicDrmCache;
1098 pthread_mutex_t mDynamicDrmUpdateLock;
1099 pthread_cond_t mWaitForDynamicDRMToUpdate;
1100 bool mAudioComponentCount;
1101 bool mVideoComponentCount;
1116 bool hasId3Header(
const uint8_t* data, uint32_t length);
1143 void ReportID3Metadata(
MediaType mediaType,
const uint8_t* ptr, uint32_t len,
const char* schemeIdURI = NULL,
const char* id3Value = NULL, uint64_t presTime = 0, uint32_t id3ID = 0, uint32_t eventDur = 0, uint32_t tScale = 0, uint64_t tStampOffset=0);
1233 bool GetNetworkTime(
enum UtcTiming timingtype,
const std::string& remoteUrl,
long *http_error, CurlRequest request);
1249 bool GetFile(std::string remoteUrl,
struct GrowableBuffer *buffer, std::string& effectiveUrl,
long *http_error = NULL,
double *downloadTime = NULL,
const char *range = NULL,
unsigned int curlInstance = 0,
bool resetBuffer =
true,
MediaType fileType =
eMEDIATYPE_DEFAULT,
long *bitrate = NULL,
int * fogError = NULL,
double fragmentDurationSec = 0,
class CMCDHeaders *pCMCDMetrics = NULL);
1297 char *
LoadFragment(
ProfilerBucketType bucketType, std::string fragmentUrl, std::string& effectiveUrl,
size_t *len,
unsigned int curlInstance = 0,
const char *range = NULL,
long * http_code = NULL,
double *downloadTime = NULL,
MediaType fileType =
eMEDIATYPE_MANIFEST,
int * fogError = NULL);
1313 bool LoadFragment(
class CMCDHeaders *pCMCDMetrics,
ProfilerBucketType bucketType, std::string fragmentUrl, std::string& effectiveUrl,
struct GrowableBuffer *buffer,
unsigned int curlInstance = 0,
const char *range = NULL,
MediaType fileType =
eMEDIATYPE_MANIFEST,
long * http_code = NULL,
double * downloadTime = NULL,
long *bitrate = NULL,
int * fogError = NULL,
double fragmentDurationSec = 0);
1324 void PushFragment(
MediaType mediaType,
char *ptr,
size_t len,
double fragmentTime,
double fragmentDuration);
1360 void InsertAd(
const char *url,
double positionSeconds);
1395 void SendErrorEvent(
AAMPTuneFailure tuneFailure,
const char *description = NULL,
bool isRetryEnabled =
true, int32_t secManagerClassCode = -1, int32_t secManagerReasonCode = -1, int32_t secClientBusinessStatus = -1);
1438 bool mBufUnderFlowStatus;
1439 bool GetBufUnderFlowStatus() {
return mBufUnderFlowStatus; }
1440 void SetBufUnderFlowStatus(
bool statusFlag) { mBufUnderFlowStatus = statusFlag; }
1441 void ResetBufUnderFlowStatus() { mBufUnderFlowStatus =
false;}
1555 void ReportProgress(
bool sync =
true,
bool beginningOfStream =
false);
1623 void SendStreamCopy(
MediaType mediaType,
const void *ptr,
size_t len,
double fpts,
double fdts,
double fDuration);
1729 void ReportTimedMetadata(
long long timeMS,
const char* szName,
const char* szContent,
int nb,
bool bSyncCall=
false,
const char*
id =
"",
double durationMS = -1);
1740 void SaveNewTimedMetadata(
long long timeMS,
const char* szName,
const char* szContent,
int nb,
const char*
id =
"",
double durationMS = -1);
1753 void SaveTimedMetadata(
long long timeMS,
const char* szName,
const char* szContent,
int nb,
const char*
id =
"",
double durationMS = -1);
1770 void ReportContentGap(
long long timeMS, std::string
id,
double durationMS = -1);
1892 return mManifestUrl;
1913 mManifestUrl.assign(url);
2226 void AddCustomHTTPHeader(std::string headerName, std::vector<std::string> headerValue,
bool isLicenseHeader);
2300 void SetAlternateContents(
const std::string &adBreakId,
const std::string &adId,
const std::string &url);
2310 void SendAdResolvedEvent(
const std::string &adId,
bool status, uint64_t startMS=0, uint64_t durationMs=0);
2333 void SendAdPlacementEvent(
AAMPEventType type,
const std::string &adId, uint32_t position, uint32_t adOffset, uint32_t adDuration,
bool immediate=
false,
long error_code=0);
2486 #if defined(USE_SECCLIENT) || defined(USE_SECMANAGER)
2493 void GetMoneyTraceString(std::string &)
const;
2641 void ConfigureOutputResolutionCheck();
2872 void UpdateVideoEndMetrics(
MediaType mediaType,
long bitrate,
int curlOrHTTPCode, std::string& strUrl,
double curlDownloadTime, ManifestData * manifestData = NULL);
2911 void UpdateVideoEndMetrics(
MediaType mediaType,
long bitrate,
int curlOrHTTPCode, std::string& strUrl,
double duration,
double curlDownloadTime,
bool keyChanged,
bool isEncrypted, ManifestData * manifestData = NULL);
2922 void UpdateVideoEndMetrics(
MediaType mediaType,
long bitrate,
int curlOrHTTPCode, std::string& strUrl,
double duration,
double curlDownloadTime);
2952 void NotifyVideoBasePTS(
unsigned long long basepts,
unsigned long timeScale = 90000);
3098 std::string GetVideoRectangle();
3179 void SetRampDownLimit(
int limit);
3551 void SetPreferredLanguages(
const char *languageList,
const char *preferredRendition,
const char *preferredType,
const char *codecList,
const char *labelList );
3720 bLLDashAdjustPlayerSpeed = state;
3730 return bLLDashAdjustPlayerSpeed;
3865 if(mVideoEnd) mVideoEnd->IncrementGaps();
4004 std::mutex mPausePositionMonitorMutex;
4005 std::condition_variable mPausePositionMonitorCV;
4006 pthread_t mPausePositionMonitoringThreadID;
4007 bool mPausePositionMonitoringThreadStarted;
4012 bool mIsAudioContextSkipped;
4014 bool mFirstProgress;
4015 bool mTuneCompleted;
4019 long long mPlayerLoadTime;
4020 std::atomic<PrivAAMPState> mState;
4023 std::shared_ptr<AampDrmHelper> mCurrentDrm;
4024 int mPersistedProfileIndex;
4025 long mAvailableBandwidth;
4028 bool mDiscontinuityTuneOperationInProgress;
4030 bool mTunedEventPending;
4031 bool mSeekOperationInProgress;
4032 bool mTrickplayInProgress;
4033 std::map<guint, bool> mPendingAsyncEvents;
4034 std::unordered_map<std::string, std::vector<std::string>> mCustomHeaders;
4035 bool mIsFirstRequestToFOG;
4041 CVideoStat * mVideoEnd;
4043 double mTimeToTopProfile;
4044 double mTimeAtTopProfile;
4045 unsigned long long mVideoBasePTS;
4047 std::unordered_map<std::string, std::vector<std::string>> mCustomLicenseHeaders;
4048 std::string mAppName;
4049 PreCacheUrlList mPreCacheDnldList;
4050 bool mProgressReportFromProcessDiscontinuity;
4073 bool bLowLatencyServiceConfigured;
4074 bool bLLDashAdjustPlayerSpeed;
4076 uint32_t vidTimeScale;
4077 uint32_t audTimeScale;
4079 bool bLowLatencyStartABR;
4080 bool mLiveOffsetAppRequest;
4082 long mCurrentLatency;
4088 std::string mTextStyle;
4099 const char* schemeIdURI,
const char* id3Value, uint64_t presTime, uint32_t id3ID, uint32_t eventDur, uint32_t tScale, uint64_t tStampOffset)
4100 :
aamp(instance),
data(),
schemeIdUri(), value(), presentationTime(presTime), id(id3ID), eventDuration(eventDur), timeScale(tScale), timestampOffset(tStampOffset)
4102 data = std::vector<uint8_t>(ptr, ptr + len);
4111 value = std::string(id3Value);
4123 uint64_t presentationTime;
4124 uint32_t eventDuration;
4126 uint64_t timestampOffset;
4129 #endif // PRIVAAMP_H
void SendStalledErrorEvent()
Send stalled events to listeners.
void SetInitialBitrate(long bitrate)
To set the initial bitrate value.
bool IsCDVRContent()
Checking whether CDVR Stream or not.
void ExtractServiceZone(std::string url)
updates mServiceZone (service zone) member with string extracted from locator &sz URI parameter
@ eHTTPHEADERTYPE_FOG_REASON
void EnableSeekableRange(bool enabled)
Enable seekable range values in progress event.
uint32_t GetVidTimeScale(void)
Gets Video TimeScale.
void SetCurlTimeout(long timeout, AampCurlInstance instance)
Set curl timeout(CURLOPT_TIMEOUT)
void SetLLDashAdjustSpeed(bool state)
Turn off/on the player speed correction for Low latency Dash.
double mProgressReportOffset
bool IsUninterruptedTSB()
Checking whether fog is giving uninterrupted TSB.
std::string GetLicenseServerUrlForDrm(DRMSystems type)
Get license server url for a drm type.
void SetNewABRConfig(bool bValue)
Configure New ABR Enable/Disable.
void SetLiveOffsetAppRequest(bool LiveOffsetAppRequest)
set LiveOffset Request flag Status
std::string GetAuxiliaryAudioLanguage()
Get auxiliary language.
void LogDrmInitComplete(void)
Notifies profiler that drm initialization is complete.
void SendMessage2Receiver(AAMP2ReceiverMsgType type, const char *data)
Send message to reciever over PIPE.
Event Handler for AAMP Player.
int GetAudioTrack()
Get current audio track index.
bool SendTunedEvent(bool isSynchronous=true)
Send tuned event to listeners if required.
pthread_mutex_t mParallelPlaylistFetchLock
void SignalTrickModeDiscontinuity()
Signal trick mode discontinuity to stream sink.
void SendAdResolvedEvent(const std::string &adId, bool status, uint64_t startMS=0, uint64_t durationMs=0)
Send status of Ad manifest downloading & parsing.
bool mEncryptedPeriodFound
@ eAAMPConfig_InterruptHandling
StreamOutputFormat
Media output format.
TextTrackInfo mPreferredTextTrack
@ eGST_ERROR_GST_PIPELINE_INTERNAL
@ eGST_ERROR_OUTPUT_PROTECTION_ERROR
void ClosePipeSession()
Close PIPE session with Receiver.
void UpdateVideoEndTsbStatus(bool btsbAvailable)
updates time shift buffer status
@ eAAMPSTATUS_PLAYLIST_VIDEO_DOWNLOAD_ERROR
void setCurrentDrm(std::shared_ptr< AampDrmHelper > drm)
Set DRM type.
void NotifyEOSReached()
Process EOS from Sink and notify listeners if required.
Implented DRM helper functionalities.
void ConfigureManifestTimeout()
To set the manifest timeout as per priority.
void SetCallbackAsPending(guint id)
Set an idle callback as event pending state.
long GetMaximumBitrate()
Get maximum bitrate value.
std::string preferredLanguagesString
void ResetCurrentlyAvailableBandwidth(long bitsPerSecond, bool trickPlay, int profile=0)
Reset bandwidth value Artificially resetting the bandwidth. Low for quicker tune times.
std::string mCMCDNextObjectRequest
std::string & GetDrmInitData(void)
Get DRM init data obtained from manifest URL (if present)
void DeliverAdEvents(bool immediate=false)
Deliver all pending Ad events to JSPP.
A standard way of storing positions with associated data for validation purposes.
void SendDownloadErrorEvent(AAMPTuneFailure tuneFailure, long error_code)
Handles download errors and sends events to application if required.
bool mIsIframeTrackPresent
class StreamAbstractionAAMP * mpStreamAbstractionAAMP
bool IsEASContent()
Checking whether EAS content or not.
void SetSslVerifyPeerConfig(bool bValue)
to configure disable ssl verify peer parameter
void SetSessionToken(std::string &sessionToken)
Set the session Token for player.
void PushFragment(MediaType mediaType, char *ptr, size_t len, double fragmentTime, double fragmentDuration)
Push fragment to the gstreamer.
void SetManifestTimeout(double timeout)
To set the manifest download timeout value.
const std::string & getUUID() const
void SetContentType(const char *contentType)
Set Content Type.
std::string preferredTextLabelString
virtual ~AsyncEventDescriptor()
AsyncEventDescriptor destructor.
void NotifyFirstBufferProcessed()
Notify if first buffer processed by gstreamer.
void InterruptableMsSleep(int timeInMs)
Sleep until timeout is reached or interrupted.
bool hasId3Header(const uint8_t *data, uint32_t length)
Check if segment starts with an ID3 section.
void LogTuneComplete(void)
Notify tune end for profiling/logging.
void NotifyTextTracksChanged()
Function to notify available text tracks changed.
@ PROFILE_BUCKET_FRAGMENT_VIDEO
long GetDefaultBitrate()
Get default bitrate value.
void ResetTrickStartUTCTime()
Reset trick start position.
void TuneHelper(TuneType tuneType, bool seekWhilePaused=false)
The helper function which perform tuning Common tune operations used on Tune, Seek,...
void SendVTTCueDataAsEvent(VTTCue *cue)
To send webvtt cue as an event.
void SetPreferredLanguages(const char *languageList, const char *preferredRendition, const char *preferredType, const char *codecList, const char *labelList)
set preferred Audio Language properties like language, rendition, type and codec
void EndOfStreamReached(MediaType mediaType)
End of stream reached.
void ResetEOSSignalledFlag()
Reset EOS SignalledFlag.
void ConfigureWesterosSink()
To set westeros sink configuration.
long GetVideoBitrate()
Get preferred bitrate for video.
@ PROFILE_BUCKET_FRAGMENT_AUDIO
double GetPeriodDurationTimeValue(void)
GetPeriodDurationTimeValue.
void EnableVideoRectangle(bool rectProperty)
Set video rectangle property.
std::string GetContentTypString()
Set Content Type.
std::string GetPlaybackStats()
Get playback stats for the session so far.
void SetNewAdBreakerConfig(bool bValue)
Configure New AdBreaker Enable/Disable.
bool SetupPipeSession()
Establish PIPE session with Receiver.
void SendAdReservationEvent(AAMPEventType type, const std::string &adBreakId, uint64_t position, bool immediate=false)
Send Ad reservation event.
void SetStreamFormat(StreamOutputFormat videoFormat, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat)
Set stream format for audio/video tracks.
Class for sed event to Listener.
std::string mVssVirtualStreamId
long GetCurrentLatency()
Get Current Latency.
@ eAAMPSTATUS_TRACKS_SYNCHRONISATION_ERROR
@ eCURLINSTANCE_AUX_AUDIO
double GetPeriodScaledPtoStartTime(void)
GetPeriodScaledPtoStartTime.
unsigned char * ReplaceKeyIDPsshData(const unsigned char *InputData, const size_t InputDataLength, size_t &OutputDataLength)
Replace KeyID from PsshData.
bool GetLowLatencyServiceConfigured()
Get Low Latency Service Configuration Status.
TPOSITION getPosition() const
The stored position value, may be invalid, check using isPositionValid()
PrivateInstanceAAMP * aamp
void ConfigurePreCachePlaylist()
Function to configure PreCachePlaylist.
bool mPauseOnFirstVideoFrameDisp
void SetPlaylistTimeout(double timeout)
To set the playlist download timeout value.
std::vector< uint8_t > data
void ConfigureInitFragTimeoutRetryCount()
Function to set the max retry attempts for init frag curl timeout failures.
std::string GetThumbnails(double start, double end)
Get the Thumbnail Tile data.
bool IsTuneCompleted()
Check if tune completed or not.
void SetTrackDiscontinuityIgnoredStatus(MediaType track)
Set discontinuity ignored flag for given track.
size_t HandleSSLWriteCallback(char *ptr, size_t size, size_t nmemb, void *userdata)
HandleSSLWriteCallback - Handle write callback from CURL.
int GetPersistedProfileIndex()
Get persisted profile index.
int GetCurrentAudioTrackId(void)
Get the Current Audio Track Id Currently it is implimented for AC4 track selection only.
@ PROFILE_BUCKET_INIT_VIDEO
Types and APIs exposed by the AAMP player.
HttpHeaderType
Http Header Type.
pthread_mutex_t mDiscoCompleteLock
@ eHTTPHEADERTYPE_EFF_LOCATION
void SetAudioVolume(int volume)
Set audio volume.
void SetVideoMute(bool muted)
Enable/ Disable Video.
void CurlInit(AampCurlInstance startIdx, unsigned int instanceCount=1, std::string proxyName="")
Curl initialization function.
void Tune(const char *url, bool autoPlay, const char *contentType=NULL, bool bFirstAttempt=true, bool bFinalAttempt=false, const char *sessionUUID=NULL, bool audioDecoderStreamSync=true)
Tune API.
void PersistBitRateOverSeek(bool value)
Enable/disable configuration to persist ABR profile over Seek/SAP.
void SetState(PrivAAMPState state)
Set player state.
std::string mPlaybackMode
void LogPlayerPreBuffered(void)
Profile Player changed from background to foreground i.e prebuffred.
AampCacheHandler * getAampCacheHandler()
Get AampCacheHandler instance.
void ConfigureRetuneForUnpairedDiscontinuity()
To set unpaired discontinuity retune configuration.
void RegisterEvents(EventListener *eventListener)
Register event listener.
void SetCurrentLatency(long currentLatency)
Set Current Latency.
void SetTextStyle(const std::string &options)
Set style options for text track rendering.
Used in asynchronous event notification logic.
void SetStereoOnlyPlayback(bool bValue)
Set Stereo Only Playback.
bool strictSpecConformance
void SetPersistedBandwidth(long bandwidth)
Set persisted bandwidth.
void SetTunedManifestUrl(bool isrecordedUrl=false)
Sets Recorded URL from Manifest received form XRE.
void SetParallelPlaylistDL(bool bValue)
Set parallel playlist download config value.
int mCurrentAudioTrackIndex
void SetRetuneForUnpairedDiscontinuity(bool bValue)
Set unpaired discontinuity retune flag.
Controller for managing DRM sessions.
bool mSeekFromPausedState
void AcquireStreamLock()
acquire streamsink lock
void ProcessID3Metadata(char *segment, size_t size, MediaType type, uint64_t timestampOffset=0)
Process the ID3 metadata from segment.
void RemoveEventListener(AAMPEventType eventType, EventListener *eventListener)
Deregister event lister, Remove listener to aamp events.
bool GetNetworkTime(enum UtcTiming timingtype, const std::string &remoteUrl, long *http_error, CurlRequest request)
Download a file from the server.
void SetPreferredTextLanguages(const char *param)
Set Preferred Text Language.
ProfileEventAAMP header file.
bool mIsPeriodChangeMarked
bool TrackDownloadsAreEnabled(MediaType type)
Check to media track downloads are enabled.
double mLLDashCurrentPlayRate
void UpdateVideoEndMetrics(MediaType mediaType, long bitrate, int curlOrHTTPCode, std::string &strUrl, double curlDownloadTime, ManifestData *manifestData=NULL)
updates download metrics to VideoStat object, this is used for VideoFragment as it takes duration for...
void SendStreamTransfer(MediaType mediaType, GrowableBuffer *buffer, double fpts, double fdts, double fDuration, bool initFragment=0)
API to send audio/video stream into the sink.
double GetPeriodStartTimeValue(void)
GetPeriodStartTimeValue.
Struct to store parsed url hostname & its type.
void RunPausePositionMonitoring(void)
the PositionMonitoring thread used for PauseAt functionality
std::string preferredCodecString
StreamOutputFormat mPreviousAudioType
void SetStallErrorCode(int errorCode)
Set stall error code.
Holds id3 metadata callback specific variables.
@ eHTTPHEADERTYPE_XREASON
unsigned int mManifestRefreshCount
bool mFirstVideoFrameDisplayedEnabled
PrivateInstanceAAMP & operator=(const PrivateInstanceAAMP &)=delete
assignment operator disabled
long GetDefaultBitrate4K()
Get Default bitrate for 4K.
DynamicDrmInfo mDynamicDrmDefaultconfig
@ eHTTPHEADERTYPE_UNKNOWN
long curlDLTimeout[eCURLINSTANCE_MAX]
void UpdateVideoEndProfileResolution(MediaType mediaType, long bitrate, int width, int height)
updates profile Resolution to VideoStat object
time_t GetUtcTime()
Get Utc Time.
bool IsTSBSupported()
Checking whether TSB enabled or not.
long GetMinimumBitrate()
Get minimum bitrate value.
@ eAAMPSTATUS_GENERIC_ERROR
PausedBehavior
Enumeration for Paused state behavior.
void SetAudioPlayContextCreationSkipped(bool isAudioContextSkipped)
Set is Audio play context is skipped, due to Audio HLS file is ES Format type.
std::vector< std::string > preferredCodecList
void UpdateRefreshPlaylistInterval(float maxIntervalSecs)
Update playlist refresh interval.
long long GetDurationMs(void)
Get asset duration in milliseconds.
bool RemoveAsyncTask(int taskId)
Remove async task scheduled earlier.
@ eDASH_ERROR_STARTTIME_RESET
bool IsFragmentCachingRequired()
Check if fragment caching is required.
PausedBehavior mPausedBehavior
bool mAudioDecoderStreamSync
void SetTextTrack(int trackId, char *data=NULL)
Set text track.
long long mTimedMetadataStartTime
int getStreamType()
Get stream type.
std::vector< std::string > preferredTextLanguagesList
struct eCurlHostMap eCurlHostMapStruct
To have hostname mapped curl handles.
void UpdateCullingState(double culledSeconds)
Update playlist culling.
pthread_mutex_t mStreamLock
TunedEventConfig
Enumeration for TUNED Event Configuration.
void SetVideoBitrate(long bitrate)
Set a preferred bitrate for video.
void UpdatePreferredAudioList()
to update the preferredaudio codec, rendition and languages list
bool ProcessCustomCurlRequest(std::string &remoteUrl, struct GrowableBuffer *buffer, long *http_error, CurlRequest request=eCURL_GET, std::string pData="")
Perform custom curl request.
size_t HandleSSLHeaderCallback(const char *ptr, size_t size, size_t nmemb, void *userdata)
HandleSSLHeaderCallback - Hanlde header callback from SSL.
@ AAMP_EVENT_DEFAULT_MODE
void UpdateSubtitleTimestamp()
Sets up the timestamp sync for subtitle renderer.
std::string preferredTypeString
void ScheduleRetune(PlaybackErrorType errorType, MediaType trackType)
Schedules retune or discontinuity processing based on state.
std::string GetAvailableVideoTracks()
Get available video tracks.
void ReportTimedMetadata(bool init=false)
Report timed metadata Function to send timedMetadata.
Stores details about available periods in mpd.
bool isPopulated() const
false if the object contains default data
std::string & GetManifestUrl(void)
Get manifest URL.
PrivateInstanceAAMP(AampConfig *config=NULL)
PrivateInstanceAAMP Constructor.
AudioType previousAudioType
std::string preferredTextLanguagesString
void InitializeCC(void)
Initialize CC after first frame received Sends CC handle event to listeners when first frame receives...
void StopDownloads()
Stop downloads of all tracks. Used by aamp internally to manage states.
void SetSubtitleMute(bool muted)
Set subtitle mute state.
void SetRetuneForGSTInternalError(bool bValue)
Set retune configuration for gstpipeline internal data stream error.
std::vector< std::string > preferredLabelList
void SetScheduler(AampScheduler *instance)
Set the scheduler instance to schedule tasks.
VideoZoomMode
Video zoom mode.
bool LockGetPositionMilliseconds()
Lock GetPositionMilliseconds() returns true if successfull.
bool Discontinuity(MediaType track, bool setDiscontinuityFlag=false)
Signal discontinuity of track. Called from StreamAbstractionAAMP to signal discontinuity.
@ eAAMPSTATUS_SEEK_RANGE_ERROR
std::string preferredTextRenditionString
void SendWatermarkSessionUpdateEvent(uint32_t sessionHandle, uint32_t status, const std::string &system)
Generate WatermarkSessionUpdate event based on args passed.
bool HasSidecarData()
check if sidecar data available
void GetState(PrivAAMPState &state)
Get player state.
void SetPreferredTextTrack(const TextTrackInfo track)
Set preferred text track Required to persist across trickplay or other operations.
void SetNetworkTimeout(double timeout)
To set the network download timeout value.
bool IsDashAsset(void)
To check if current asset is DASH or not.
@ eAAMPSTATUS_UNSUPPORTED_DRM_ERROR
VideoScanType
VideoScanType - Progressive/Interlaced.
std::string mFailureReason
bool IsEventListenerAvailable(AAMPEventType eventType)
IsEventListenerAvailable Check if Event is registered.
uint8_t * lastId3Data[eMEDIATYPE_DEFAULT]
void ReportAdProgress(bool sync=true)
Report Ad progress event to listeners Sending Ad progress percentage to JSPP.
void SetMaxPlaylistCacheSize(int cacheSize)
Set Maximum Cache Size for storing playlist.
std::queue< AAMPEventPtr > mAdEventsQ
long GetCurrentlyAvailableBandwidth(void)
Get the current network bandwidth using most recently recorded 3 samples.
@ E_AAMP2Receiver_TUNETIME
bool IsDiscontinuityProcessPending()
Check if discontinuity processing is pending.
char * GetOnVideoEndSessionStatData()
Download VideoEnd Session statistics from fog.
void SendDrmErrorEvent(DrmMetaDataEventPtr event, bool isRetryEnabled)
Handles DRM errors and sends events to application if required.
void ConfigureDashParallelFragmentDownload()
To set DASH Parallel Download configuration for fragments.
void SetDownloadBufferSize(int bufferSize)
To set the download buffer size value.
void SaveNewTimedMetadata(long long timeMS, const char *szName, const char *szContent, int nb, const char *id="", double durationMS=-1)
SaveNewTimedMetadata Function to store Metadata and reporting event one by one after DRM Initializati...
void SetManifestCurlTimeout(long timeout)
Set manifest curl timeout.
bool midFragmentSeekCache
void ConfigureLicenseCaching()
To set license caching config.
void SetLicenseServerURL(const char *url, DRMSystems drmType=eDRM_MAX_DRMSystems)
Set license server URL.
Class for AAMP event Profiling.
StreamAbstraction class of AAMP.
int mPreCacheDnldTimeWindow
long long DurationFromStartOfPlaybackMs(void)
Get asset duration in milliseconds For VIDEO TAG Based playback, mainly when aamp is used as plugin.
Call back handler for Aamp.
bool GetLiveOffsetAppRequest()
To store Low Latency Service configurtions.
double mNextPeriodDuration
bool WebVTTCueListenersRegistered(void)
To check if JavaScript cue listeners are registered.
const char * GetTunedManifestUrl()
Gets Recorded URL from Manifest received form XRE.
void UnRegisterEvents(EventListener *eventListener)
UnRegister event listener.
@ eCURLINSTANCE_PLAYLISTPRECACHE
void individualization(const std::string &payload)
DRM individualization callback.
void SetVidTimeScale(uint32_t vidTimeScale)
Sets Low Video TimeScale.
int mMinInitialCacheSeconds
void ConfigurePlaylistTimeout()
To set the manifest timeout as per priority.
void SetLLDashCurrentPlayBackRate(double rate)
Sets Low latency play rate.
std::string GetThumbnailTracks()
Get available thumbnail tracks.
void SetAnonymousRequest(bool isAnonymous)
Set anonymous request true or false.
AudioTrackTuple mAudioTuple
MediaFormat GetMediaFormatTypeEnum() const
Get Mediaformat type.
void LogDrmDecryptEnd(ProfilerBucketType bucketType)
Notifies profiler that decryption has ended.
double mNextPeriodStartTime
int GetInitialBufferDuration()
Get current initial buffer duration in seconds.
Header file of helper functions for memory management.
void SetInitRampdownLimit(int limit)
Set Initila profile ramp down limit.
ContentGapInfo()
ContentGapInfo Constructor.
void SetMatchingBaseUrlConfig(bool bValue)
Set Matching BaseUrl Config Configuration.
TimedMetadata()
TimedMetadata Constructor.
void NotifyAudioTracksChanged()
Function to notify available audio tracks changed.
AampURLInfoStruct mOrigManifestUrl
void SetNetworkProxy(const char *proxy)
To set the network proxy.
void TuneFail(bool fail)
Profiler for failure tune.
long long GetPositionMilliseconds(void)
Get current stream playback position in milliseconds.
void SendMediaMetadataEvent(void)
Generate media metadata event based on parsed attribute values.
double GetSeekBase(void)
Get seek base position.
void SaveTimedMetadata(long long timeMS, const char *szName, const char *szContent, int nb, const char *id="", double durationMS=-1)
SaveTimedMetadata Function to store Metadata for bulk reporting during Initialization.
bool IsDiscontinuityIgnoredForOtherTrack(MediaType track)
Check whether the given track discontinuity ignored earlier.
std::string GetNetworkProxy()
To get the network proxy.
void ReleaseStreamLock()
release streamsink lock
void SetVssVirtualStreamID(std::string streamID)
set virtual stream ID, extracted from manifest
void RefreshSubtitles()
Switch the subtitle track following a change to the preferredTextTrack.
void ReportBulkTimedMetadata()
Report bulk timedMetadata Function to send bulk timedMetadata in json format.
Scheduler class for asynchronous operations.
void Update(TPOSITIONCACHE Pos, double SeekPosSeconds)
Update the stored position information.
AAMPEventMode
AAMP event modes.
void NotifyFirstFrameReceived(void)
Notify first frame is displayed. Sends CC handle event to listeners.
long long getTimeSinceUpdateMs() const
For objects containing real data (check using isPopulated()) this returns the number of milliseconds ...
std::vector< std::string > preferredRenditionList
void SendSupportedSpeedsChangedEvent(bool isIframeTrackPresent)
Generate supported speeds changed event based on arg passed.
Accessibility preferredTextAccessibilityNode
void NotifySinkBufferFull(MediaType type)
Notify about sink buffer full.
long mSupportedTLSVersion
@ PROFILE_BUCKET_INIT_SUBTITLE
BitrateChangeReason
Different reasons for bitrate change.
bool playerStartedWithTrickPlay
Class to Handle Aamp Events.
void SetMinimumBitrate(long bitrate)
Set minimum bitrate value.
void SetAudioTrack(int trackId)
Set audio track.
AsyncEventDescriptor()
AsyncEventDescriptor constructor.
void SendEvent(AAMPEventPtr eventData, AAMPEventMode eventMode=AAMP_EVENT_DEFAULT_MODE)
Send event to listeners.
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
Accessibility preferredAudioAccessibilityNode
const TextTrackInfo & GetPreferredTextTrack()
Get preferred audio track.
std::string mTsbRecordingId
void StopTrackDownloads(MediaType type)
Stop downloads for a track. Called from StreamSink to control flow.
Stroes the information for cache speed.
void(* DestroyTask)(void *arg)
Function pointer for the destroy task.
void SetVODTrickplayFPS(int vodTrickplayFPS)
Set frames per second for VOD trickplay.
@ PROFILE_BUCKET_FRAGMENT_SUBTITLE
PositionInfo< TPOSITIONCACHE > GetInfo()
Retrieve the stored position information.
void ReportContentGap(long long timeMS, std::string id, double durationMS=-1)
Report content gap events.
void DisableContentRestrictions(long grace=0, long time=-1, bool eventChange=false)
Disable Content Restrictions - unlock.
DRMSystems GetPreferredDRM()
Get Preferred DRM.
void SyncBegin(void)
GStreamer operation start.
void WaitForDiscontinuityProcessToComplete(void)
wait for Discontinuity handling complete
std::string GetTextStyle()
Get style options for text track rendering.
void Invalidate()
Explicitly set the cache to an invalid state.
HybridABRManager mhAbrManager
void SetDownloadStallTimeout(long stallTimeout)
To set the curl stall timeout value.
void SetInitFragTimeoutRetryCount(int count)
To set the max retry attempts for init frag curl timeout failures.
To have hostname mapped curl handles.
bool DiscontinuitySeenInAnyTracks()
Check if discontinuity processed in any track.
class MediaStreamContext * GetMediaStreamContext(MediaType type)
Get Media Stream Context.
bool IsInProgressCDVR()
Checking whether CDVR in progress.
void SetStreamSink(StreamSink *streamSink)
Setting the stream sink.
void CheckForDiscontinuityStall(MediaType mediaType)
Check if AAMP is in stalled state after it pushed EOS to notify discontinuity.
void StopPausePositionMonitoring(std::string reason)
stop the PausePositionMonitoring thread used for PauseAt functionality
std::vector< std::string > preferredLanguagesList
void Stop(void)
Stop playback and release resources.
void SendHTTPHeaderResponse()
Generate http header response event.
bool IsLiveStream(void)
Check if stream is live.
Structure of X-Start HLS Tag.
struct SpeedCache * GetLLDashSpeedCache()
Gets Speed Cache.
int(* IdleTask)(void *arg)
Function pointer for the idle task.
std::string GetTextTrackInfo()
Get current audio track index.
double availabilityTimeOffset
void SetDownloadStartTimeout(long startTimeout)
To set the curl download start timeout value.
void TeardownStream(bool newTune)
Terminate the stream.
ContentType GetContentType() const
Get Content Type.
void SendId3MetadataEvent(Id3CallbackData *id3Metadata)
Sends an ID3 metadata event.
AampScheduler * mScheduler
@ eDASH_RECONFIGURE_FOR_ENC_PERIOD
void SetWesterosSinkConfig(bool bValue)
Set Westeros sink Configuration.
void UpdateDuration(double seconds)
Update playlist duration.
void SendStreamCopy(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double fDuration)
API to send audio/video stream into the sink.
void InsertAd(const char *url, double positionSeconds)
Insert ad content.
Data structure to hold a VTT cue.
const std::tuple< std::string, std::string > ExtractDrmInitData(const char *url)
Extract DRM init data from the provided URL If present, the init data will be removed from the return...
AAMPTuneFailure
AAMP playback error codes.
void SetStallTimeout(int timeoutMS)
Set stall timeout.
void SetCallbackAsDispatched(guint id)
Set an idle callback as event dispatched state.
void SetInitialBitrate4K(long bitrate4K)
To set the initial bitrate value for 4K assets.
void NotifyFirstVideoFrameDisplayed()
Notify First Video Frame was displayed.
void FoundEventBreak(const std::string &adBreakId, uint64_t startMS, EventBreakInfo brInfo)
Notification from the stream abstraction that a new SCTE35 event is found.
void ReportID3Metadata(MediaType mediaType, const uint8_t *ptr, uint32_t len, const char *schemeIdURI=NULL, const char *id3Value=NULL, uint64_t presTime=0, uint32_t id3ID=0, uint32_t eventDur=0, uint32_t tScale=0, uint64_t tStampOffset=0)
Report ID3 metadata events.
std::string preferredTextTypeString
void SetPersistedProfileIndex(int profile)
Set persisted profile index.
std::string GetLicenseCustomData()
Get License Custom Data.
pthread_mutex_t mFragmentCachingLock
std::string GetAppName()
Get the application name.
std::string preferredLabelsString
@ PROFILE_BUCKET_INIT_AUDIO
bool IsLive(void)
Checking if the stream is live or not.
Stores the detail about the Event break info.
void SetLinearTrickplayFPS(int linearTrickplayFPS)
Set frames per second for linear trickplay.
void SetAvgBWForABR(bool useAvgBW)
Indicates average BW to be used for ABR Profiling.
std::string GetPreferredAudioProperties()
get the current audio preference set by user
bool IsLiveAdjustRequired()
Check if Live Adjust is required for current content. ( For "vod/ivod/ip-dvr/cdvr/eas",...
bool TryStreamLock()
try to acquire streamsink lock
bool IsPlayEnabled()
Check if autoplay enabled for current stream.
AudioType
Type of audio ES for MPD.
bool IsAuxiliaryAudioEnabled(void)
To check if auxiliary audio is enabled.
void NotifySpeedChanged(float rate, bool changeState=true)
Notify speed change event to listeners.
bool mFragmentCachingRequired
bool IsOTAContent()
Checking whether OTA content or not.
int mCurrentLanguageIndex
bool mLogTimetoTopProfile
static gint AddHighIdleTask(IdleTask task, void *arg, DestroyTask dtask=NULL)
Add high priority idle task to the gstreamer.
@ eDASH_LOW_LATENCY_INPUT_PROTECTION_ERROR
bool DiscontinuitySeenInAllTracks()
Check if discontinuity processed in all tracks.
void SetVideoTracks(std::vector< long > bitrateList)
set birate for video tracks selection
void AdditionalTuneFailLogEntries()
Additional log entries to assist with tune failure diagnostics.
void SendAdPlacementEvent(AAMPEventType type, const std::string &adId, uint32_t position, uint32_t adOffset, uint32_t adDuration, bool immediate=false, long error_code=0)
Send Ad placement event.
long long GetPositionMs(void)
Get current stream position.
int ScheduleAsyncTask(IdleTask task, void *arg, std::string taskName="")
Add async task to scheduler.
void SendBlockedEvent(const std::string &reason)
Generate Blocked event based on args passed.
void LoadAampAbrConfig(void)
-To Load needed config from player to aampabr
void CollectCMCDCustomHeaders(MediaType fileType, class CMCDHeaders *pCMCDMetrics)
Collect and send all key-value pairs for CMCD headers.
char mLanguageList[16][42]
@ eAAMPSTATUS_INVALID_PLAYLIST_ERROR
long long getUpdateTime() const
The timestamp at which the position in this object was updated (0 by deault)
A readonly, validatable position value.
long LoadFogConfig(void)
LoadFogConfig - Load needed player Config to Fog.
LangCodePreference GetLangCodePreference()
Get Language preference from aamp.cfg.
void SetIsLiveStream(bool isLiveStream)
Set isLiveStream flag.
unsigned long long GetBasePTS()
Return BasePTS - for non-HLS/TS streams this will be zero.
GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.
void GetPlayerVideoSize(int &w, int &h)
Get player video size.
Holds the Thumbnail information.
bool CheckABREnabled(void)
Check if ABR enabled for this playback session.
bool GetAsyncTuneConfig()
Get async tune configuration.
void ResetDiscontinuityInTracks()
Reset discontinuity flag for all tracks.
long mPlaylistFetchFailError
void SetTuneEventConfig(TunedEventConfig tuneEventType)
to set the vod-tune-event according to the player
long GetIframeBitrate4K()
Get Default Iframe bitrate 4K value.
AampCurlInstance
Enumeration for Curl Instances.
static bool IsActiveInstancePresent()
Check if any active PrivateInstanceAAMP available.
void ConfigureParallelFetch()
To set the parallel playlist fetch configuration.
void ConfigureBulkTimedMetadata()
To set bulk timedMetadata reporting.
Structure of GrowableBuffer.
void SetInitialBufferDuration(int durationSec)
Set initial buffer duration in seconds.
void FlushLastId3Data(MediaType mediaType)
Flush last saved ID3 metadata.
Class representing the AAMP player's private instance, which is not exposed to outside world.
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
void StoreLanguageList(const std::set< std::string > &langlist)
Storing audio language list.
uint32_t GetAudTimeScale(void)
Gets Audio TimeScale.
void StopBuffering(bool forceStop)
Stop buffering in AAMP and un-pause pipeline.
double getSeekPositionSec() const
seek_pos_seconds value supplied when this object was created (-1 default)
void NotifyFirstVideoPTS(unsigned long long pts, unsigned long timeScale=90000)
Receives first video PTS of the current playback.
Handles Aamp Cahe operations.
double mNextPeriodScaledPtoStartTime
Class to hold audio information like lang, codec, bitrate,etc.
void SetLicenseReqProxy(const char *licenseProxy)
To set the proxy for license request.
void AddListenerForAllEvents(EventListener *eventListener)
AddListenerForAllEvents - Register one listener for all events.
void BlockUntilGstreamerWantsData(void(*cb)(void), int periodMs, int track)
Block the injector thread until the gstreanmer needs buffer/more data.
pthread_cond_t waitforplaystart
bool IsFirstVideoFrameDisplayedRequired()
Check if First Video Frame Displayed Notification is required.
void SyncEnd(void)
GStreamer operation end.
void SendErrorEvent(AAMPTuneFailure tuneFailure, const char *description=NULL, bool isRetryEnabled=true, int32_t secManagerClassCode=-1, int32_t secManagerReasonCode=-1, int32_t secClientBusinessStatus=-1)
Handles errors and sends events to application if required. For download failures,...
void SetManifestUrl(const char *url)
Set manifest URL.
ProfilerBucketType mediaType2Bucket(MediaType fileType)
Convert media file type to profiler bucket type.
AampCurlInstance GetPlaylistCurlInstance(MediaType type, bool IsInitDnld=true)
GetPlaylistCurlInstance - Function to return the curl instance for playlist download Considers parall...
void SetAuxiliaryLanguage(const std::string &language)
Set auxiliary language.
void RemoveListenerForAllEvents(EventListener *eventListener)
RemoveListenerForAllEvents - Remove listener for all events.
@ eAAMPSTATUS_MANIFEST_DOWNLOAD_ERROR
void UnlockGetPositionMilliseconds()
Unlock GetPositionMilliseconds()
void ConfigureRetuneForGSTInternalError()
To set retune configuration for gstpipeline internal data stream error.
void AddCustomHTTPHeader(std::string headerName, std::vector< std::string > headerValue, bool isLicenseHeader)
Add/Remove a custom HTTP header and value.
void CurlTerm(AampCurlInstance startIdx, unsigned int instanceCount=1)
Terminate curl contexts.
bool GetCCStatus(void)
Get CC visibility on/off.
void SetLicenseCaching(bool bValue)
Set license caching.
double mOffsetFromTunetimeForSAPWorkaround
bool IsAudioLanguageSupported(const char *checkLanguage)
Checking whether audio language supported.
bool availabilityTimeComplete
MediaFormat GetMediaFormatType(const char *url)
Assign the correct mediaFormat by parsing the url.
long GetIframeBitrate()
Get Default Iframe bitrate value.
bool PausePipeline(bool pause, bool forceStopGstreamerPreBuffering)
To change the the gstreamer pipeline to pause/play.
@ eDASH_LOW_LATENCY_MAX_CORRECTION_REACHED
ProfilerBucketType
Bucket types of AAMP profiler.
bool IsAudioOrVideoOnly(StreamOutputFormat videoFormat, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat)
To check for audio/video only Playback.
@ eAAMPSTATUS_PLAYLIST_AUDIO_DOWNLOAD_ERROR
AAMPStatusType
AAMP Function return values.
class CDAIObject * mCdaiObject
void UpdateProfileCappedStatus(void)
updates profile capped status
pthread_cond_t mWaitForDiscoToComplete
void SendAnomalyEvent(AAMPAnomalyMessageType type, const char *format,...)
Sends Anomaly Error/warning messages.
void PauseSubtitleParser(bool pause)
pause/un-pause subtitles
void SetParallelPlaylistRefresh(bool bValue)
Set parallel playlist download config value for linear.
void LogDrmDecryptBegin(ProfilerBucketType bucketType)
Notifies profiler that decryption has started.
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
bool mbUsingExternalPlayer
@ eAAMPSTATUS_PLAYLIST_PLAYBACK
void StartPausePositionMonitoring(long long pausePositionMilliseconds)
start the PausePositionMonitoring thread used for PauseAt functionality
bool IsSubtitleEnabled(void)
To check if subtitles are enabled.
void ReportProgress(bool sync=true, bool beginningOfStream=false)
Report progress event to listeners.
AAMPEventType
Type of the events sending to the JSPP player.
long long aamp_GetCurrentTimeMS(void)
Get current time from epoch is milliseconds.
@ eAAMPConfig_EnableAccessAttributes
void SetReportVideoPTS(bool enabled)
Enable video PTS reporting in progress event.
void SetVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
TimedMetadata(long long timeMS, std::string name, std::string content, std::string id, double durMS)
TimedMetadata Constructor.
bool IsAudioPlayContextCreationSkipped(void)
Check if audio playcontext creation skipped for Demuxed HLS file.
void ConfigureWithLocalOptions()
Set local configurations to variables.
void ReloadTSB()
API Used to reload TSB with new session.
void SetPreCacheDownloadList(PreCacheUrlList &dnldListInput)
SetPreCacheDownloadList - Function to assign the PreCaching file list.
TuneType GetTuneType()
getTuneType Function to check what is the tuneType
To store video rectangle properties.
Structure for text track information Holds information about a text track in playlist.
std::string preferredRenditionString
std::vector< uint8_t > mcurrent_keyIdArray
std::string GetLicenseReqProxy()
To get the proxy for license request.
void ResetTrackDiscontinuityIgnoredStatus(void)
Reset discontinuity ignored flag for audio and video tracks.
double GetFirstPTS()
Get PTS of first sample.
struct AampUrlInfo AampURLInfoStruct
Struct to store parsed url hostname & its type.
void SetBulkTimedMetaReport(bool bValue)
Set Bulk TimedMetadata Reporting flag.
bool IsSinkCacheEmpty(MediaType mediaType)
Check sink cache empty.
ContentType
Asset's content types.
bool SendVideoEndEvent()
Send VideoEndEvent.
std::string mAuxAudioLanguage
Base class for the client side DAI object.
void ResumeTrackInjection(MediaType type)
Resume injection for a track. Called from StartInjection.
AampEventManager * mEventManager
void SetPreferredDRM(DRMSystems drmType)
Set Preferred DRM.
void SetEventPriorityAsyncTune(bool bValue)
Set async tune configuration for EventPriority.
void SetLLDashSpeedCache(struct SpeedCache &speedCache)
Sets Speed Cache.
bool DownloadsAreEnabled(void)
Check if downloads are enabled.
void SetUtcTime(time_t time)
Set Utc Time.
int HandleSSLProgressCallback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
HandleSSLProgressCallback - Process progress callback from CURL.
void GetCustomLicenseHeaders(std::unordered_map< std::string, std::vector< std::string >> &customHeaders)
To get any custom license HTTP headers that was set by application.
long long GetVideoPTS(bool bAddVideoBasePTS)
Report progress event.
bool mApplyCachedVideoMute
void SetMaximumBitrate(long bitrate)
Set maximum bitrate value.
~PrivateInstanceAAMP()
PrivateInstanceAAMP Destructor.
void NotifyFragmentCachingComplete()
Notify fragment caching complete.
std::shared_ptr< AampDrmHelper > GetCurrentDRM()
Get current drm.
void FlushStreamSink(double position, double rate)
Sending a flushing seek to stream sink with given position.
void UnblockWaitForDiscontinuityProcessToComplete(void)
unblock wait for Discontinuity handling complete
bool IsMuxedStream()
Check if current stream is muxed.
AAMPAnomalyMessageType
AAMP anomaly message types.
DRMSystems
DRM system types.
bool GetPauseOnFirstVideoFrameDisp(void)
GetPauseOnFirstVideoFrameDisplay.
@ eAAMPSTATUS_MANIFEST_INVALID_TYPE
@ eAAMPSTATUS_FAKE_TUNE_COMPLETE
void DisableDownloads(void)
abort ongoing downloads and returns error on future downloads called while stopping fragment collecto...
void EndTimeReached(MediaType mediaType)
Clip ended.
void NotifyVideoBasePTS(unsigned long long basepts, unsigned long timeScale=90000)
Notifies base PTS of the HLS video playback.
void LogFirstFrame(void)
Notifies profiler that first frame is presented.
void SetCCStatus(bool enabled)
Set CC visibility on/off.
std::string getStreamTypeString()
Get stream type as printable format.
void NotifyFirstFragmentDecrypted()
Notify the decryption completion of the fist fragment.
void EnableContentRestrictions()
Enable Content Restrictions - lock.
AampLLDashServiceData * GetLLDashServiceData(void)
Gets Low Latency Service Data.
@ eSTALL_AFTER_DISCONTINUITY
@ eAAMPSTATUS_MANIFEST_CONTENT_ERROR
void SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
Setting the alternate contents' (Ads/blackouts) URL.
std::string GetAvailableTextTracks(bool alltrack=false)
Get available text tracks.
void SetAudTimeScale(uint32_t audTimeScale)
Sets Low Audio TimeScale.
@ eAAMPConfig_PersistentBitRateOverSeek
int GetTextTrack()
Get current text track index.
double GetPositionSeconds(void)
void LazilyLoadConfigIfNeeded(void)
Load the configuration lazily.
void ScheduleEvent(struct AsyncEventDescriptor *e)
Schedule Event.
void SetLowLatencyServiceConfigured(bool bConfig)
Set Low Latency Service Configuration Status.
Data type to store Accessibility Node data.
void SendDRMMetaData(DrmMetaDataEventPtr e)
Send DRM metadata event.
void EnableDownloads(void)
Enable downloads after aamp_DisableDownloads. Called after stopping fragment collector thread.
std::string GetPreferredTextProperties()
get the current text preference set by user
bool GetFile(std::string remoteUrl, struct GrowableBuffer *buffer, std::string &effectiveUrl, long *http_error=NULL, double *downloadTime=NULL, const char *range=NULL, unsigned int curlInstance=0, bool resetBuffer=true, MediaType fileType=eMEDIATYPE_DEFAULT, long *bitrate=NULL, int *fogError=NULL, double fragmentDurationSec=0, class CMCDHeaders *pCMCDMetrics=NULL)
Download a file from the CDN.
int32_t lastId3DataLen[eMEDIATYPE_DEFAULT]
void SetLLDashServiceData(AampLLDashServiceData &stAampLLDashServiceData)
Sets Low Latency Service Data.
const char * MediaTypeString(MediaType fileType)
get Media Type in string
void SetPreCacheTimeWindow(int nTimeWindow)
SetPreCacheTimeWindow Function to Set PreCache Time.
bool IsFirstRequestToFog()
IsFirstRequestToFog Function to check first reqruest to fog.
void NotifyOnEnteringLive()
Notify when entering live point to listeners.
bool IsWideVineKIDWorkaround(const std::string url)
get the SkyDE Store workaround
void StopTrackInjection(MediaType type)
Stop injection for a track. Called from StopInjection.
std::string GetVssVirtualStreamID() const
pass virtual stream ID
@ eAAMPSTATUS_MANIFEST_PARSE_ERROR
std::string GetServiceZone() const
pass service zone, extracted from locator &sz URI parameter
std::string GetAudioTrackInfo()
Get current audio track index.
ContentGapInfo(long long timeMS, std::string id, double durMS)
ContentGapInfo Constructor.
LangCodePreference
Language Code Preference types.
bool mProfileCappedStatus
void SetAppName(std::string name)
Set the application name which has created PlayerInstanceAAMP, for logging purposes.
CurlAbortReason
Http Header Type.
volatile std::atomic< long long > mPausePositionMilliseconds
bool isPositionValid(const double LatestSeekPosSeconds) const
Returns true if the value returned by Position() is valid.
double mAbsoluteEndPosition
Class for Content gap information.
void ResumeTrackDownloads(MediaType type)
Resume downloads for a track. Called from StreamSink to control flow.
void SendMessageOverPipe(const char *str, int nToWrite)
Send messages to Receiver over PIPE.
@ eGST_ERROR_VIDEO_BUFFERING
void SendBufferChangeEvent(bool bufferingStopped=false)
Sends UnderFlow Event messages.
char * LoadFragment(ProfilerBucketType bucketType, std::string fragmentUrl, std::string &effectiveUrl, size_t *len, unsigned int curlInstance=0, const char *range=NULL, long *http_code=NULL, double *downloadTime=NULL, MediaType fileType=eMEDIATYPE_MANIFEST, int *fogError=NULL)
Fetch a file from CDN and update profiler.
double GetLLDashCurrentPlayBackRate(void)
Gets Low Latency current play back rate.
bool mJumpToLiveFromPause
void UpdateVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
ProfilerBucketType GetProfilerBucketForMedia(MediaType mediaType, bool isInitializationSegment)
Get profiler bucket type.
void SetIsLive(bool isLive)
Set is Live flag.
pthread_mutex_t mMutexPlaystart
void NotifyBitRateChangeEvent(int bitrate, BitrateChangeReason reason, int width, int height, double framerate, double position, bool GetBWIndex=false, VideoScanType scantype=eVIDEOSCAN_UNKNOWN, int aspectRatioWidth=0, int aspectRatioHeight=0)
Notify bit rate change event to listeners.
@ eCURLINSTANCE_MANIFEST_PLAYLIST
bool SetStateBufferingIfRequired()
Set eSTATE_BUFFERING if required.
void UpdateLiveOffset()
UpdateLiveOffset live offset [Sec].
std::string mSessionToken
pthread_mutex_t mEventLock
void ResumeDownloads()
Resume downloads of all tracks. Used by aamp internally to manage states.
void ConfigureNetworkTimeout()
To set the network timeout as per priority.
bool GetLLDashAdjustSpeed(void)
Gets the state of the player speed correction for Low latency Dash.
AampLLDashServiceData mAampLLDashServiceData
void PreCachePlaylistDownloadTask()
PreCachePlaylistDownloadTask Thread function for PreCaching Playlist.
void SetPropagateUriParameters(bool bValue)
Configure URI parameters.
long GetPersistedBandwidth()
Get persisted bandwidth.
void detach()
Soft stop the player instance.
void AddEventListener(AAMPEventType eventType, EventListener *eventListener)
Add listener to aamp events.
int mCurrentTextTrackIndex
bool ProcessPendingDiscontinuity()
Process pending discontinuity and continue playback of stream after discontinuity.
void IncrementGaps()
To increment gaps between periods for dash return none.
bool IsNewTune()
IsNewTune Function to check if tune is New tune or retune.
bool IsBitRatePersistedOverSeek()
Get config for ABR profile persitenace over Seek/Audio Chg.