Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Data Structures | Macros | Functions
Ts2Pes.h File Reference
#include "Atomix.h"
#include "Ts2Packet.h"

Go to the source code of this file.

Data Structures

struct  TS2_PesHeaderExtension
 
struct  TS2_PesPacketHeader
 
struct  TS2_PesPacket
 
struct  TS2_PesPacketAssembler
 

Macros

#define TS2_PES_START_CODE_PREFIX   0x000001
 
#define TS2_PES_COMMON_HEADER_SIZE   3
 
#define TS2_PROGRAM_MAP_STREAM_ID   0xBC
 
#define TS2_PRIVATE_1_STREAM_ID   0xBD
 
#define TS2_PADDING_STREAM_ID   0xBE
 
#define TS2_PRIVATE_2_STREAM_ID   0xBF
 
#define TS2_ECM_STREAM_ID   0xF0
 
#define TS2_EMM_STREAM_ID   0xF1
 
#define TS2_DSMCC_STREAM_ID   0xF2
 
#define TS2_ISO_IEC_13522_STREAM_ID   0xF3
 
#define TS2_H222_1_TYPE_A_STREAM_ID   0xF4
 
#define TS2_H222_1_TYPE_B_STREAM_ID   0xF5
 
#define TS2_H222_1_TYPE_C_STREAM_ID   0xF6
 
#define TS2_H222_1_TYPE_D_STREAM_ID   0xF7
 
#define TS2_H222_1_TYPE_E_STREAM_ID   0xF8
 
#define TS2_PROGRAM_DIRECTORY_STREAM_ID   0xFF
 
#define TS2_PES_HEADER_EXTENSION_PRIVATE_DATA_LENGTH   16
 
#define TS2_IsStreamIdVideo(stream_id)   (((stream_id) & 0xE0) == 0xC0)
 
#define TS2_VideoStreamNumber(stream_id)   ((stream_id) & 0x1F)
 
#define TS2_IsStreamIdAudio(stream_id)   (((stream_id) & 0xF0) == 0xE0)
 
#define TS2_AudioStreamNumber(stream_id)   ((stream_id) & 0x0F)
 
#define TS2_PesHeader_ScramblingControl(hflags)   (((hflags) & 0x3000) >> 12)
 
#define TS2_PesHeader_PriorityFlag(hflags)   (((hflags) & 0x0800) >> 11)
 
#define TS2_PesHeader_AlignmentIndicator(hflags)   (((hflags) & 0x0400) >> 10)
 
#define TS2_PesHeader_Copyright(hflags)   (((hflags) & 0x0200) >> 9)
 
#define TS2_PesHeader_OriginalOrCopy(hflags)   (((hflags) & 0x0100) >> 8)
 
#define TS2_PesHeader_PtsDtsFlags(hflags)   (((hflags) & 0x00C0) >> 6)
 
#define TS2_PesHeader_EscrFlag(hflags)   (((hflags) & 0x0020) >> 5)
 
#define TS2_PesHeader_EsRateFlag(hflags)   (((hflags) & 0x0010) >> 4)
 
#define TS2_PesHeader_DsmTrickModeFlag(hflags)   (((hflags) & 0x0008) >> 3)
 
#define TS2_PesHeader_ExtraCopyInfoFlag(hflags)   (((hflags) & 0x0004) >> 2)
 
#define TS2_PesHeader_PesCrcFlag(hflags)   (((hflags) & 0x0002) >> 1)
 
#define TS2_PesHeader_ExtensionFlag(hflags)   (((hflags) & 0x0001) )
 
#define TS2_PesExtension_PrivateData(eflags)   (((eflags) & 0x80) )
 
#define TS2_PesExtension_PacketHeader(eflags)   (((eflags) & 0x40) )
 
#define TS2_PesExtension_SequenceCounter(eflags)   (((eflags) & 0x20) )
 
#define TS2_PesExtension_StdBuffer(eflags)   (((eflags) & 0x10) )
 
#define TS2_PesExtension_Flag2(eflags)   (((eflags) & 0x01) )
 

Functions

void TS2_PesPacket_Destroy (TS2_PesPacket *pp)
 
ATX_Result TS2_PesPacket_Unpack (TS2_PesPacketAssembler *assembler, const TS2_Packet *packet, TS2_PesPacket **packet_out)
 packet_out must be non-NULL. More...
 

Macro Definition Documentation

◆ TS2_AudioStreamNumber

#define TS2_AudioStreamNumber (   stream_id)    ((stream_id) & 0x0F)

◆ TS2_DSMCC_STREAM_ID

#define TS2_DSMCC_STREAM_ID   0xF2

◆ TS2_ECM_STREAM_ID

#define TS2_ECM_STREAM_ID   0xF0

◆ TS2_EMM_STREAM_ID

#define TS2_EMM_STREAM_ID   0xF1

◆ TS2_H222_1_TYPE_A_STREAM_ID

#define TS2_H222_1_TYPE_A_STREAM_ID   0xF4

◆ TS2_H222_1_TYPE_B_STREAM_ID

#define TS2_H222_1_TYPE_B_STREAM_ID   0xF5

◆ TS2_H222_1_TYPE_C_STREAM_ID

#define TS2_H222_1_TYPE_C_STREAM_ID   0xF6

◆ TS2_H222_1_TYPE_D_STREAM_ID

#define TS2_H222_1_TYPE_D_STREAM_ID   0xF7

◆ TS2_H222_1_TYPE_E_STREAM_ID

