#define infer(name, value) do { \
if (current->name != (value)) { \
- av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
+ av_log(ctx->log_ctx, AV_LOG_ERROR, \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
+ return AVERROR_INVALIDDATA; \
} \
} while (0)
av_buffer_unref(&payload->payload.other.data_ref);
break;
}
+ av_buffer_unref(&payload->extension_data.data_ref);
}
static void cbs_h265_free_sei(void *opaque, uint8_t *content)
ref = (nal->data == nal->raw_data) ? frag->data_ref
: packet->rbsp.rbsp_buffer_ref;
- err = ff_cbs_insert_unit_data(ctx, frag, -1, nal->type,
+ err = ff_cbs_insert_unit_data(frag, -1, nal->type,
(uint8_t*)nal->data, size, ref);
if (err < 0)
return err;
{
H264RawSPS *sps;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*sps), NULL);
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*sps), NULL);
if (err < 0)
return err;
sps = unit->content;
case H264_NAL_SPS_EXT:
{
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(H264RawSPSExtension),
NULL);
if (err < 0)
{
H264RawPPS *pps;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*pps),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*pps),
&cbs_h264_free_pps);
if (err < 0)
return err;
H264RawSlice *slice;
int pos, len;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*slice),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*slice),
&cbs_h264_free_slice);
if (err < 0)
return err;
case H264_NAL_AUD:
{
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(H264RawAUD), NULL);
if (err < 0)
return err;
case H264_NAL_SEI:
{
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(H264RawSEI),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(H264RawSEI),
&cbs_h264_free_sei);
if (err < 0)
return err;
case H264_NAL_FILLER_DATA:
{
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(H264RawFiller), NULL);
if (err < 0)
return err;
case H264_NAL_END_SEQUENCE:
case H264_NAL_END_STREAM:
{
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(H264RawNALUnitHeader),
NULL);
if (err < 0)
{
H265RawVPS *vps;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*vps),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*vps),
&cbs_h265_free_vps);
if (err < 0)
return err;
{
H265RawSPS *sps;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*sps),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*sps),
&cbs_h265_free_sps);
if (err < 0)
return err;
{
H265RawPPS *pps;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*pps),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*pps),
&cbs_h265_free_pps);
if (err < 0)
return err;
H265RawSlice *slice;
int pos, len;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*slice),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*slice),
&cbs_h265_free_slice);
if (err < 0)
return err;
case HEVC_NAL_AUD:
{
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(H265RawAUD), NULL);
if (err < 0)
return err;
case HEVC_NAL_SEI_PREFIX:
case HEVC_NAL_SEI_SUFFIX:
{
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(H265RawSEI),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(H265RawSEI),
&cbs_h265_free_sei);
if (err < 0)
.close = &cbs_h265_close,
};
-int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *au,
+int ff_cbs_h264_add_sei_message(CodedBitstreamFragment *au,
H264RawSEIPayload *payload)
{
H264RawSEI *sei = NULL;
break;
}
- err = ff_cbs_insert_unit_content(ctx, au, i, H264_NAL_SEI,
+ err = ff_cbs_insert_unit_content(au, i, H264_NAL_SEI,
sei, sei_ref);
av_buffer_unref(&sei_ref);
if (err < 0)
return err;
}
-void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *au,
+void ff_cbs_h264_delete_sei_message(CodedBitstreamFragment *au,
CodedBitstreamUnit *nal,
int position)
{
break;
}
- ff_cbs_delete_unit(ctx, au, i);
+ ff_cbs_delete_unit(au, i);
} else {
cbs_h264_free_sei_payload(&sei->payload[position]);