MHEG5  18.9.0
MHEG5 Documentation
Classes | Typedefs | Functions
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.

Classes

struct  sMHEG5HttpStreamRequest
 

Typedefs

typedef struct sMHEG5HttpStreamRequest MHEG5HttpStreamRequest
 

Functions

U32BIT MHEG5CreateDownloadRequest (U32BIT requestId, char *url, U64BIT rangeFrom, U64BIT rangeTo, BOOLEAN lastRequest)
 Create HTTP download request. More...
 
void MHEG5StartDownloadRequest (U32BIT downloadId)
 Start HTTP download request. More...
 
BOOLEAN MHEG5DownloadPositionPartial (U32BIT downloadId, U64BIT *position)
 Return what is current position of download request. More...
 
U8BITMHEG5GetDownloadRedirect (U32BIT downloadId)
 Return the redirection URL for a request that was redirected (HTTP status 3xx). More...
 
U64BIT MHEG5GetDownloadContentLength (U32BIT downloadId, U64BIT contentLength)
 Return content length (in bytes) for download request. The content length may be: More...
 
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. More...
 
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. More...
 
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. More...
 
void MHEG5ResumeDownload (void)
 Resume download of the active request. Download may or may not have been paused due to the buffer being full. More...
 
void MHEG5ClearDownloadThrottling (void)
 Clear information about throttling, causing the download to proceed at full speed (until throttling kicks in again). More...
 
void MHEG5StopDownloadRequest (U32BIT downloadId)
 Stop HTTP download request. More...
 
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. More...
 
void MHEG5DestroyDownloadRequest (U32BIT downloadId)
 Destroy HTTP download request. More...
 
void MHEG5ClearDownloadRequest (U32BIT downloadId)
 Clear HTTP download request. More...
 
void MHEG5RenewDownloadRequest (U32BIT downloadId, char *url)
 Renew HTTP download request. More...
 

Detailed Description

IC Streamer download manager.

Date
20/12/2012
Author
Adam Sturtridge

Definition in file stmr_dl.h.

Typedef Documentation

Function Documentation

void MHEG5ClearDownloadRequest ( U32BIT  downloadId)

Clear HTTP download request.

Parameters
downloadIdDownload request ID
Returns
Nothing

Definition at line 667 of file stmr_dl.c.

void MHEG5ClearDownloadThrottling ( void  )

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

Returns
Nothing

Definition at line 549 of file stmr_dl.c.

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

Definition at line 416 of file stmr_dl.c.

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

Definition at line 444 of file stmr_dl.c.

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

Definition at line 212 of file stmr_dl.c.

void MHEG5DestroyDownloadRequest ( U32BIT  downloadId)

Destroy HTTP download request.

Parameters
downloadIdDownload request ID
Returns
Nothing

Definition at line 627 of file stmr_dl.c.

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

Definition at line 359 of file stmr_dl.c.

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

Definition at line 394 of file stmr_dl.c.

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

Definition at line 501 of file stmr_dl.c.

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

Definition at line 337 of file stmr_dl.c.

void MHEG5RenewDownloadRequest ( U32BIT  downloadId,
char *  url 
)

Renew HTTP download request.

Parameters
downloadIdDownload request ID
Returns
Nothing

Definition at line 697 of file stmr_dl.c.

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

Definition at line 527 of file stmr_dl.c.

void MHEG5StartDownloadRequest ( U32BIT  downloadId)

Start HTTP download request.

Parameters
downloadIdDownload request ID
Returns
Nothing

Definition at line 317 of file stmr_dl.c.

void MHEG5StopDownloadRequest ( U32BIT  downloadId)

Stop HTTP download request.

Parameters
downloadIdDownload request ID
Returns
Nothing

Definition at line 584 of file stmr_dl.c.

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

Definition at line 609 of file stmr_dl.c.