You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/cbs: Make ff_cbs_alloc_unit_data() static
Forgotten in 7c92eaace2
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -315,6 +315,28 @@ int ff_cbs_read(CodedBitstreamContext *ctx,
|
|||||||
data, size, 0);
|
data, size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate a new internal data buffer of the given size in the unit.
|
||||||
|
*
|
||||||
|
* The data buffer will have input padding.
|
||||||
|
*/
|
||||||
|
static int cbs_alloc_unit_data(CodedBitstreamUnit *unit,
|
||||||
|
size_t size)
|
||||||
|
{
|
||||||
|
av_assert0(!unit->data && !unit->data_ref);
|
||||||
|
|
||||||
|
unit->data_ref = av_buffer_alloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
if (!unit->data_ref)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
unit->data = unit->data_ref->data;
|
||||||
|
unit->data_size = size;
|
||||||
|
|
||||||
|
memset(unit->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int cbs_write_unit_data(CodedBitstreamContext *ctx,
|
static int cbs_write_unit_data(CodedBitstreamContext *ctx,
|
||||||
CodedBitstreamUnit *unit)
|
CodedBitstreamUnit *unit)
|
||||||
{
|
{
|
||||||
@@ -360,7 +382,7 @@ static int cbs_write_unit_data(CodedBitstreamContext *ctx,
|
|||||||
|
|
||||||
flush_put_bits(&pbc);
|
flush_put_bits(&pbc);
|
||||||
|
|
||||||
ret = ff_cbs_alloc_unit_data(unit, put_bytes_output(&pbc));
|
ret = cbs_alloc_unit_data(unit, put_bytes_output(&pbc));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -693,23 +715,6 @@ int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
|
|
||||||
size_t size)
|
|
||||||
{
|
|
||||||
av_assert0(!unit->data && !unit->data_ref);
|
|
||||||
|
|
||||||
unit->data_ref = av_buffer_alloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
if (!unit->data_ref)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
unit->data = unit->data_ref->data;
|
|
||||||
unit->data_size = size;
|
|
||||||
|
|
||||||
memset(unit->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cbs_insert_unit(CodedBitstreamFragment *frag,
|
static int cbs_insert_unit(CodedBitstreamFragment *frag,
|
||||||
int position)
|
int position)
|
||||||
{
|
{
|
||||||
|
@@ -380,15 +380,6 @@ int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit,
|
|||||||
int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx,
|
int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx,
|
||||||
CodedBitstreamUnit *unit);
|
CodedBitstreamUnit *unit);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocate a new internal data buffer of the given size in the unit.
|
|
||||||
*
|
|
||||||
* The data buffer will have input padding.
|
|
||||||
*/
|
|
||||||
int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
|
|
||||||
size_t size);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a new unit into a fragment with the given content.
|
* Insert a new unit into a fragment with the given content.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user