DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Macros | Typedefs | Enumerations | Functions
stbpes.c File Reference

PES collection task, pieces together PES fragments to form completed packet and place in an appropriate queue. More...

#include <string.h>
#include <techtype.h>
#include <dbgfuncs.h>
#include "stbhwos.h"
#include "stbhwdmx.h"
#include "stbheap.h"
#include "stbpes.h"
#include "stbdpc.h"

Macros

#define PES_COLL_TASK_STACK_SIZE   1024 * 4
 
#define PES_COLLECTION_PRIORITY   STB_TPID_CBUFF_PRIORITY - 1
 
#define PES_HDR_DATA_LEN_BYTE   0x08
 
#define FIXED_BUFFER_LENGTH   8192L
 
#define STB_PES_COLLECTION_PRINT(x)
 

Typedefs

typedef enum e_pes_state E_PES_STATE
 
typedef struct s_pes_request S_PES_REQUEST
 

Enumerations

enum  e_pes_state {
  LOOKING_PREFIX_BYTE_ONE, LOOKING_PREFIX_BYTE_TWO, LOOKING_PREFIX_CODE_THREE, LOOKING_STREAM_ID,
  LOOKING_LENGTH_BYTE_ONE, LOOKING_LENGTH_BYTE_TWO, LOOKING_FOR_END
}
 

Functions

void STB_PesCollectionTaskInitialise (void)
 Initialises the PES collection task.
 
void STB_FlushPesCollectionTask (void)
 Flushes the PES collection task.
 
void STB_ChangePesCollectionPID (U8BIT path, U16BIT text_pid)
 Changes the PID that the DMX is using to gather data on.
 
U32BIT STB_RegisterPesCollectionCallback (void(*callback_function)(U32BIT, U8BIT, void *, U32BIT), U8BIT lowest_data_identifier, U8BIT highest_data_identifier)
 Used to register a callback function that will receive specific PES data packets. In theory, an unlimited number of callbacks can be registered, and each will be sent data irrespective of other callback requests. The returned handle can be used in conjunction with STB_UnregisterPesCollectionCallback to remove the callback from this task's functionality. More...
 
void STB_UnregisterPesCollectionCallback (U32BIT handle)
 Used to un-register a callback function that will receive specific PES data packets. More...
 

Detailed Description

PES collection task, pieces together PES fragments to form completed packet and place in an appropriate queue.

Date
04/02/2004
Author
Ocean Blue

Function Documentation

U32BIT STB_RegisterPesCollectionCallback ( void(*)(U32BIT, U8BIT, void *, U32BIT)  callback_function,
U8BIT  lowest_data_identifier,
U8BIT  highest_data_identifier 
)

Used to register a callback function that will receive specific PES data packets. In theory, an unlimited number of callbacks can be registered, and each will be sent data irrespective of other callback requests. The returned handle can be used in conjunction with STB_UnregisterPesCollectionCallback to remove the callback from this task's functionality.

This function is anticipated only to be called from other STB functionality.

Parameters
callback_function- a pointer to a correspondingly profiled function that will recieve specific PES data packets as they arrive. The parameters returned to the callback are as follows:
U32BIT- the handle associated with this initialisation request. This can be used to call () from within the callback if required.
U8BIT- the data identifier of the supplied packet. This is useful to differentiate packets within the callback if a range of data identifier types is requested.
void*- a pointer to the PES data packet.
U32BIT- the width (in bytes) of the data packet supplied.
                       NB - the callback MUST NOT free the memory supplied by the void*
                            reference, and MUST allocate it's own copy if it requires data
                            persistance.
U8BITlowest_data_identifier -
U8BIThighest_data_identifier - used to specify the PES data content being passed to the callback funtion. These paramaters can be set to the same value if data from a single identifier is required.
Returns
U32BIT - a unique handle to the PES callback request, or zero of failed.
void STB_UnregisterPesCollectionCallback ( U32BIT  handle)

Used to un-register a callback function that will receive specific PES data packets.

This function is anticipated only to be called from other STB functionality.

Parameters
U32BIThandle - a unique handle to the PES callback request made in a prior call to STB_RegisterPesCollectionCallback( ) that is to be removed from the PES collection functionality.