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 };
55 av_bprintf(bp,
", %d x %d", frame->width, frame->height);
63 for (i = 0; linesize[i]; i++) {
65 int h = frame->height;
68 data = frame->data[i];
69 for (y = 0; y <
h; y++) {
71 data += frame->linesize[i];
79 int nb_planes, nb_samples, p;
85 nb_samples *= nb_planes;
90 av_bprintf(bp,
", %s", name ? name :
"unknown");
91 for (p = 0; p < nb_planes; p++) {
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);
128 const char *type_name;
135 stream_index, (*frame)->pts);
138 av_bprintf(&bp,
", %s", type_name ? type_name :
"unknown");
163 .
name =
"uncodedframecrc",
void av_bprintf(AVBPrint *buf, const char *fmt,...)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void audio_frame_cksum(AVBPrint *bp, AVFrame *frame)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigned int len)
Calculate the Adler32 checksum of a buffer.
AVStream ** streams
A list of all streams in the file.
static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#define AV_BPRINT_SIZE_UNLIMITED
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
simple assert() macros that are a bit more flexible than ISO C assert().
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.
AVOutputFormat ff_uncodedframecrc_muxer
AVCodecContext * codec
Codec context associated with this stream.
uint8_t nb_components
The number of components each pixel has, (1-4)
#define DEFINE_CKSUM_LINE(name, type, conv)
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
int ff_framehash_write_header(AVFormatContext *s)
Set the timebase for each stream from the corresponding codec timebase and print it.
Public header for libavutil Adler32 hasher.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int av_frame_get_channels(const AVFrame *frame)
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.
static int write_frame(struct AVFormatContext *s, int stream_index, AVFrame **frame, unsigned flags)
static void video_frame_cksum(AVBPrint *bp, AVFrame *frame)
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.
uint8_t ** extended_data
pointers to the data planes/channels.
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.