Go to the documentation of this file.
30 #define DEFINE_CKSUM_LINE(name, type, conv) \
31 static void cksum_line_ ## name(unsigned *cksum, void *data, unsigned size) \
34 unsigned a = *cksum & 0xFFFF, b = *cksum >> 16; \
35 for (; size > 0; size--, p++) { \
36 a = (a + (unsigned)(conv)) % 65521; \
37 b = (b + a) % 65521; \
39 *cksum = a | (b << 16); \
53 int linesize[5] = { 0 };
63 for (
i = 0; linesize[
i];
i++) {
66 if ((
i == 1 ||
i == 2) &&
desc->nb_components >= 3)
69 for (y = 0; y <
h; y++) {
79 int nb_planes, nb_samples, p;
82 nb_planes =
frame->channels;
83 nb_samples =
frame->nb_samples;
85 nb_samples *= nb_planes;
91 for (p = 0; p < nb_planes; p++) {
93 void *
d =
frame->extended_data[p];
94 switch (
frame->format) {
97 cksum_line_u8(&cksum,
d, nb_samples);
101 cksum_line_s16(&cksum,
d, nb_samples);
105 cksum_line_s32(&cksum,
d, nb_samples);
109 cksum_line_flt(&cksum,
d, nb_samples);
113 cksum_line_dbl(&cksum,
d, nb_samples);
133 const char *type_name;
140 stream_index, (*frame)->pts);
141 type =
s->streams[stream_index]->codecpar->codec_type;
143 av_bprintf(&bp,
", %s", type_name ? type_name :
"unknown");
168 .
name =
"uncodedframecrc",
@ AV_SAMPLE_FMT_FLTP
float, planar
#define AV_BPRINT_SIZE_UNLIMITED
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
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
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
#define AV_CEIL_RSHIFT(a, b)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
static int write_frame(struct AVFormatContext *s, int stream_index, AVFrame **frame, unsigned flags)
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
static int write_header(struct AVFormatContext *s)
#define i(width, name, range_min, range_max)
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
@ AV_SAMPLE_FMT_S16
signed 16 bits
const AVOutputFormat ff_uncodedframecrc_muxer
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
void av_bprintf(AVBPrint *buf, const char *fmt,...)
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
@ AV_SAMPLE_FMT_DBLP
double, planar
static void audio_frame_cksum(AVBPrint *bp, AVFrame *frame)
#define DEFINE_CKSUM_LINE(name, type, conv)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
This structure stores compressed data.
int ff_framehash_write_header(AVFormatContext *s)
Set the timebase for each stream from the corresponding codec timebase and print it.
#define flags(name, subs,...)
static void video_frame_cksum(AVBPrint *bp, AVFrame *frame)
@ AV_SAMPLE_FMT_DBL
double
@ AV_SAMPLE_FMT_S32
signed 32 bits
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.