RDK Documentation (Open Sourced RDK Components)
fragmentcollector_hls.cpp File Reference
#include "iso639map.h"
#include "fragmentcollector_hls.h"
#include "_base64.h"
#include "base16.h"
#include <algorithm>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "priv_aamp.h"
#include <pthread.h>
#include <signal.h>
#include <semaphore.h>
#include <math.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <openssl/sha.h>
#include <set>
#include <vector>
#include <string>
#include "HlsDrmBase.h"
#include "AampCacheHandler.h"
#include "webvttParser.h"
#include "SubtecFactory.hpp"
#include "tsprocessor.h"
#include "isobmffprocessor.h"
#include "AampUtils.h"
#include "AampVanillaDrmHelper.h"
Include dependency graph for fragmentcollector_hls.cpp:

Go to the source code of this file.

Data Structures

Macros

#define DRM_SHA1_HASH_LEN   40
 
#define IS_FOR_IFRAME(rate, type)   ((type == eTRACK_VIDEO) && (rate != AAMP_NORMAL_PLAY_RATE))
 
#define UseProgramDateTimeIfAvailable()   (ISCONFIGSET(eAAMPConfig_HLSAVTrackSyncUsingStartTime) || aamp->mIsVSS)
 

Functions

static size_t FindLineLength (const char *ptr)
 
static bool startswith (const char **pstring, const char *prefix)
 
static bool startswith (char **pstring, const char *prefix)
 
static bool AttributeNameMatch (const char *attrNamePtr, const char *targetAttrNameCString)
 
static bool SubStringMatch (const char *srcStart, const char *srcFin, const char *cstring)
 
static const char * GetAttributeValueString (char *valuePtr, char *fin)
 
static void ParseKeyAttributeCallback (char *attrName, char *delimEqual, char *fin, void *arg)
 
static void ParseTileInfCallback (char *attrName, char *delimEqual, char *fin, void *arg)
 
static void ParseXStartAttributeCallback (char *attrName, char *delimEqual, char *fin, void *arg)
 
static void ParseStreamInfCallback (char *attrName, char *delimEqual, char *fin, void *arg)
 
static void ParseMediaAttributeCallback (char *attrName, char *delimEqual, char *fin, void *arg)
 
static char * mystrpbrk (char *ptr)
 
static void ParseAttrList (char *attrName, void(*cb)(char *attrName, char *delim, char *fin, void *context), void *context)
 
static double ParseXStartTimeOffset (const char *ptr)
 
static void * TrackPLDownloader (void *arg)
 
static void InitiateDrmProcess (PrivateInstanceAAMP *aamp)
 
static void setupStreamInfo (struct HlsStreamInfo *streamInfo, int streamNo)
 
static double GetCompletionTimeForFragment (const TrackState *trackState, long long mediaSequenceNumber)
 
static char * GetNextLineStart (char *ptr)
 
static StreamOutputFormat GetFormatFromFragmentExtension (TrackState *trackState)
 
static void * CachePlaylistThreadFunction (void *This)
 
static void * FragmentCollector (void *arg)
 
static bool isThumbnailStream (const struct HlsStreamInfo *streamInfo)
 
static std::vector< TileInfoIndexThumbnails (char *ptr)
 

Variables

static const int DEFAULT_STREAM_WIDTH = 720
 
static const int DEFAULT_STREAM_HEIGHT = 576
 
static const double DEFAULT_STREAM_FRAMERATE = 25.0
 
static const ProfilerBucketType mediaTrackBucketTypes [4]
 Variable initialization for media profiler buckets. More...
 
static const ProfilerBucketType mediaTrackDecryptBucketTypes [4]
 Variable initialization for media decrypt buckets. More...
 

yes

Fragment Collect file includes class implementation for handling HLS streaming of AAMP player. Various functionality like manifest download , fragment collection, DRM initialization , synchronizing audio / video media of the stream, trick play handling etc are handled in this file .

Definition in file fragmentcollector_hls.cpp.


Data Structure Documentation

◆ DrmMetadata

struct DrmMetadata

AVE drm metadata extracted from EXT-X-FAXS-CM.

Definition at line 82 of file fragmentcollector_hls.cpp.

Collaboration diagram for DrmMetadata:
Collaboration graph
Data Fields
unsigned char * metadataPtr
size_t metadataSize

◆ DrmMetadataNode

struct DrmMetadataNode

Definition at line 87 of file fragmentcollector_hls.cpp.

Collaboration diagram for DrmMetadataNode:
Collaboration graph
Data Fields
DrmMetadata metaData
int deferredInterval
long long drmKeyReqTime
char * sha1Hash

Function Documentation

◆ ParseAttrList()

static void ParseAttrList ( char *  attrName,
void(*)(char *attrName, char *delim, char *fin, void *context)  cb,
void *  context 
)
static
Parameters
attrNamepointer to HLS Attribute List, as a NUL-terminated CString

Definition at line 606 of file fragmentcollector_hls.cpp.

Variable Documentation

◆ mediaTrackBucketTypes

const ProfilerBucketType mediaTrackBucketTypes[4]
static
Initial value:

Variable initialization for media profiler buckets.

Definition at line 112 of file fragmentcollector_hls.cpp.

◆ mediaTrackDecryptBucketTypes

const ProfilerBucketType mediaTrackDecryptBucketTypes[4]
static
Initial value:

Variable initialization for media decrypt buckets.

Definition at line 115 of file fragmentcollector_hls.cpp.

PROFILE_BUCKET_DECRYPT_AUDIO
@ PROFILE_BUCKET_DECRYPT_AUDIO
Definition: AampProfiler.h:63
PROFILE_BUCKET_FRAGMENT_VIDEO
@ PROFILE_BUCKET_FRAGMENT_VIDEO
Definition: AampProfiler.h:57
PROFILE_BUCKET_FRAGMENT_AUDIO
@ PROFILE_BUCKET_FRAGMENT_AUDIO
Definition: AampProfiler.h:58
PROFILE_BUCKET_DECRYPT_SUBTITLE
@ PROFILE_BUCKET_DECRYPT_SUBTITLE
Definition: AampProfiler.h:64
PROFILE_BUCKET_DECRYPT_VIDEO
@ PROFILE_BUCKET_DECRYPT_VIDEO
Definition: AampProfiler.h:62
PROFILE_BUCKET_FRAGMENT_SUBTITLE
@ PROFILE_BUCKET_FRAGMENT_SUBTITLE
Definition: AampProfiler.h:59
PROFILE_BUCKET_DECRYPT_AUXILIARY
@ PROFILE_BUCKET_DECRYPT_AUXILIARY
Definition: AampProfiler.h:65
PROFILE_BUCKET_FRAGMENT_AUXILIARY
@ PROFILE_BUCKET_FRAGMENT_AUXILIARY
Definition: AampProfiler.h:60