diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2007-05-09 23:07:40 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2007-05-09 23:07:40 +0000 |
commit | 13dec85765f8c1b57d152e691f51ec86152b0e4a (patch) | |
tree | 0fdd84f20a3dcce72a0a9226ad3f7bb4df7f7def | |
parent | de8e2c1d22bf691c9874c33528e16615b6c451a1 (diff) | |
download | ffmpeg-13dec85765f8c1b57d152e691f51ec86152b0e4a.tar.gz |
RoQ muxer, patch by Vitor, vitor1001 gmail com
reference thread:
Subject: [FFmpeg-devel] [PATCH] RoQ muxer
Date: Wed, 09 May 2007 19:44:21 +0200
Originally committed as revision 8959 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | doc/ffmpeg-doc.texi | 2 | ||||
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 2 | ||||
-rw-r--r-- | libavformat/allformats.h | 1 | ||||
-rw-r--r-- | libavformat/raw.c | 29 |
5 files changed, 33 insertions, 2 deletions
diff --git a/doc/ffmpeg-doc.texi b/doc/ffmpeg-doc.texi index 8269aabdf7..f70b8b8f10 100644 --- a/doc/ffmpeg-doc.texi +++ b/doc/ffmpeg-doc.texi @@ -894,7 +894,7 @@ library: @item 4xm @tab @tab X @tab 4X Technologies format, used in some games. @item Playstation STR @tab @tab X -@item Id RoQ @tab @tab X +@item Id RoQ @tab X @tab X @tab Used in Quake III, Jedi Knight 2, other computer games. @item Interplay MVE @tab @tab X @tab Format used in various Interplay computer games. diff --git a/libavformat/Makefile b/libavformat/Makefile index 256bd9e4e2..009d1635bc 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -116,6 +116,7 @@ OBJS-$(CONFIG_REDIR_DEMUXER) += rtsp.o OBJS-$(CONFIG_RM_DEMUXER) += rm.o OBJS-$(CONFIG_RM_MUXER) += rm.o OBJS-$(CONFIG_ROQ_DEMUXER) += idroq.o +OBJS-$(CONFIG_ROQ_MUXER) += raw.o OBJS-$(CONFIG_RTP_MUXER) += rtp.o rtp_h264.o OBJS-$(CONFIG_RTSP_DEMUXER) += rtsp.o OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 276e4aca71..84ba0671ef 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -131,7 +131,7 @@ void av_register_all(void) REGISTER_MUXER (PSP, psp); REGISTER_MUXDEMUX(RAWVIDEO, rawvideo); REGISTER_MUXDEMUX(RM, rm); - REGISTER_DEMUXER (ROQ, roq); + REGISTER_MUXDEMUX(ROQ, roq); REGISTER_DEMUXER (REDIR, redir); REGISTER_MUXER (RTP, rtp); REGISTER_DEMUXER (RTSP, rtsp); diff --git a/libavformat/allformats.h b/libavformat/allformats.h index 698941e480..4c9a904067 100644 --- a/libavformat/allformats.h +++ b/libavformat/allformats.h @@ -169,6 +169,7 @@ extern AVOutputFormat pcm_u8_muxer; extern AVOutputFormat psp_muxer; extern AVOutputFormat rawvideo_muxer; extern AVOutputFormat rm_muxer; +extern AVOutputFormat roq_muxer; extern AVOutputFormat swf_muxer; extern AVOutputFormat tg2_muxer; extern AVOutputFormat tgp_muxer; diff --git a/libavformat/raw.c b/libavformat/raw.c index 9f12e551d8..cdacfa81f1 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -43,6 +43,19 @@ static int flac_write_header(struct AVFormatContext *s) return 0; } + +static int roq_write_header(struct AVFormatContext *s) +{ + static const uint8_t header[] = { + 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00 + }; + + put_buffer(&s->pb, header, 8); + put_flush_packet(&s->pb); + + return 0; +} + static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt) { put_buffer(&s->pb, pkt->data, pkt->size); @@ -527,6 +540,22 @@ AVInputFormat aac_demuxer = { .extensions = "aac", }; +#ifdef CONFIG_ROQ_MUXER +AVOutputFormat roq_muxer = +{ + "RoQ", + "Id RoQ format", + NULL, + "roq", + 0, + CODEC_ID_ROQ_DPCM, + CODEC_ID_ROQ, + roq_write_header, + raw_write_packet, + raw_write_trailer, +}; +#endif //CONFIG_ROQ_MUXER + AVInputFormat h261_demuxer = { "h261", "raw h261", |