Several cbs-functions had an unused CodedBitstreamContext parameter.
This commit removes these.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
{
AV1FMergeContext *ctx = bsf->priv_data;
- ff_cbs_fragment_reset(ctx->cbc, &ctx->frag[0]);
- ff_cbs_fragment_reset(ctx->cbc, &ctx->frag[1]);
+ ff_cbs_fragment_reset(&ctx->frag[0]);
+ ff_cbs_fragment_reset(&ctx->frag[1]);
av_packet_unref(ctx->in);
av_packet_unref(ctx->pkt);
}
ctx->idx = !ctx->idx;
} else {
for (i = 0; i < frag->nb_units; i++) {
- err = ff_cbs_insert_unit_content(ctx->cbc, tu, -1, frag->units[i].type,
+ err = ff_cbs_insert_unit_content(tu, -1, frag->units[i].type,
frag->units[i].content, frag->units[i].content_ref);
if (err < 0)
goto fail;
else
av_packet_unref(in);
- ff_cbs_fragment_reset(ctx->cbc, &ctx->frag[ctx->idx]);
+ ff_cbs_fragment_reset(&ctx->frag[ctx->idx]);
fail:
if (err < 0 && err != AVERROR(EAGAIN))
{
AV1FMergeContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->frag[0]);
- ff_cbs_fragment_free(ctx->cbc, &ctx->frag[1]);
+ ff_cbs_fragment_free(&ctx->frag[0]);
+ ff_cbs_fragment_free(&ctx->frag[1]);
av_packet_free(&ctx->in);
av_packet_free(&ctx->pkt);
ff_cbs_close(&ctx->cbc);
if (s->cur_frame == s->nb_frames) {
av_packet_unref(s->buffer_pkt);
- ff_cbs_fragment_reset(s->cbc, td);
+ ff_cbs_fragment_reset(td);
}
return 0;
av_packet_unref(out);
av_packet_unref(s->buffer_pkt);
}
- ff_cbs_fragment_reset(s->cbc, td);
+ ff_cbs_fragment_reset(td);
return ret;
}
if (ret < 0)
av_log(ctx, AV_LOG_WARNING, "Failed to parse extradata.\n");
- ff_cbs_fragment_reset(s->cbc, td);
+ ff_cbs_fragment_reset(td);
return 0;
}
AV1FSplitContext *s = ctx->priv_data;
av_packet_unref(s->buffer_pkt);
- ff_cbs_fragment_reset(s->cbc, &s->temporal_unit);
+ ff_cbs_fragment_reset(&s->temporal_unit);
}
static void av1_frame_split_close(AVBSFContext *ctx)
AV1FSplitContext *s = ctx->priv_data;
av_packet_free(&s->buffer_pkt);
- ff_cbs_fragment_free(s->cbc, &s->temporal_unit);
+ ff_cbs_fragment_free(&s->temporal_unit);
ff_cbs_close(&s->cbc);
}
return AVERROR(ENOMEM);
memcpy(side_data, frag->data, frag->data_size);
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return 0;
}
// If a Temporal Delimiter is present, it must be the first OBU.
if (frag->units[0].type == AV1_OBU_TEMPORAL_DELIMITER) {
if (ctx->td == REMOVE)
- ff_cbs_delete_unit(ctx->cbc, frag, 0);
+ ff_cbs_delete_unit(frag, 0);
} else if (ctx->td == INSERT) {
td = (AV1RawOBU) {
.header.obu_type = AV1_OBU_TEMPORAL_DELIMITER,
};
- err = ff_cbs_insert_unit_content(ctx->cbc, frag, 0, AV1_OBU_TEMPORAL_DELIMITER,
+ err = ff_cbs_insert_unit_content(frag, 0, AV1_OBU_TEMPORAL_DELIMITER,
&td, NULL);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to insert Temporal Delimiter.\n");
if (ctx->delete_padding) {
for (i = frag->nb_units - 1; i >= 0; i--) {
if (frag->units[i].type == AV1_OBU_PADDING)
- ff_cbs_delete_unit(ctx->cbc, frag, i);
+ ff_cbs_delete_unit(frag, i);
}
}
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
if (err < 0)
av_packet_unref(pkt);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return err;
}
{
AV1MetadataContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->access_unit);
+ ff_cbs_fragment_free(&ctx->access_unit);
ff_cbs_close(&ctx->cbc);
}
av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata.\n");
}
- ff_cbs_fragment_reset(s->cbc, td);
+ ff_cbs_fragment_reset(td);
}
ret = ff_cbs_read(s->cbc, td, data, size);
avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
end:
- ff_cbs_fragment_reset(s->cbc, td);
+ ff_cbs_fragment_reset(td);
s->cbc->log_ctx = NULL;
{
AV1ParseContext *s = ctx->priv_data;
- ff_cbs_fragment_free(s->cbc, &s->temporal_unit);
+ ff_cbs_fragment_free(&s->temporal_unit);
ff_cbs_close(&s->cbc);
}
av_freep(ctx_ptr);
}
-static void cbs_unit_uninit(CodedBitstreamContext *ctx,
- CodedBitstreamUnit *unit)
+static void cbs_unit_uninit(CodedBitstreamUnit *unit)
{
av_buffer_unref(&unit->content_ref);
unit->content = NULL;
unit->data_bit_padding = 0;
}
-void ff_cbs_fragment_reset(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag)
+void ff_cbs_fragment_reset(CodedBitstreamFragment *frag)
{
int i;
for (i = 0; i < frag->nb_units; i++)
- cbs_unit_uninit(ctx, &frag->units[i]);
+ cbs_unit_uninit(&frag->units[i]);
frag->nb_units = 0;
av_buffer_unref(&frag->data_ref);
frag->data_bit_padding = 0;
}
-void ff_cbs_fragment_free(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag)
+void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
{
- ff_cbs_fragment_reset(ctx, frag);
+ ff_cbs_fragment_reset(frag);
av_freep(&frag->units);
frag->nb_units_allocated = 0;
return 0;
}
-static int cbs_fill_fragment_data(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+static int cbs_fill_fragment_data(CodedBitstreamFragment *frag,
const uint8_t *data, size_t size)
{
av_assert0(!frag->data && !frag->data_ref);
{
int err;
- err = cbs_fill_fragment_data(ctx, frag, par->extradata,
+ err = cbs_fill_fragment_data(frag, par->extradata,
par->extradata_size);
if (err < 0)
return err;
frag->data_size = pkt->size;
} else {
- err = cbs_fill_fragment_data(ctx, frag, pkt->data, pkt->size);
+ err = cbs_fill_fragment_data(frag, pkt->data, pkt->size);
if (err < 0)
return err;
}
{
int err;
- err = cbs_fill_fragment_data(ctx, frag, data, size);
+ err = cbs_fill_fragment_data(frag, data, size);
if (err < 0)
return err;
flush_put_bits(&pbc);
- ret = ff_cbs_alloc_unit_data(ctx, unit, put_bits_count(&pbc) / 8);
+ ret = ff_cbs_alloc_unit_data(unit, put_bits_count(&pbc) / 8);
if (ret < 0)
return ret;
}
-int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx,
- CodedBitstreamUnit *unit,
+int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit,
size_t size,
void (*free)(void *opaque, uint8_t *data))
{
return 0;
}
-int ff_cbs_alloc_unit_data(CodedBitstreamContext *ctx,
- CodedBitstreamUnit *unit,
+int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
size_t size)
{
av_assert0(!unit->data && !unit->data_ref);
return 0;
}
-static int cbs_insert_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+static int cbs_insert_unit(CodedBitstreamFragment *frag,
int position)
{
CodedBitstreamUnit *units;
return 0;
}
-int ff_cbs_insert_unit_content(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag,
int position,
CodedBitstreamUnitType type,
void *content,
content_ref = NULL;
}
- err = cbs_insert_unit(ctx, frag, position);
+ err = cbs_insert_unit(frag, position);
if (err < 0) {
av_buffer_unref(&content_ref);
return err;
return 0;
}
-int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+int ff_cbs_insert_unit_data(CodedBitstreamFragment *frag,
int position,
CodedBitstreamUnitType type,
uint8_t *data, size_t data_size,
return AVERROR(ENOMEM);
}
- err = cbs_insert_unit(ctx, frag, position);
+ err = cbs_insert_unit(frag, position);
if (err < 0) {
av_buffer_unref(&data_ref);
return err;
return 0;
}
-void ff_cbs_delete_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+void ff_cbs_delete_unit(CodedBitstreamFragment *frag,
int position)
{
av_assert0(0 <= position && position < frag->nb_units
&& "Unit to be deleted not in fragment.");
- cbs_unit_uninit(ctx, &frag->units[position]);
+ cbs_unit_uninit(&frag->units[position]);
--frag->nb_units;
* Free the units contained in a fragment as well as the fragment's
* own data buffer, but not the units array itself.
*/
-void ff_cbs_fragment_reset(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag);
+void ff_cbs_fragment_reset(CodedBitstreamFragment *frag);
/**
* Free the units array of a fragment in addition to what
* ff_cbs_fragment_reset does.
*/
-void ff_cbs_fragment_free(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag);
+void ff_cbs_fragment_free(CodedBitstreamFragment *frag);
/**
* Allocate a new internal content buffer of the given size in the unit.
*
* The content will be zeroed.
*/
-int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx,
- CodedBitstreamUnit *unit,
+int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit,
size_t size,
void (*free)(void *opaque, uint8_t *content));
*
* The data buffer will have input padding.
*/
-int ff_cbs_alloc_unit_data(CodedBitstreamContext *ctx,
- CodedBitstreamUnit *unit,
+int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
size_t size);
/**
* The content structure continues to be owned by the caller if
* content_buf is not supplied.
*/
-int ff_cbs_insert_unit_content(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag,
int position,
CodedBitstreamUnitType type,
void *content,
* av_malloc() and will on success become owned by the unit after this
* call or freed on error.
*/
-int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+int ff_cbs_insert_unit_data(CodedBitstreamFragment *frag,
int position,
CodedBitstreamUnitType type,
uint8_t *data, size_t data_size,
*
* Requires position to be >= 0 and < frag->nb_units.
*/
-void ff_cbs_delete_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
+void ff_cbs_delete_unit(CodedBitstreamFragment *frag,
int position);
goto fail;
}
- err = ff_cbs_insert_unit_data(ctx, frag, -1, header.obu_type,
+ err = ff_cbs_insert_unit_data(frag, -1, header.obu_type,
data, obu_length, frag->data_ref);
if (err < 0)
goto fail;
GetBitContext gbc;
int err, start_pos, end_pos;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*obu),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*obu),
&cbs_av1_free_obu);
if (err < 0)
return err;
* On success, the payload will be owned by a unit in access_unit;
* on failure, the content of the payload will be freed.
*/
-int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *access_unit,
+int ff_cbs_h264_add_sei_message(CodedBitstreamFragment *access_unit,
H264RawSEIPayload *payload);
/**
* Requires nal_unit to be a unit in access_unit and position to be >= 0
* and < the payload count of the SEI nal_unit.
*/
-void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *access_unit,
+void ff_cbs_h264_delete_sei_message(CodedBitstreamFragment *access_unit,
CodedBitstreamUnit *nal_unit,
int position);
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]);
data_ref = frag->data_ref;
}
- err = ff_cbs_insert_unit_data(ctx, frag, unit, marker,
+ err = ff_cbs_insert_unit_data(frag, unit, marker,
data, data_size, data_ref);
if (err < 0)
return err;
if (unit->type >= JPEG_MARKER_SOF0 &&
unit->type <= JPEG_MARKER_SOF3) {
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(JPEGRawFrameHeader),
NULL);
if (err < 0)
} else if (unit->type >= JPEG_MARKER_APPN &&
unit->type <= JPEG_MARKER_APPN + 15) {
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(JPEGRawApplicationData),
&cbs_jpeg_free_application_data);
if (err < 0)
JPEGRawScan *scan;
int pos;
- err = ff_cbs_alloc_unit_content(ctx, unit,
+ err = ff_cbs_alloc_unit_content(unit,
sizeof(JPEGRawScan),
&cbs_jpeg_free_scan);
if (err < 0)
#define SEGMENT(marker, type, func, free) \
case JPEG_MARKER_ ## marker: \
{ \
- err = ff_cbs_alloc_unit_content(ctx, unit, \
+ err = ff_cbs_alloc_unit_content(unit, \
sizeof(type), free); \
if (err < 0) \
return err; \
final = 1;
}
- err = ff_cbs_insert_unit_data(ctx, frag, i, unit_type, (uint8_t*)start,
+ err = ff_cbs_insert_unit_data(frag, i, unit_type, (uint8_t*)start,
unit_size, frag->data_ref);
if (err < 0)
return err;
MPEG2RawSlice *slice;
int pos, len;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*slice),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*slice),
&cbs_mpeg2_free_slice);
if (err < 0)
return err;
case start_code: \
{ \
type *header; \
- err = ff_cbs_alloc_unit_content(ctx, unit, \
+ err = ff_cbs_alloc_unit_content(unit, \
sizeof(*header), free_func); \
if (err < 0) \
return err; \
return AVERROR_INVALIDDATA;
}
- err = ff_cbs_insert_unit_data(ctx, frag, -1, 0,
+ err = ff_cbs_insert_unit_data(frag, -1, 0,
frag->data + pos,
sfi.frame_sizes[i],
frag->data_ref);
return 0;
} else {
- err = ff_cbs_insert_unit_data(ctx, frag, -1, 0,
+ err = ff_cbs_insert_unit_data(frag, -1, 0,
frag->data, frag->data_size,
frag->data_ref);
if (err < 0)
if (err < 0)
return err;
- err = ff_cbs_alloc_unit_content(ctx, unit, sizeof(*frame),
+ err = ff_cbs_alloc_unit_content(unit, sizeof(*frame),
&cbs_vp9_free_frame);
if (err < 0)
return err;
}
if (ctx->mode == REMOVE ? j < ctx->nb_types
: j >= ctx->nb_types)
- ff_cbs_delete_unit(ctx->cbc, frag, i);
+ ff_cbs_delete_unit(frag, i);
}
if (frag->nb_units == 0) {
fail:
if (err < 0)
av_packet_unref(pkt);
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return err;
}
av_log(bsf, AV_LOG_ERROR, "Failed to write extradata.\n");
}
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
}
return err;
av_freep(&ctx->type_list);
- ff_cbs_fragment_free(ctx->cbc, &ctx->fragment);
+ ff_cbs_fragment_free(&ctx->fragment);
ff_cbs_close(&ctx->cbc);
}
return AVERROR(ENOMEM);
memcpy(side_data, au->data, au->data_size);
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
return 0;
}
// If an AUD is present, it must be the first NAL unit.
if (au->units[0].type == H264_NAL_AUD) {
if (ctx->aud == REMOVE)
- ff_cbs_delete_unit(ctx->cbc, au, 0);
+ ff_cbs_delete_unit(au, 0);
} else {
if (ctx->aud == INSERT) {
static const int primary_pic_type_table[] = {
.primary_pic_type = j,
};
- err = ff_cbs_insert_unit_content(ctx->cbc, au,
+ err = ff_cbs_insert_unit_content(au,
0, H264_NAL_AUD, &aud, NULL);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to insert AUD.\n");
udu->data_length = len + 1;
memcpy(udu->data, ctx->sei_user_data + i + 1, len + 1);
- err = ff_cbs_h264_add_sei_message(ctx->cbc, au, &payload);
+ err = ff_cbs_h264_add_sei_message(au, &payload);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to add user data SEI "
"message to access unit.\n");
if (ctx->delete_filler) {
for (i = au->nb_units - 1; i >= 0; i--) {
if (au->units[i].type == H264_NAL_FILLER_DATA) {
- ff_cbs_delete_unit(ctx->cbc, au, i);
+ ff_cbs_delete_unit(au, i);
continue;
}
for (j = sei->payload_count - 1; j >= 0; j--) {
if (sei->payload[j].payload_type ==
H264_SEI_TYPE_FILLER_PAYLOAD)
- ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
+ ff_cbs_h264_delete_sei_message(au, &au->units[i], j);
}
}
}
if (ctx->display_orientation == REMOVE ||
ctx->display_orientation == INSERT) {
- ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
+ ff_cbs_h264_delete_sei_message(au, &au->units[i], j);
continue;
}
if (write) {
disp->display_orientation_repetition_period = 1;
- err = ff_cbs_h264_add_sei_message(ctx->cbc, au, &payload);
+ err = ff_cbs_h264_add_sei_message(au, &payload);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to add display orientation "
"SEI message to access unit.\n");
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
if (err < 0)
av_packet_unref(pkt);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
{
H264MetadataContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->access_unit);
+ ff_cbs_fragment_free(&ctx->access_unit);
ff_cbs_close(&ctx->cbc);
}
if (!au_has_sps) {
av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS "
"at %"PRId64".\n", pkt->pts);
- ff_cbs_delete_unit(ctx->input, au, i);
+ ff_cbs_delete_unit(au, i);
i--;
continue;
}
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->output, au);
+ ff_cbs_fragment_reset(au);
if (err < 0)
av_packet_unref(pkt);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->output, au);
+ ff_cbs_fragment_reset(au);
return err;
}
{
H264RedundantPPSContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->input, &ctx->access_unit);
+ ff_cbs_fragment_free(&ctx->access_unit);
ff_cbs_close(&ctx->input);
ff_cbs_close(&ctx->output);
}
return AVERROR(ENOMEM);
memcpy(side_data, au->data, au->data_size);
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
return 0;
}
// If an AUD is present, it must be the first NAL unit.
if (au->units[0].type == HEVC_NAL_AUD) {
if (ctx->aud == REMOVE)
- ff_cbs_delete_unit(ctx->cbc, au, 0);
+ ff_cbs_delete_unit(au, 0);
} else {
if (ctx->aud == INSERT) {
H265RawAUD *aud = &ctx->aud_nal;
};
aud->pic_type = pic_type;
- err = ff_cbs_insert_unit_content(ctx->cbc, au,
- 0, HEVC_NAL_AUD, aud, NULL);
+ err = ff_cbs_insert_unit_content(au, 0, HEVC_NAL_AUD, aud, NULL);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to insert AUD.\n");
goto fail;
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
if (err < 0)
av_packet_unref(pkt);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
{
H265MetadataContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->access_unit);
+ ff_cbs_fragment_free(&ctx->access_unit);
ff_cbs_close(&ctx->cbc);
}
se->vertical_size_extension << 12 | sh->vertical_size_value,
};
- err = ff_cbs_insert_unit_content(ctx->cbc, frag, se_pos + 1,
+ err = ff_cbs_insert_unit_content(frag, se_pos + 1,
MPEG2_START_EXTENSION,
&ctx->sequence_display_extension,
NULL);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
if (err < 0)
av_packet_unref(pkt);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return err;
}
{
MPEG2MetadataContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->fragment);
+ ff_cbs_fragment_free(&ctx->fragment);
ff_cbs_close(&ctx->cbc);
}
err = ff_cbs_read_extradata(ctx->cbc, frag, bsf->par_in);
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
}
return err;
{
TraceHeadersContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->fragment);
+ ff_cbs_fragment_free(&ctx->fragment);
ff_cbs_close(&ctx->cbc);
}
err = ff_cbs_read_packet(ctx->cbc, frag, pkt);
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
if (err < 0)
av_packet_unref(pkt);
CodedBitstreamFragment *au,
void *nal_unit)
{
- VAAPIEncodeH264Context *priv = avctx->priv_data;
H264RawNALUnitHeader *header = nal_unit;
int err;
- err = ff_cbs_insert_unit_content(priv->cbc, au, -1,
+ err = ff_cbs_insert_unit_content(au, -1,
header->nal_unit_type, nal_unit, NULL);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to add NAL unit: "
err = vaapi_encode_h264_write_access_unit(avctx, data, data_len, au);
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
err = vaapi_encode_h264_write_access_unit(avctx, data, data_len, au);
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
if (err < 0)
goto fail;
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
*type = VAEncPackedHeaderRawData;
return 0;
}
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
{
VAAPIEncodeH264Context *priv = avctx->priv_data;
- ff_cbs_fragment_free(priv->cbc, &priv->current_access_unit);
+ ff_cbs_fragment_free(&priv->current_access_unit);
ff_cbs_close(&priv->cbc);
av_freep(&priv->sei_identifier_string);
CodedBitstreamFragment *au,
void *nal_unit)
{
- VAAPIEncodeH265Context *priv = avctx->priv_data;
H265RawNALUnitHeader *header = nal_unit;
int err;
- err = ff_cbs_insert_unit_content(priv->cbc, au, -1,
+ err = ff_cbs_insert_unit_content(au, -1,
header->nal_unit_type, nal_unit, NULL);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to add NAL unit: "
err = vaapi_encode_h265_write_access_unit(avctx, data, data_len, au);
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
err = vaapi_encode_h265_write_access_unit(avctx, data, data_len, au);
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
if (err < 0)
goto fail;
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
*type = VAEncPackedHeaderRawData;
return 0;
}
fail:
- ff_cbs_fragment_reset(priv->cbc, au);
+ ff_cbs_fragment_reset(au);
return err;
}
{
VAAPIEncodeH265Context *priv = avctx->priv_data;
- ff_cbs_fragment_free(priv->cbc, &priv->current_access_unit);
+ ff_cbs_fragment_free(&priv->current_access_unit);
ff_cbs_close(&priv->cbc);
return ff_vaapi_encode_close(avctx);
int err;
if (priv->jfif) {
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1,
+ err = ff_cbs_insert_unit_content(frag, -1,
JPEG_MARKER_APPN + 0,
&priv->jfif_header, NULL);
if (err < 0)
goto fail;
}
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1,
+ err = ff_cbs_insert_unit_content(frag, -1,
JPEG_MARKER_DQT,
&priv->quant_tables, NULL);
if (err < 0)
goto fail;
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1,
+ err = ff_cbs_insert_unit_content(frag, -1,
JPEG_MARKER_SOF0,
&priv->frame_header, NULL);
if (err < 0)
goto fail;
if (priv->huffman) {
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1,
+ err = ff_cbs_insert_unit_content(frag, -1,
JPEG_MARKER_DHT,
&priv->huffman_tables, NULL);
if (err < 0)
goto fail;
}
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1,
+ err = ff_cbs_insert_unit_content(frag, -1,
JPEG_MARKER_SOS,
&priv->scan, NULL);
if (err < 0)
err = 0;
fail:
- ff_cbs_fragment_reset(priv->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return err;
}
{
VAAPIEncodeMJPEGContext *priv = avctx->priv_data;
- ff_cbs_fragment_free(priv->cbc, &priv->current_fragment);
+ ff_cbs_fragment_free(&priv->current_fragment);
ff_cbs_close(&priv->cbc);
return ff_vaapi_encode_close(avctx);
CodedBitstreamFragment *frag,
int type, void *header)
{
- VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
int err;
- err = ff_cbs_insert_unit_content(priv->cbc, frag, -1, type, header, NULL);
+ err = ff_cbs_insert_unit_content(frag, -1, type, header, NULL);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to add header: "
"type = %d.\n", type);
err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
fail:
- ff_cbs_fragment_reset(priv->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return 0;
}
err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
fail:
- ff_cbs_fragment_reset(priv->cbc, frag);
+ ff_cbs_fragment_reset(frag);
return 0;
}
{
VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
- ff_cbs_fragment_free(priv->cbc, &priv->current_fragment);
+ ff_cbs_fragment_free(&priv->current_fragment);
ff_cbs_close(&priv->cbc);
return ff_vaapi_encode_close(avctx);
err = 0;
fail:
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ ff_cbs_fragment_reset(frag);
if (err < 0)
av_packet_unref(pkt);
{
VP9MetadataContext *ctx = bsf->priv_data;
- ff_cbs_fragment_free(ctx->cbc, &ctx->fragment);
+ ff_cbs_fragment_free(&ctx->fragment);
ff_cbs_close(&ctx->cbc);
}