pes.c File Reference

Include dependency graph for pes.c:


Functions

static int PESHeader (uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts, int i_es_size, es_format_t *p_fmt, int i_stream_id, bool b_mpeg2, bool b_data_alignment, int i_header_size)
 PESHeader, write a pes header.
int EStoPES (sout_instance_t *p_sout, block_t **pp_pes, block_t *p_es, es_format_t *p_fmt, int i_stream_id, int b_mpeg2, int b_data_alignment, int i_header_size, int i_max_pes_size)
 EStoPES, encapsulate an elementary stream block into PES packet(s) each with a maximal payload size of @.

Function Documentation

int EStoPES ( sout_instance_t p_sout,
block_t **  pp_pes,
block_t p_es,
es_format_t p_fmt,
int  i_stream_id,
int  b_mpeg2,
int  b_data_alignment,
int  i_header_size,
int  i_max_pes_size 
)

EStoPES, encapsulate an elementary stream block into PES packet(s) each with a maximal payload size of @.

In some circumstances, unbounded PES packets are allowed:

  • Transport streams only (NOT programme streams)
  • Only some types of elementary streams (eg MPEG2 video) It is the responsibility of the caller to enforce these constraints.

EStoPES will only produce an unbounded PES packet if:

  • ES is VIDEO_ES
  • i_max_pes_size > PES_PAYLOAD_SIZE_MAX
  • length of p_es > PES_PAYLOAD_SIZE_MAX If the last condition is not met, a single PES packet is produced which is not unbounded in length.

Parameters:
i_stream_id stream id as follows:
  • 0x00 - 0xff : normal stream_id as per Table 2-18
  • 0xfd00 - 0xfd7f : stream_id_extension = low 7 bits (stream_id = PES_EXTENDED_STREAM_ID)
  • 0xbd00 - 0xbdff : private_id = low 8 bits (stream_id = PES_PRIVATE_STREAM)
i_header_size length of padding data to insert into PES packet header in bytes.
i_max_pes_size maximum length of each pes packet payload. if zero, uses default maximum. To allow unbounded PES packets in transport stream VIDEO_ES, set to INT_MAX.

References __MIN, BLOCK_FLAG_TYPE_I, block_New, block_Realloc(), block_t::i_buffer, es_format_t::i_cat, es_format_t::i_codec, block_t::i_dts, es_format_t::i_extra, block_t::i_flags, block_t::i_length, block_t::i_pts, block_t::p_buffer, es_format_t::p_extra, block_t::p_next, PES_PAYLOAD_SIZE_MAX, PESHeader(), VIDEO_ES, VLC_CODEC_MP4V, vlc_memcpy(), and VLC_UNUSED.

Referenced by Mux().

static int PESHeader ( uint8_t *  p_hdr,
mtime_t  i_pts,
mtime_t  i_dts,
int  i_es_size,
es_format_t p_fmt,
int  i_stream_id,
bool  b_mpeg2,
bool  b_data_alignment,
int  i_header_size 
) [inline, static]

PESHeader, write a pes header.

Parameters:
i_es_size length of payload data. (Must be < PES_PAYLOAD_SIZE_MAX unless the conditions for unbounded PES packets are met)
i_stream_id stream id as follows:
  • 0x00 - 0xff : normal stream_id as per Table 2-18
  • 0xfd00 - 0xfd7f : stream_id_extension = low 7 bits (stream_id = PES_EXTENDED_STREAM_ID)
  • 0xbd00 - 0xbdff : private_id = low 8 bits (stream_id = PES_PRIVATE_STREAM)
i_header_size length of padding data to insert into PES packet header in bytes.

References bits_align(), bits_initwrite(), bits_write(), es_format_t::i_cat, es_format_t::i_codec, bits_buffer_s::i_data, PES_DSMCC_STREAM, PES_ECM, PES_EMM, PES_EXTENDED_STREAM_ID, PES_ITU_T_H222_1_TYPE_E_STREAM, PES_PADDING, PES_PAYLOAD_SIZE_MAX, PES_PRIVATE_STREAM_1, PES_PRIVATE_STREAM_2, PES_PROGRAM_STREAM_DIRECTORY, PES_PROGRAM_STREAM_MAP, VIDEO_ES, and VLC_CODEC_MPGV.

Referenced by EStoPES().


Generated on Tue May 25 08:05:27 2010 for VLC by  doxygen 1.5.6