Commit fb0c9c6d authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hxxx: store generic reference in SEI callback

parent 734c4d98
......@@ -167,7 +167,7 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag );
static void PutPPS( decoder_t *p_dec, block_t *p_frag );
static bool ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice,
int i_nal_ref_idc, int i_nal_type, const block_t *p_frag );
static void ParseSeiCallback( decoder_t *p_dec, const hxxx_sei_data_t * );
static void ParseSeiCallback( const hxxx_sei_data_t *, void * );
static const uint8_t p_h264_startcode[3] = { 0x00, 0x00, 0x01 };
......@@ -532,7 +532,8 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_ts_used, block_t *p_fr
/* Parse SEI for CC support */
if( i_nal_type == H264_NAL_SEI )
{
HxxxParseSEI( p_dec, p_frag->p_buffer, p_frag->i_buffer, 1, ParseSeiCallback );
HxxxParse_AnnexB_SEI( p_frag->p_buffer, p_frag->i_buffer,
1 /* nal header */, ParseSeiCallback, p_dec );
}
else if( i_nal_type == H264_NAL_AU_DELIMITER )
{
......@@ -949,8 +950,9 @@ static bool ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
return true;
}
static void ParseSeiCallback( decoder_t *p_dec, const hxxx_sei_data_t *p_sei_data )
static void ParseSeiCallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
{
decoder_t *p_dec = (decoder_t *) cbdata;
decoder_sys_t *p_sys = p_dec->p_sys;
switch( p_sei_data->i_type )
......
......@@ -28,15 +28,15 @@
#include "hxxx_sei.h"
#include "hxxx_nal.h"
void HxxxParse_AnnexB_SEI(decoder_t *p_dec, const uint8_t *p_buf, size_t i_buf,
uint8_t i_header, pf_hxxx_sei_callback cb)
void HxxxParse_AnnexB_SEI(const uint8_t *p_buf, size_t i_buf,
uint8_t i_header, pf_hxxx_sei_callback cb, void *cbdata)
{
if( hxxx_strip_AnnexB_startcode( &p_buf, &i_buf ) )
HxxxParseSEI(p_dec, p_buf, i_buf, i_header, cb);
HxxxParseSEI(p_buf, i_buf, i_header, cb, cbdata);
}
void HxxxParseSEI(decoder_t *p_dec, const uint8_t *p_buf, size_t i_buf,
uint8_t i_header, pf_hxxx_sei_callback pf_callback)
void HxxxParseSEI(const uint8_t *p_buf, size_t i_buf,
uint8_t i_header, pf_hxxx_sei_callback pf_callback, void *cbdata)
{
bs_t s;
unsigned i_bitflow = 0;
......@@ -85,7 +85,7 @@ void HxxxParseSEI(decoder_t *p_dec, const uint8_t *p_buf, size_t i_buf,
case HXXX_SEI_PIC_TIMING:
{
sei_data.p_bs = &s;
pf_callback( p_dec, &sei_data );
pf_callback( &sei_data, cbdata );
} break;
/* Look for user_data_registered_itu_t_t35 */
......@@ -120,7 +120,7 @@ void HxxxParseSEI(decoder_t *p_dec, const uint8_t *p_buf, size_t i_buf,
{
sei_data.itu_t35.i_cc = i_t35 - 3;
sei_data.itu_t35.p_cc = &p_t35[3];
pf_callback( p_dec, &sei_data );
pf_callback( &sei_data, cbdata );
}
free( p_t35 );
......@@ -133,7 +133,7 @@ void HxxxParseSEI(decoder_t *p_dec, const uint8_t *p_buf, size_t i_buf,
//bool b_exact_match = bs_read( &s, 1 );
//bool b_broken_link = bs_read( &s, 1 );
//int i_changing_slice_group = bs_read( &s, 2 );
pf_callback( p_dec, &sei_data );
pf_callback( &sei_data, cbdata );
} break;
default:
......
......@@ -46,8 +46,8 @@ typedef struct
};
} hxxx_sei_data_t;
typedef void (*pf_hxxx_sei_callback)(decoder_t *, const hxxx_sei_data_t *);
void HxxxParseSEI(decoder_t *, const uint8_t *, size_t, uint8_t, pf_hxxx_sei_callback);
void HxxxParse_AnnexB_SEI(decoder_t *, const uint8_t *, size_t, uint8_t, pf_hxxx_sei_callback);
typedef void (*pf_hxxx_sei_callback)(const hxxx_sei_data_t *, void *);
void HxxxParseSEI(const uint8_t *, size_t, uint8_t, pf_hxxx_sei_callback, void *);
void HxxxParse_AnnexB_SEI(const uint8_t *, size_t, uint8_t, pf_hxxx_sei_callback, void *);
#endif
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