Go to the documentation of this file.
37 #define OFFSET(x) offsetof(struct HashContext, x)
38 #define ENC AV_OPT_FLAG_ENCODING_PARAM
39 #if CONFIG_HASH_MUXER || CONFIG_FRAMEHASH_MUXER
40 static const AVOption hash_options[] = {
47 #if CONFIG_MD5_MUXER || CONFIG_FRAMEMD5_MUXER
48 static const AVOption md5_options[] = {
55 #if CONFIG_HASH_MUXER || CONFIG_MD5_MUXER
90 static const AVClass hashenc_class = {
93 .option = hash_options,
103 .write_header = hash_write_header,
104 .write_packet = hash_write_packet,
105 .write_trailer = hash_write_trailer,
108 .priv_class = &hashenc_class,
113 static const AVClass md5enc_class = {
116 .option = md5_options,
126 .write_header = hash_write_header,
127 .write_packet = hash_write_packet,
128 .write_trailer = hash_write_trailer,
131 .priv_class = &md5enc_class,
135 #if CONFIG_FRAMEHASH_MUXER || CONFIG_FRAMEMD5_MUXER
140 for (
i = 0;
i <
s->nb_streams;
i++) {
166 framehash_print_extradata(
s);
168 avio_printf(
s->pb,
"#stream#, dts, pts, duration, size, hash\n");
218 #if CONFIG_FRAMEHASH_MUXER
219 static const AVClass framehash_class = {
222 .option = hash_options,
232 .write_header = framehash_write_header,
233 .write_packet = framehash_write_packet,
234 .write_trailer = framehash_write_trailer,
237 .priv_class = &framehash_class,
241 #if CONFIG_FRAMEMD5_MUXER
242 static const AVClass framemd5_class = {
245 .option = md5_options,
255 .write_header = framehash_write_header,
256 .write_packet = framehash_write_packet,
257 .write_trailer = framehash_write_trailer,
260 .priv_class = &framemd5_class,
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define AV_HASH_MAX_SIZE
Maximum value that av_hash_get_size() will currently return.
This struct describes the properties of an encoded stream.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
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,...)
const char * av_hash_get_name(const AVHashContext *ctx)
int av_hash_alloc(AVHashContext **ctx, const char *name)
Allocate a hash context for the algorithm specified by name.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
void av_hash_init(AVHashContext *ctx)
Initialize or reset a hash context.
enum AVPacketSideDataType type
const char * av_default_item_name(void *ptr)
Return the context name.
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
void av_hash_freep(AVHashContext **ctx)
Free hash context and set hash context pointer to NULL.
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.
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)
#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...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
Update a hash context with additional data.
void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size)
Finalize a hash context and store the hexadecimal representation of the actual hash value as a string...
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
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.
struct AVHashContext * hash