Go to the documentation of this file.
56 int split = !!
s->buffer_pkt->data;
58 if (!
s->buffer_pkt->data) {
84 s->cur_frame_idx =
s->last_frame_idx = 0;
85 s->nb_frames = nb_frames;
92 int cur_frame_type = -1,
size = 0;
94 for (
i =
s->cur_frame_idx; i < td->nb_units;
i++) {
103 "previous frame was expected.\n");
109 s->last_frame_idx =
s->cur_frame_idx;
110 s->cur_frame_idx =
i + 1;
115 if (
s->cur_frame <
s->nb_frames)
122 "previous frame was expected.\n");
128 s->last_frame_idx =
s->cur_frame_idx;
133 if (
frame->show_existing_frame &&
134 s->cur_frame <
s->nb_frames) {
135 s->cur_frame_idx =
i + 1;
150 s->cur_frame <
s->nb_frames) {
151 s->cur_frame_idx =
i + 1;
167 s->buffer_pkt->data +=
size;
168 s->buffer_pkt->size -=
size;
173 if (
s->cur_frame ==
s->nb_frames) {
220 if (!
ctx->par_in->extradata_size)
254 .
p.
name =
"av1_frame_split",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static const CodedBitstreamUnitType decompose_unit_types[]
av_cold void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
int ff_cbs_read_extradata(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecParameters *par)
Read the extradata bitstream found in codec parameters into a fragment, then split into units and dec...
void * content
Pointer to the decomposed form of this unit.
void ff_cbs_fragment_reset(CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
Context structure for coded bitstream operations.
#define AV_LOG_VERBOSE
Detailed information.
void(* filter)(uint8_t *src, int stride, int qscale)
CodedBitstreamUnitType type
Codec-specific type of this unit.
@ AV1_OBU_TEMPORAL_DELIMITER
static enum AVCodecID av1_frame_split_codec_ids[]
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
The bitstream filter state.
Coded bitstream unit structure.
av_cold void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
static int av1_frame_split_init(AVBSFContext *ctx)
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
#define FF_ARRAY_ELEMS(a)
Coded bitstream fragment structure, combining one or more units.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void av1_frame_split_flush(AVBSFContext *ctx)
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
void(* flush)(AVBSFContext *ctx)
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
CodedBitstreamContext * cbc
AVCodecID
Identify the syntax and semantics of the bitstream.
static void av1_frame_split_close(AVBSFContext *ctx)
AVBitStreamFilter p
The public AVBitStreamFilter.
int(* init)(AVBSFContext *ctx)
static int av1_frame_split_filter(AVBSFContext *ctx, AVPacket *out)
#define AV_NOPTS_VALUE
Undefined timestamp value.
@ AV1_OBU_SEQUENCE_HEADER
static char * split(char *message, char delim)
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
AV1RawFrameHeader frame_header
#define i(width, name, range_min, range_max)
const FFBitStreamFilter ff_av1_frame_split_bsf
AV1RawTileGroup tile_group
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
int ff_cbs_read_packet(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
Read the data bitstream from a packet into a fragment, then split into units and decompose.
av_cold int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
This structure stores compressed data.
CodedBitstreamFragment temporal_unit
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
void * priv_data
Format private data.
int nb_units
Number of units in this fragment.