Commit e727f859 authored by Thomas Guillem's avatar Thomas Guillem

codec: hxxx: parse nal only when asked for

parent 3d1b34a3
......@@ -358,7 +358,8 @@ helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
bool *p_config_changed)
{
assert(helper_nal_length_valid(hh));
*p_config_changed = false;
if (p_config_changed != NULL)
*p_config_changed = false;
h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
hh->i_nal_length_size);
return p_block;
......@@ -368,12 +369,15 @@ static block_t *
helper_process_block_h264_annexb(struct hxxx_helper *hh, block_t *p_block,
bool *p_config_changed)
{
int i_ret = h264_helper_parse_nal(hh, p_block->p_buffer, p_block->i_buffer,
0, p_config_changed);
if (i_ret != VLC_SUCCESS)
if (p_config_changed != NULL)
{
block_Release(p_block);
return NULL;
int i_ret = h264_helper_parse_nal(hh, p_block->p_buffer,
p_block->i_buffer, 0, p_config_changed);
if (i_ret != VLC_SUCCESS)
{
block_Release(p_block);
return NULL;
}
}
return p_block;
}
......
......@@ -59,6 +59,10 @@ struct hxxx_helper
size_t i_annexb_config_nal;
} hevc;
};
/* Process the block: do the AnnexB <-> xvcC conversion if needed. If
* p_config_changed is not NULL, parse nals to detect a SPS/PPS or a video
* size change. */
block_t * (*pf_process_block)(struct hxxx_helper *hh, block_t *p_block,
bool *p_config_changed);
};
......
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