Go to the documentation of this file.
73 s->nb_failed_requests = 0;
106 if (
s->warning_limit &&
109 "%d buffers queued in %s, something may be wrong.\n",
112 s->warning_limit *= 10;
152 if (
av_q2d(
c->time_base) <= 0) {
157 c->warning_limit = 100;
166 #define OFFSET(x) offsetof(SourceContext, x)
167 #define FLAGS (AV_OPT_FLAG_BSF_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
203 c->nb_failed_requests++;
216 .p.priv_class = &buffer_class,
#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
This struct describes the properties of an encoded stream.
#define AVERROR_EOF
End of file.
A filter pad used for either input or output.
void ff_bsf_link_set_in_status(AVBitStreamFilterLink *link, int status, int64_t pts)
unsigned ff_bsf_source_get_nb_failed_requests(const AVBitStreamFilterContext *buffer_src)
Get the number of failed requests.
int ff_bsf_graph_run_once(AVBitStreamFilterGraph *graph)
Run one round of processing on a filter graph.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define FFERROR_SOURCE_EMPTY
static av_cold int preinit(AVBitStreamFilterContext *ctx)
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
static av_cold int init(AVBitStreamFilterContext *ctx)
int av_bsf_source_close(AVBitStreamFilterContext *ctx, int64_t pts, unsigned flags)
Close the source after EOF.
AVContainerFifo * fifo
Queue of packets waiting to be filtered.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVBitStreamFilterPad source_outputs[]
@ AV_BSF_SOURCE_FLAG_PUSH
Immediately push the packet to the output.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static AVFormatContext * ctx
int ff_bsf_filter_packet(AVBitStreamFilterLink *link, AVPacket *pkt)
Send a packet of data to the next filter.
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 link
int av_bsf_source_parameters_set(AVBitStreamFilterContext *ctx, const AVCodecParameters *par)
Initialize the source filter with the provided parameters.
Describe the class of an AVClass context structure.
static int push_packet(AVBitStreamFilterGraph *graph)
#define AVPACKET_IS_EMPTY(pkt)
Rational number (pair of numerator and denominator).
static int activate(AVBitStreamFilterContext *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.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ AV_BSF_SOURCE_FLAG_KEEP_REF
Keep a reference to the packet.
AVBitStreamFilter p
The public AVBitStreamFilter.
#define attribute_align_arg
static void copy(const float *p1, float *p2, const int length)
static BitStreamFilterLinkInternal * ff_link_internal(AVBitStreamFilterLink *link)
int av_bsf_source_get_status(AVBitStreamFilterContext *ctx)
Returns 0 or a negative AVERROR code.
AVRational time_base
Time base for the timestamps in this frame.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
static const AVOption buffer_options[]
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define BSFILTER_OUTPUTS(array)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
const FFBitStreamFilter ff_source_bsf
static av_cold void uninit(AVBitStreamFilterContext *ctx)
void avcodec_parameters_free(AVCodecParameters **par)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
int ff_bsf_outlink_get_status(AVBitStreamFilterLink *link)
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
const char * name
Pad name.
void * priv_data
Opaque filter-specific private data.
size_t av_container_fifo_can_read(const AVContainerFifo *cf)
Link properties exposed to filter code, but not external callers.
static int config_props(AVBitStreamFilterLink *link)
AVRational time_base
time_base to set in the output link
This structure stores compressed data.
unsigned nb_failed_requests
char * name
Name of this format context, only used for logging purposes.
void * priv_data
Format private data.
int attribute_align_arg av_bsf_source_add_packet(AVBitStreamFilterContext *ctx, AVPacket *pkt, int flags)
Add a packet to the buffer source.
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.