FFmpeg: libavformat/framecrcenc.c Source File
Go to the documentation of this file. 1 /*
2 * frame CRC encoder (for codec/format testing)
3 * Copyright (c) 2002 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include <inttypes.h>
23
24 #include "config.h"
29
33
37
39 {
41 for (
i = 0;
i <
s->nb_streams;
i++) {
46 avio_printf(
s->pb,
"#extradata %d: %8d, 0x%08"PRIx32
"\n",
48 }
49 }
50
52 }
53
55 {
59 }
else if (
size == 4) {
62 }
else if (
size == 2) {
65 }
66 }
67
69 {
71 char buf[256];
72
73 snprintf(buf,
sizeof(buf),
"%d, %10"PRId64
", %10"PRId64
", %8"PRId64
", %8d, 0x%08"PRIx32,
79
83 uint32_t side_data_crc = 0;
84
86 #if HAVE_BIGENDIAN
100 for (
size_t j = 0; j < sd->
size / 4; j++) {
101 uint8_t buf[4];
104 }
105 break;
107 #define BSWAP(struct, field) bswap(bswap_buf, offsetof(struct, field), sizeof(((struct){0}).field))
108 #define BSWAP_RAT(struct, field) do {BSWAP(struct, field.num); BSWAP(struct, field.den);} while(0)
117 }
118 goto pod;
125 }
126 goto pod;
141 //!!! overlap_process_option
151 }
153 }
157 BSWAP_RAT(
AVDynamicHDRPlus, targeted_system_display_actual_peak_luminance[
i][j]);
159 }
160 }
161 pod:
162 #endif
163
164 default:
166 break;
170 side_data_crc = 0;
171 }
172
175 }
176 }
179 return 0;
180 }
181
183 .
p.
name =
"framecrc",
191 };
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
This struct describes the properties of an encoded stream.
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
@ AV_PKT_DATA_FALLBACK_TRACK
This side data contains an integer value representing the stream index of a "fallback" track.
@ AV_PKT_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1:2014.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
@ AV_PKT_DATA_REPLAYGAIN
This side data should be associated with an audio stream and contains ReplayGain information in form ...
@ AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM
IAMF Recon Gain Info Parameter Data associated with the audio frame.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
static double val(void *priv, double ch)
#define FF_ARRAY_ELEMS(a)
static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
This structure describes the bitrate properties of an encoded bitstream.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
enum AVPacketSideDataType type
static int framecrc_write_header(struct AVFormatContext *s)
static void bswap_buf(uint32_t *dst, const uint32_t *src, int w)
This structure supplies correlation between a packet timestamp and a wall clock production time.
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
int extradata_size
Size of the extradata content in bytes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PKT_DATA_DYNAMIC_HDR10_PLUS
HDR10+ dynamic metadata associated with a video frame.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
@ AV_PKT_DATA_PRFT
Producer Reference Time data corresponding to the AVProducerReferenceTime struct, usually exported by...
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 offset
int flags
A combination of AV_PKT_FLAG values.
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
const FFOutputFormat ff_framecrc_muxer
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
Writes a formatted string to the context.
@ AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
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.
static av_unused void bswap(char *buf, int offset, int size)
static uint64_t av_const av_bswap64(uint64_t x)
@ AV_PKT_DATA_IAMF_MIX_GAIN_PARAM
IAMF Mix Gain Parameter Data associated with the audio frame.
@ AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM
IAMF Demixing Info Parameter Data associated with the audio frame.
Generated on Wed Nov 19 2025 19:23:12 for FFmpeg by
doxygen
1.8.17