[PATCH 06/11] Define ff_nut_video_tags and make Nut muxer and demuxer set it in codec_tag.
Stefano Sabatini
stefano.sabatini-lala
Sun May 9 12:24:14 CEST 2010
This allows the muxer to use the Nut rawvideo pixel formats codec
tags.
---
libavformat/nut.c | 33 +++++++++++++++++++++++++++++++++
libavformat/nut.h | 1 +
libavformat/nutdec.c | 1 +
libavformat/nutenc.c | 2 +-
4 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 9a6a41b..17fc146 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -30,6 +30,39 @@ const AVCodecTag ff_nut_subtitle_tags[] = {
{ CODEC_ID_NONE , 0 }
};
+const AVCodecTag ff_nut_video_tags[] = {
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 16 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 16 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG(15 , 'B', 'G', 'R') },
+ { CODEC_ID_RAWVIDEO, MKTAG(15 , 'R', 'G', 'B') },
+ { CODEC_ID_RAWVIDEO, MKTAG(16 , 'B', 'G', 'R') },
+ { CODEC_ID_RAWVIDEO, MKTAG(16 , 'R', 'G', 'B') },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 'A') },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 'A') },
+ { CODEC_ID_RAWVIDEO, MKTAG('A', 'B', 'G', 'R') },
+ { CODEC_ID_RAWVIDEO, MKTAG('A', 'R', 'G', 'B') },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 24 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 24 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '1', '1', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', '1', 'W', '0') },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', '0', 'W', '1') },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 8 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 8 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 4 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 4 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 48 ) },
+ { CODEC_ID_RAWVIDEO, MKTAG(48 , 'R', 'G', 'B') },
+ { CODEC_ID_NONE , 0 }
+};
+
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
int i;
for(i=0; i<nut->avf->nb_streams; i++){
diff --git a/libavformat/nut.h b/libavformat/nut.h
index ce052df..7013fb1 100644
--- a/libavformat/nut.h
+++ b/libavformat/nut.h
@@ -99,6 +99,7 @@ typedef struct {
} NUTContext;
extern const AVCodecTag ff_nut_subtitle_tags[];
+extern const AVCodecTag ff_nut_video_tags[];
typedef struct {
char str[9];
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 5d5cd55..293f67d 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -924,5 +924,6 @@ AVInputFormat nut_demuxer = {
read_seek,
.extensions = "nut",
.metadata_conv = ff_nut_metadata_conv,
+ .codec_tag = (const AVCodecTag * const []) { ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, ff_nut_subtitle_tags, 0 },
};
#endif
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index dfda3ca..acd0180 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -823,6 +823,6 @@ AVOutputFormat nut_muxer = {
write_packet,
write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
- .codec_tag= (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_subtitle_tags, 0},
+ .codec_tag = (const AVCodecTag * const []){ ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, ff_nut_subtitle_tags, 0 },
.metadata_conv = ff_nut_metadata_conv,
};
--
1.7.1
--VbJkn9YxBvnuCH5J
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0007-Make-the-nut-decoder-read-the-ff_nut_video_tags-to-d.patch"
More information about the ffmpeg-devel
mailing list