Mercurial > libavformat.hg
changeset 3272:07038dc492ab libavformat
Import Dirac demuxer/muxer from SoC branch; written by Marco Gerards,
patch extracted by Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDoTuk.
author | lu_zero |
---|---|
date | Fri, 02 May 2008 14:52:39 +0000 |
parents | c702c1c5b890 |
children | 83a8b43761bc |
files | allformats.c raw.c |
diffstat | 2 files changed, 37 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/allformats.c Thu May 01 22:04:17 2008 +0000 +++ b/allformats.c Fri May 02 14:52:39 2008 +0000 @@ -69,6 +69,7 @@ REGISTER_DEMUXER (C93, c93); REGISTER_MUXER (CRC, crc); REGISTER_DEMUXER (DAUD, daud); + REGISTER_MUXDEMUX (DIRAC, dirac); REGISTER_DEMUXER (DSICIN, dsicin); REGISTER_MUXDEMUX (DTS, dts); REGISTER_MUXDEMUX (DV, dv);
--- a/raw.c Thu May 01 22:04:17 2008 +0000 +++ b/raw.c Fri May 02 14:52:39 2008 +0000 @@ -254,6 +254,7 @@ av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); } else if ( st->codec->codec_id == CODEC_ID_MJPEG || st->codec->codec_id == CODEC_ID_MPEG4 || + st->codec->codec_id == CODEC_ID_DIRAC || st->codec->codec_id == CODEC_ID_H264) { av_set_pts_info(st, 64, 1, 25); } @@ -346,6 +347,14 @@ return 0; } +static int dirac_probe(AVProbeData *p) +{ + if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D')) + return AVPROBE_SCORE_MAX; + else + return 0; +} + static int ac3_probe(AVProbeData *p) { int max_frames, first_frames = 0, frames; @@ -470,6 +479,33 @@ #endif //CONFIG_MUXERS +AVInputFormat dirac_demuxer = { + "dirac", + "raw dirac", + 0, + dirac_probe, + video_read_header, + raw_read_partial_packet, + raw_read_close, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_DIRAC, +}; + +#ifdef CONFIG_MUXERS +AVOutputFormat dirac_muxer = { + "dirac", + "raw dirac", + NULL, + "drc", + 0, + 0, + CODEC_ID_DIRAC, + NULL, + raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + AVInputFormat dts_demuxer = { "dts", "raw dts",