diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-01-27 15:06:00 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-02-09 15:24:15 +0100 |
commit | 59c9dc82f450638a3068deeb1db5c56f6d155752 (patch) | |
tree | 936dabca4a3e593553f6e0c8409e530111c99c0c /libavformat/hashenc.c | |
parent | f23ae839fc184c4492e10f371cde5c1b55e51522 (diff) |
avformat/avformat: Move AVOutputFormat internals out of public header
This commit does for AVOutputFormat what commit
20f972701806be20a77f808db332d9489343bb78 did for AVCodec:
It adds a new type FFOutputFormat, moves all the internals
of AVOutputFormat to it and adds a now reduced AVOutputFormat
as first member.
This does not affect/improve extensibility of both public
or private fields for muxers (it is still a mess due to lavd).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/hashenc.c')
-rw-r--r-- | libavformat/hashenc.c | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 1aaba0b306..17ee2f7e9f 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -27,6 +27,7 @@ #include "libavutil/opt.h" #include "avformat.h" #include "internal.h" +#include "mux.h" struct HashContext { const AVClass *avclass; @@ -172,19 +173,19 @@ static void hash_free(struct AVFormatContext *s) } #if CONFIG_HASH_MUXER -const AVOutputFormat ff_hash_muxer = { - .name = "hash", - .long_name = NULL_IF_CONFIG_SMALL("Hash testing"), +const FFOutputFormat ff_hash_muxer = { + .p.name = "hash", + .p.long_name = NULL_IF_CONFIG_SMALL("Hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = hash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &hash_streamhashenc_class, + .p.priv_class = &hash_streamhashenc_class, }; #endif @@ -196,36 +197,36 @@ static const AVClass md5enc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_md5_muxer = { - .name = "md5", - .long_name = NULL_IF_CONFIG_SMALL("MD5 testing"), +const FFOutputFormat ff_md5_muxer = { + .p.name = "md5", + .p.long_name = NULL_IF_CONFIG_SMALL("MD5 testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = hash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &md5enc_class, + .p.priv_class = &md5enc_class, }; #endif #if CONFIG_STREAMHASH_MUXER -const AVOutputFormat ff_streamhash_muxer = { - .name = "streamhash", - .long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"), +const FFOutputFormat ff_streamhash_muxer = { + .p.name = "streamhash", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = streamhash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &hash_streamhashenc_class, + .p.priv_class = &hash_streamhashenc_class, }; #endif @@ -324,19 +325,19 @@ static const AVClass framehash_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_framehash_muxer = { - .name = "framehash", - .long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"), +const FFOutputFormat ff_framehash_muxer = { + .p.name = "framehash", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = framehash_init, .write_header = framehash_write_header, .write_packet = framehash_write_packet, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &framehash_class, + .p.priv_class = &framehash_class, }; #endif @@ -348,18 +349,18 @@ static const AVClass framemd5_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_framemd5_muxer = { - .name = "framemd5", - .long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"), +const FFOutputFormat ff_framemd5_muxer = { + .p.name = "framemd5", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = framehash_init, .write_header = framehash_write_header, .write_packet = framehash_write_packet, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &framemd5_class, + .p.priv_class = &framemd5_class, }; #endif |