|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
89 static size_t StreamWriteCallback(
void *ptr,
size_t size,
size_t nmemb,
void *userdata )
94 if( context->aamp->mDownloadsEnabled)
97 AAMPLOG_INFO(
"StreamWriteCallback(%zu bytes)\n", nmemb);
102 double fDuration = 2.0;
106 if( !context->sentTunedEvent )
109 context->sentTunedEvent =
true;
115 AAMPLOG_WARN(
"write_callback - interrupted\n");
123 void StreamAbstractionAAMP_PROGRESSIVE::StreamFile(
const char *uri,
long *http_error )
128 AAMPLOG_INFO(
"StreamFile: %s\n", uri );
129 CURL *curl = curl_easy_init();
134 context.sentTunedEvent =
false;
136 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, StreamWriteCallback );
137 curl_easy_setopt(curl, CURLOPT_WRITEDATA, (
void *)&context );
138 curl_easy_setopt(curl, CURLOPT_URL, uri );
139 curl_easy_setopt(curl, CURLOPT_USERAGENT,
"aamp-progressive/1.0");
140 CURLcode res = curl_easy_perform(curl);
143 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
147 *http_error = http_code;
149 curl_easy_cleanup(curl);
159 std::string effectiveUrl;
164 StreamFile( contentUrl.c_str(), &http_error );
185 if(aamp_pthread_setname(pthread_self(),
"aampPSFetcher"))
187 AAMPLOG_WARN(
"aamp_pthread_setname failed\n");
190 context->FetcherLoop();
203 std::set<std::string> mLangList;
204 std::vector<long> bitrates;
228 fragmentCollectorThreadStarted(false), fragmentCollectorThreadID(0), seekPosition(seek_pos)
246 fragmentCollectorThreadStarted =
true;
254 if(fragmentCollectorThreadStarted)
258 int rc = pthread_join(fragmentCollectorThreadID, NULL);
261 AAMPLOG_WARN(
"***pthread_join failed, returned %d\n", rc);
263 fragmentCollectorThreadStarted =
false;
357 return std::vector<long>();
373 return std::vector<long>();
381 return std::vector<StreamInfo*>();
389 return std::vector<StreamInfo*>();
397 (void)thumbnailIndex;
404 return std::vector<ThumbnailData>();
void StopInjection(void) override
Stops injecting fragments to StreamSink.
void SetCurlTimeout(long timeout, AampCurlInstance instance)
Set curl timeout(CURLOPT_TIMEOUT)
void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxOutputFormat, StreamOutputFormat &subtitleOutputFormat) override
Get output format of stream.
bool SendTunedEvent(bool isSynchronous=true)
Send tuned event to listeners if required.
StreamOutputFormat
Media output format.
Structure holding the information of a stream.
bool IsInitialCachingSupported() override
check whether initial caching data supported
void InterruptableMsSleep(int timeInMs)
Sleep until timeout is reached or interrupted.
PrivateInstanceAAMP * aamp
Streamer for progressive mp3/mp4 playback.
void CurlInit(AampCurlInstance startIdx, unsigned int instanceCount=1, std::string proxyName="")
Curl initialization function.
bool SetThumbnailTrack(int) override
Function to set thumbnail track for processing.
void DumpProfiles(void) override
Stub implementation.
~StreamAbstractionAAMP_PROGRESSIVE()
StreamAbstractionAAMP_PROGRESSIVE Destructor.
int GetBWIndex(long bitrate) override
Get index of profile corresponds to bandwidth.
static void * FragmentCollector(void *arg)
Fragment collector thread.
std::string & GetManifestUrl(void)
Get manifest URL.
std::vector< long > GetVideoBitrates(void) override
To get the available video bitrates.
StreamAbstraction class of AAMP.
StreamInfo * GetStreamInfo(int idx) override
Get stream information of a profile from subclass.
double GetStartTimeOfFirstPTS() override
Get Start time PTS of first sample.
AAMPStatusType Init(TuneType tuneType) override
Initialize a newly created object.
std::vector< ThumbnailData > GetThumbnailRangeData(double, double, std::string *, int *, int *, int *, int *) override
void SendMediaMetadataEvent(void)
Generate media metadata event based on parsed attribute values.
TrackType
Media Track Types.
std::string GetNetworkProxy()
To get the network proxy.
Streamer for progressive mp3/mp4 playback.
void Stop(bool clearChannelData) override
Stops streaming.
std::vector< StreamInfo * > GetAvailableThumbnailTracks(void) override
To get the available thumbnail tracks.
Write call back functions for streamer.
StreamAbstractionAAMP_PROGRESSIVE(AampLogManager *logObj, class PrivateInstanceAAMP *aamp, double seekpos, float rate)
StreamAbstractionAAMP_PROGRESSIVE Constructor.
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.
long GetMaxBitrate(void) override
Gets Max Bitrate avialable for current playback.
Private functions and types used internally by AAMP.
void Start() override
Starts streaming.
std::vector< StreamInfo * > GetAvailableVideoTracks(void) override
To get the available video tracks.
AampCurlInstance
Enumeration for Curl Instances.
Class representing the AAMP player's private instance, which is not exposed to outside world.
void BlockUntilGstreamerWantsData(void(*cb)(void), int periodMs, int track)
Block the injector thread until the gstreanmer needs buffer/more data.
AAMPStatusType
AAMP Function return values.
double GetFirstPTS() override
Get PTS of first sample.
bool DownloadsAreEnabled(void)
Check if downloads are enabled.
void StartInjection(void) override
Start injecting fragments to StreamSink.
void DisableDownloads(void)
abort ongoing downloads and returns error on future downloads called while stopping fragment collecto...
std::vector< long > GetAudioBitrates(void) override
To get the available audio bitrates.
void EnableDownloads(void)
Enable downloads after aamp_DisableDownloads. Called after stopping fragment collector thread.
double GetBufferedDuration() override
Get the Buffered duration.
double GetStreamPosition() override
Get current stream position.
MediaTrack * GetMediaTrack(TrackType type) override
Return MediaTrack of requested type.
@ eAAMPConfig_UseAppSrcForProgressivePlayback
void FetcherLoop()
harvest chunks from large mp3/mp4