RoQ muxer, patch by Vitor, vitor1001 gmail com
authorVitor Sessak <vitor1001@gmail.com>
Wed, 9 May 2007 23:07:40 +0000 (23:07 +0000)
committerDiego Biurrun <diego@biurrun.de>
Wed, 9 May 2007 23:07:40 +0000 (23:07 +0000)
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

doc/ffmpeg-doc.texi
libavformat/Makefile
libavformat/allformats.c
libavformat/allformats.h
libavformat/raw.c

index 8269aab..f70b8b8 100644 (file)
@@ -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 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.
 @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.
index 256bd9e..009d163 100644 (file)
@@ -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_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
 OBJS-$(CONFIG_RTP_MUXER)                 += rtp.o rtp_h264.o
 OBJS-$(CONFIG_RTSP_DEMUXER)              += rtsp.o
 OBJS-$(CONFIG_SDP_DEMUXER)               += rtsp.o
index 276e4ac..84ba067 100644 (file)
@@ -131,7 +131,7 @@ void av_register_all(void)
     REGISTER_MUXER   (PSP, psp);
     REGISTER_MUXDEMUX(RAWVIDEO, rawvideo);
     REGISTER_MUXDEMUX(RM, rm);
     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);
     REGISTER_DEMUXER (REDIR, redir);
     REGISTER_MUXER   (RTP, rtp);
     REGISTER_DEMUXER (RTSP, rtsp);
index 698941e..4c9a904 100644 (file)
@@ -169,6 +169,7 @@ extern AVOutputFormat pcm_u8_muxer;
 extern AVOutputFormat psp_muxer;
 extern AVOutputFormat rawvideo_muxer;
 extern AVOutputFormat rm_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;
 extern AVOutputFormat swf_muxer;
 extern AVOutputFormat tg2_muxer;
 extern AVOutputFormat tgp_muxer;
index 9f12e55..cdacfa8 100644 (file)
@@ -43,6 +43,19 @@ static int flac_write_header(struct AVFormatContext *s)
     return 0;
 }
 
     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);
 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",
 };
 
     .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",
 AVInputFormat h261_demuxer = {
     "h261",
     "raw h261",