MHEG5  15.3.0
source/ics/src/stmr_dl.h File Reference

IC Streamer download manager. More...

#include "techtype.h"
#include "dvb_ics.h"
#include "stmr_util.h"
#include "mh5profile.h"
#include "stmr_header.h"

Go to the source code of this file.

Data Structures

struct  sMHEG5HttpStreamRequest

Typedefs

typedef struct
sMHEG5HttpStreamRequest 
MHEG5HttpStreamRequest

Functions

U32BIT MHEG5CreateDownloadRequest (U32BIT requestId, char *url, U64BIT rangeFrom, U64BIT rangeTo, BOOLEAN lastRequest)
 Create HTTP download request.
void MHEG5StartDownloadRequest (U32BIT downloadId)
 Start HTTP download request.
BOOLEAN MHEG5DownloadPositionPartial (U32BIT downloadId, U64BIT *position)
 Return what is current position of download request.
U8BIT * MHEG5GetDownloadRedirect (U32BIT downloadId)
 Return the redirection URL for a request that was redirected (HTTP status 3xx).
U64BIT MHEG5GetDownloadContentLength (U32BIT downloadId, U64BIT contentLength)
 Return content length (in bytes) for download request. The content length may be: 1. The length value from Content-Range 2. The value of Content-Length 3. Invalid value (if not available)
void MHEG5CopyDownloadBitrate (U32BIT downloadId, U32BIT *bytesPerSecond)
 Copy download bitrate that was obtained from the headers. If the X-BytesPerSecond header were not received, the bitrate is not updated.
void MHEG5CopyDownloadStreamKeyInfo (U32BIT downloadId, S_ICSKeys *keys, MHEG5String *keyLocation)
 Copy any keys or key location that were obtained from the headers. If such keys or location exist, they are also cleared from the download request (i.e. ownership is transferred to the caller). In addition, the caller keys and key location are also cleared. If such keys or key location does not exist, the function does not overwrite the caller's keys or key location.
BOOLEAN MHEG5GetDownloadPmt (U32BIT downloadId, U8BIT *pmt)
 Return program map table (PMT) for download (if available). The table is provided as a complete section, including table_id and CRC_32.
void MHEG5ResumeDownload (void)
 Resume download of the active request. Download may or may not have been paused due to the buffer being full.
void MHEG5ClearDownloadThrottling (void)
 Clear information about throttling, causing the download to proceed at full speed (until throttling kicks in again).
void MHEG5StopDownloadRequest (U32BIT downloadId)
 Stop HTTP download request.
void MHEG5StopDownloadRequestAsync (U32BIT downloadId)
 Stop HTTP download request asynchronously. This function should be used when the caller wants to stop the download from one of the callbacks. In that case the download will be paused and notified as complete. The caller can then handle the event and stop/destroy the request.
void MHEG5DestroyDownloadRequest (U32BIT downloadId)
 Destroy HTTP download request.
void MHEG5ClearDownloadRequest (U32BIT downloadId)
 Clear HTTP download request.
void MHEG5RenewDownloadRequest (U32BIT downloadId, char *url)
 Renew HTTP download request.

Detailed Description

IC Streamer download manager.

Date:
20/12/2012
Author:
Adam Sturtridge

Function Documentation

void MHEG5ClearDownloadRequest ( U32BIT  downloadId)

Clear HTTP download request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing

Clear information about throttling, causing the download to proceed at full speed (until throttling kicks in again).

Returns:
Nothing
void MHEG5CopyDownloadBitrate ( U32BIT  downloadId,
U32BIT *  bytesPerSecond 
)

Copy download bitrate that was obtained from the headers. If the X-BytesPerSecond header were not received, the bitrate is not updated.

Parameters:
downloadIdDownload request ID
bytesPerSecondStream bitrate (bytes per second)
Returns:
Nothing
void MHEG5CopyDownloadStreamKeyInfo ( U32BIT  downloadId,
S_ICSKeys keys,
MHEG5String keyLocation 
)

Copy any keys or key location that were obtained from the headers. If such keys or location exist, they are also cleared from the download request (i.e. ownership is transferred to the caller). In addition, the caller keys and key location are also cleared. If such keys or key location does not exist, the function does not overwrite the caller's keys or key location.

Parameters:
downloadIdDownload request ID
keyLocationKey location (if any)
Returns:
Nothing
Parameters:
downloadIdDownload request ID
keysKeys (if any)
keyLocationKey location (if any)
Returns:
Nothing
U32BIT MHEG5CreateDownloadRequest ( U32BIT  requestId,
char *  url,
U64BIT  rangeFrom,
U64BIT  rangeTo,
BOOLEAN  lastRequest 
)

Create HTTP download request.

Parameters:
requestIdRequest ID to be stored with downloaded items
urlURL for request
rangeFromRange from in bytes (0 for "start")
rangeToRange to in bytes (invalid for "end")
lastRequestWhether this is the last request for this URL
Returns:
Donwload ID (non-zero) if request was created, 0 (zero) otherwise
void MHEG5DestroyDownloadRequest ( U32BIT  downloadId)

Destroy HTTP download request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing
BOOLEAN MHEG5DownloadPositionPartial ( U32BIT  downloadId,
U64BIT position 
)

Return what is current position of download request.

Parameters:
downloadIdDownload request ID
positioncurrent position (downloaded bytes)
Returns:
TRUE if position is only partial download
U64BIT MHEG5GetDownloadContentLength ( U32BIT  downloadId,
U64BIT  contentLength 
)

Return content length (in bytes) for download request. The content length may be: 1. The length value from Content-Range 2. The value of Content-Length 3. Invalid value (if not available)

Parameters:
downloadIdDownload request ID
contentLengthContent length in bytes
Returns:
Content length in bytes
BOOLEAN MHEG5GetDownloadPmt ( U32BIT  downloadId,
U8BIT *  pmt 
)

Return program map table (PMT) for download (if available). The table is provided as a complete section, including table_id and CRC_32.

Parameters:
downloadIdDownload request ID
pmtStorage area for PMT (1024 bytes)
Returns:
TRUE if PMT is available, FALSE otherwise
U8BIT* MHEG5GetDownloadRedirect ( U32BIT  downloadId)

Return the redirection URL for a request that was redirected (HTTP status 3xx).

Parameters:
downloadIdDownload request ID
Returns:
Redirection URL or NULL
void MHEG5RenewDownloadRequest ( U32BIT  downloadId,
char *  url 
)

Renew HTTP download request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing
void MHEG5ResumeDownload ( void  )

Resume download of the active request. Download may or may not have been paused due to the buffer being full.

Returns:
Nothing
void MHEG5StartDownloadRequest ( U32BIT  downloadId)

Start HTTP download request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing
void MHEG5StopDownloadRequest ( U32BIT  downloadId)

Stop HTTP download request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing
void MHEG5StopDownloadRequestAsync ( U32BIT  downloadId)

Stop HTTP download request asynchronously. This function should be used when the caller wants to stop the download from one of the callbacks. In that case the download will be paused and notified as complete. The caller can then handle the event and stop/destroy the request.

Parameters:
downloadIdDownload request ID
Returns:
Nothing
 All Data Structures Files Functions Variables Typedefs Defines