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

hxxx_sei: allow to differentiate T35 payloads

parent 2b7a60de
......@@ -957,7 +957,11 @@ static bool ParseSeiCallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
/* Look for user_data_registered_itu_t_t35 */
case HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35:
{
cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.p_cc, p_sei_data->itu_t35.i_cc );
if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
{
cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
p_sei_data->itu_t35.u.cc.i_data );
}
} break;
/* Look for SEI recovery point */
......
......@@ -695,7 +695,13 @@ static bool ParseSEICallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
decoder_sys_t *p_sys = p_dec->p_sys;
if( p_sei_data->i_type == HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35 )
cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.p_cc, p_sei_data->itu_t35.i_cc );
{
if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
{
cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
p_sei_data->itu_t35.u.cc.i_data );
}
}
return true;
}
......@@ -119,8 +119,9 @@ void HxxxParseSEI(const uint8_t *p_buf, size_t i_buf,
( i_t35 >= sizeof(p_DIRECTV_data_start_code) &&
!memcmp( p_t35, p_DIRECTV_data_start_code, sizeof(p_DIRECTV_data_start_code) ) ) )
{
sei_data.itu_t35.i_cc = i_t35 - 3;
sei_data.itu_t35.p_cc = &p_t35[3];
sei_data.itu_t35.type = HXXX_ITU_T35_TYPE_CC;
sei_data.itu_t35.u.cc.i_data = i_t35 - 3;
sei_data.itu_t35.u.cc.p_data = &p_t35[3];
b_continue = pf_callback( &sei_data, cbdata );
}
......
......@@ -28,6 +28,11 @@ enum hxxx_sei_type_e
HXXX_SEI_RECOVERY_POINT = 6
};
enum hxxx_sei_t35_type_e
{
HXXX_ITU_T35_TYPE_CC,
};
typedef struct
{
unsigned i_type;
......@@ -36,8 +41,15 @@ typedef struct
bs_t *p_bs; /* for raw/unhandled in common code callbacks */
struct
{
const uint8_t *p_cc;
size_t i_cc;
enum hxxx_sei_t35_type_e type;
union
{
struct
{
const uint8_t *p_data;
size_t i_data;
} cc;
} u;
} itu_t35;
struct
{
......
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