#define TS2_H222_1_TYPE_E_STREAM_ID   0xF8

◆ TS2_ISO_IEC_13522_STREAM_ID

#define TS2_ISO_IEC_13522_STREAM_ID   0xF3

◆ TS2_IsStreamIdAudio

#define TS2_IsStreamIdAudio (   stream_id)    (((stream_id) & 0xF0) == 0xE0)

◆ TS2_IsStreamIdVideo

#define TS2_IsStreamIdVideo (   stream_id)    (((stream_id) & 0xE0) == 0xC0)

◆ TS2_PADDING_STREAM_ID

#define TS2_PADDING_STREAM_ID   0xBE

◆ TS2_PES_COMMON_HEADER_SIZE

#define TS2_PES_COMMON_HEADER_SIZE   3

◆ TS2_PES_HEADER_EXTENSION_PRIVATE_DATA_LENGTH

#define TS2_PES_HEADER_EXTENSION_PRIVATE_DATA_LENGTH   16

◆ TS2_PES_START_CODE_PREFIX

#define TS2_PES_START_CODE_PREFIX   0x000001

◆ TS2_PesExtension_Flag2

#define TS2_PesExtension_Flag2 (   eflags)    (((eflags) & 0x01) )

◆ TS2_PesExtension_PacketHeader

#define TS2_PesExtension_PacketHeader (   eflags)    (((eflags) & 0x40) )

◆ TS2_PesExtension_PrivateData

#define TS2_PesExtension_PrivateData (   eflags)    (((eflags) & 0x80) )

◆ TS2_PesExtension_SequenceCounter

#define TS2_PesExtension_SequenceCounter (   eflags)    (((eflags) & 0x20) )

◆ TS2_PesExtension_StdBuffer

#define TS2_PesExtension_StdBuffer (   eflags)    (((eflags) & 0x10) )

◆ TS2_PesHeader_AlignmentIndicator

#define TS2_PesHeader_AlignmentIndicator (   hflags)    (((hflags) & 0x0400) >> 10)

◆ TS2_PesHeader_Copyright

#define TS2_PesHeader_Copyright (   hflags)    (((hflags) & 0x0200) >> 9)

◆ TS2_PesHeader_DsmTrickModeFlag

#define TS2_PesHeader_DsmTrickModeFlag (   hflags)    (((hflags) & 0x0008) >> 3)

◆ TS2_PesHeader_EscrFlag

#define TS2_PesHeader_EscrFlag (   hflags)    (((hflags) & 0x0020) >> 5)

◆ TS2_PesHeader_EsRateFlag

#define TS2_PesHeader_EsRateFlag (   hflags)    (((hflags) & 0x0010) >> 4)

◆ TS2_PesHeader_ExtensionFlag

#define TS2_PesHeader_ExtensionFlag (   hflags)    (((hflags) & 0x0001) )

◆ TS2_PesHeader_ExtraCopyInfoFlag

#define TS2_PesHeader_ExtraCopyInfoFlag (   hflags)    (((hflags) & 0x0004) >> 2)

◆ TS2_PesHeader_OriginalOrCopy

#define TS2_PesHeader_OriginalOrCopy (   hflags)    (((hflags) & 0x0100) >> 8)

◆ TS2_PesHeader_PesCrcFlag

#define TS2_PesHeader_PesCrcFlag (   hflags)    (((hflags) & 0x0002) >> 1)

◆ TS2_PesHeader_PriorityFlag

#define TS2_PesHeader_PriorityFlag (   hflags)    (((hflags) & 0x0800) >> 11)

◆ TS2_PesHeader_PtsDtsFlags

#define TS2_PesHeader_PtsDtsFlags (   hflags)    (((hflags) & 0x00C0) >> 6)

◆ TS2_PesHeader_ScramblingControl

#define TS2_PesHeader_ScramblingControl (   hflags)    (((hflags) & 0x3000) >> 12)

◆ TS2_PRIVATE_1_STREAM_ID

#define TS2_PRIVATE_1_STREAM_ID   0xBD

◆ TS2_PRIVATE_2_STREAM_ID

#define TS2_PRIVATE_2_STREAM_ID   0xBF

◆ TS2_PROGRAM_DIRECTORY_STREAM_ID

#define TS2_PROGRAM_DIRECTORY_STREAM_ID   0xFF

◆ TS2_PROGRAM_MAP_STREAM_ID

#define TS2_PROGRAM_MAP_STREAM_ID   0xBC

◆ TS2_VideoStreamNumber

#define TS2_VideoStreamNumber (   stream_id)    ((stream_id) & 0x1F)

Function Documentation

◆ TS2_PesPacket_Destroy()

void TS2_PesPacket_Destroy ( TS2_PesPacket pp)

◆ TS2_PesPacket_Unpack()

ATX_Result TS2_PesPacket_Unpack ( TS2_PesPacketAssembler assembler,
const TS2_Packet packet,
TS2_PesPacket **  packet_out 
)

packet_out must be non-NULL.

Returns
ATX_SUCCESSFUL, *packet_out may be non-NULL. In that case, the payload has completed a PES packet. This packet is returned and ownership transferred to the caller. *packet_out is set to NULL in the event that the PES packet is not complete.
TS2_ERROR_PES_INCOMPLETE_PACKET is returned if payload is the start of a new PES packet and there was an incomplete packet being read. In this case, this method should be called again with the same payload after handling the error condition in the calling layer.
TS2_ERROR_PES_UNBOUNDED_COMPLETION is returned if the payload is