Commit 0aebb95c authored by Francois Cartegnie's avatar Francois Cartegnie

packetizer: add startcode helper to packetizer's

parent c064a7f7
...@@ -195,7 +195,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -195,7 +195,7 @@ static int Open( vlc_object_t *p_this )
} }
packetizer_Init( &p_sys->packetizer, packetizer_Init( &p_sys->packetizer,
p_h264_startcode, sizeof(p_h264_startcode), p_h264_startcode, sizeof(p_h264_startcode), NULL,
p_h264_startcode, 1, 5, p_h264_startcode, 1, 5,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec ); PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
......
...@@ -100,7 +100,7 @@ static int Open(vlc_object_t *p_this) ...@@ -100,7 +100,7 @@ static int Open(vlc_object_t *p_this)
p_sys->pp_frame_last = &p_sys->p_frame; p_sys->pp_frame_last = &p_sys->p_frame;
packetizer_Init(&p_dec->p_sys->packetizer, packetizer_Init(&p_dec->p_sys->packetizer,
p_hevc_startcode, sizeof(p_hevc_startcode), p_hevc_startcode, sizeof(p_hevc_startcode), NULL,
p_hevc_startcode, 1, 5, p_hevc_startcode, 1, 5,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec); PacketizeReset, PacketizeParse, PacketizeValidate, p_dec);
......
...@@ -142,7 +142,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -142,7 +142,7 @@ static int Open( vlc_object_t *p_this )
/* Misc init */ /* Misc init */
packetizer_Init( &p_sys->packetizer, packetizer_Init( &p_sys->packetizer,
p_mp4v_startcode, sizeof(p_mp4v_startcode), p_mp4v_startcode, sizeof(p_mp4v_startcode), NULL,
NULL, 0, 4, NULL, 0, 4,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec ); PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
......
...@@ -168,7 +168,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -168,7 +168,7 @@ static int Open( vlc_object_t *p_this )
/* Misc init */ /* Misc init */
packetizer_Init( &p_sys->packetizer, packetizer_Init( &p_sys->packetizer,
p_mp2v_startcode, sizeof(p_mp2v_startcode), p_mp2v_startcode, sizeof(p_mp2v_startcode), NULL,
NULL, 0, 4, NULL, 0, 4,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec ); PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
......
...@@ -49,6 +49,7 @@ typedef struct ...@@ -49,6 +49,7 @@ typedef struct
int i_startcode; int i_startcode;
const uint8_t *p_startcode; const uint8_t *p_startcode;
block_startcode_helper_t pf_startcode_helper;
int i_au_prepend; int i_au_prepend;
const uint8_t *p_au_prepend; const uint8_t *p_au_prepend;
...@@ -64,6 +65,7 @@ typedef struct ...@@ -64,6 +65,7 @@ typedef struct
static inline void packetizer_Init( packetizer_t *p_pack, static inline void packetizer_Init( packetizer_t *p_pack,
const uint8_t *p_startcode, int i_startcode, const uint8_t *p_startcode, int i_startcode,
block_startcode_helper_t pf_start_helper,
const uint8_t *p_au_prepend, int i_au_prepend, const uint8_t *p_au_prepend, int i_au_prepend,
unsigned i_au_min_size, unsigned i_au_min_size,
packetizer_reset_t pf_reset, packetizer_reset_t pf_reset,
...@@ -82,6 +84,7 @@ static inline void packetizer_Init( packetizer_t *p_pack, ...@@ -82,6 +84,7 @@ static inline void packetizer_Init( packetizer_t *p_pack,
p_pack->i_startcode = i_startcode; p_pack->i_startcode = i_startcode;
p_pack->p_startcode = p_startcode; p_pack->p_startcode = p_startcode;
p_pack->pf_startcode_helper = pf_start_helper;
p_pack->pf_reset = pf_reset; p_pack->pf_reset = pf_reset;
p_pack->pf_parse = pf_parse; p_pack->pf_parse = pf_parse;
p_pack->pf_validate = pf_validate; p_pack->pf_validate = pf_validate;
...@@ -132,7 +135,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_ ...@@ -132,7 +135,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
case STATE_NOSYNC: case STATE_NOSYNC:
/* Find a startcode */ /* Find a startcode */
if( !block_FindStartcodeFromOffset( &p_pack->bytestream, &p_pack->i_offset, if( !block_FindStartcodeFromOffset( &p_pack->bytestream, &p_pack->i_offset,
p_pack->p_startcode, p_pack->i_startcode, NULL ) ) p_pack->p_startcode, p_pack->i_startcode,
p_pack->pf_startcode_helper ) )
p_pack->i_state = STATE_NEXT_SYNC; p_pack->i_state = STATE_NEXT_SYNC;
if( p_pack->i_offset ) if( p_pack->i_offset )
...@@ -150,7 +154,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_ ...@@ -150,7 +154,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
case STATE_NEXT_SYNC: case STATE_NEXT_SYNC:
/* Find the next startcode */ /* Find the next startcode */
if( block_FindStartcodeFromOffset( &p_pack->bytestream, &p_pack->i_offset, if( block_FindStartcodeFromOffset( &p_pack->bytestream, &p_pack->i_offset,
p_pack->p_startcode, p_pack->i_startcode, NULL ) ) p_pack->p_startcode, p_pack->i_startcode,
p_pack->pf_startcode_helper ) )
{ {
if( !p_pack->b_flushing || !p_pack->bytestream.p_chain ) if( !p_pack->b_flushing || !p_pack->bytestream.p_chain )
return NULL; /* Need more data */ return NULL; /* Need more data */
......
...@@ -155,7 +155,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -155,7 +155,7 @@ static int Open( vlc_object_t *p_this )
return VLC_ENOMEM; return VLC_ENOMEM;
packetizer_Init( &p_sys->packetizer, packetizer_Init( &p_sys->packetizer,
p_vc1_startcode, sizeof(p_vc1_startcode), p_vc1_startcode, sizeof(p_vc1_startcode), NULL,
NULL, 0, 4, NULL, 0, 4,
PacketizeReset, PacketizeParse, PacketizeValidate, p_dec ); PacketizeReset, PacketizeParse, PacketizeValidate, p_dec );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment