Browse code

move id roq muxer to its own file

Originally committed as revision 24968 to svn://svn.ffmpeg.org/ffmpeg/trunk

Aurelien Jacobs authored on 2010/08/30 01:35:44
Showing 4 changed files
... ...
@@ -210,7 +210,7 @@ OBJS-$(CONFIG_RL2_DEMUXER)               += rl2.o
210 210
 OBJS-$(CONFIG_RM_DEMUXER)                += rmdec.o rm.o
211 211
 OBJS-$(CONFIG_RM_MUXER)                  += rmenc.o rm.o
212 212
 OBJS-$(CONFIG_ROQ_DEMUXER)               += idroq.o
213
-OBJS-$(CONFIG_ROQ_MUXER)                 += raw.o
213
+OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o
214 214
 OBJS-$(CONFIG_RSO_DEMUXER)               += rsodec.o rso.o raw.o
215 215
 OBJS-$(CONFIG_RSO_MUXER)                 += rsoenc.o rso.o
216 216
 OBJS-$(CONFIG_RPL_DEMUXER)               += rpl.o
217 217
new file mode 100644
... ...
@@ -0,0 +1,49 @@
0
+/*
1
+ * id RoQ (.roq) File muxer
2
+ * Copyright (c) 2007 Vitor Sessak
3
+ *
4
+ * This file is part of FFmpeg.
5
+ *
6
+ * FFmpeg is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * FFmpeg is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with FFmpeg; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
+ */
20
+
21
+#include "avformat.h"
22
+#include "raw.h"
23
+
24
+
25
+static int roq_write_header(struct AVFormatContext *s)
26
+{
27
+    static const uint8_t header[] = {
28
+        0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
29
+    };
30
+
31
+    put_buffer(s->pb, header, 8);
32
+    put_flush_packet(s->pb);
33
+
34
+    return 0;
35
+}
36
+
37
+AVOutputFormat roq_muxer =
38
+{
39
+    "RoQ",
40
+    NULL_IF_CONFIG_SMALL("raw id RoQ format"),
41
+    NULL,
42
+    "roq",
43
+    0,
44
+    CODEC_ID_ROQ_DPCM,
45
+    CODEC_ID_ROQ,
46
+    roq_write_header,
47
+    ff_raw_write_packet,
48
+};
... ...
@@ -31,20 +31,6 @@
31 31
 
32 32
 /* simple formats */
33 33
 
34
-#if CONFIG_ROQ_MUXER
35
-static int roq_write_header(struct AVFormatContext *s)
36
-{
37
-    static const uint8_t header[] = {
38
-        0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
39
-    };
40
-
41
-    put_buffer(s->pb, header, 8);
42
-    put_flush_packet(s->pb);
43
-
44
-    return 0;
45
-}
46
-#endif
47
-
48 34
 #if CONFIG_NULL_MUXER
49 35
 static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
50 36
 {
... ...
@@ -53,7 +39,7 @@ static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
53 53
 #endif
54 54
 
55 55
 #if CONFIG_MUXERS
56
-static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
56
+int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
57 57
 {
58 58
     put_buffer(s->pb, pkt->data, pkt->size);
59 59
     put_flush_packet(s->pb);
... ...
@@ -688,7 +674,7 @@ AVOutputFormat ac3_muxer = {
688 688
     CODEC_ID_AC3,
689 689
     CODEC_ID_NONE,
690 690
     NULL,
691
-    raw_write_packet,
691
+    ff_raw_write_packet,
692 692
     .flags= AVFMT_NOTIMESTAMPS,
693 693
 };
694 694
 #endif
... ...
@@ -716,7 +702,7 @@ AVOutputFormat dirac_muxer = {
716 716
     CODEC_ID_NONE,
717 717
     CODEC_ID_DIRAC,
718 718
     NULL,
719
-    raw_write_packet,
719
+    ff_raw_write_packet,
720 720
     .flags= AVFMT_NOTIMESTAMPS,
721 721
 };
722 722
 #endif
... ...
@@ -744,7 +730,7 @@ AVOutputFormat dnxhd_muxer = {
744 744
     CODEC_ID_NONE,
745 745
     CODEC_ID_DNXHD,
746 746
     NULL,
747
-    raw_write_packet,
747
+    ff_raw_write_packet,
748 748
     .flags= AVFMT_NOTIMESTAMPS,
749 749
 };
750 750
 #endif
... ...
@@ -773,7 +759,7 @@ AVOutputFormat dts_muxer = {
773 773
     CODEC_ID_DTS,
774 774
     CODEC_ID_NONE,
775 775
     NULL,
776
-    raw_write_packet,
776
+    ff_raw_write_packet,
777 777
     .flags= AVFMT_NOTIMESTAMPS,
778 778
 };
779 779
 #endif
... ...
@@ -802,7 +788,7 @@ AVOutputFormat eac3_muxer = {
802 802
     CODEC_ID_EAC3,
803 803
     CODEC_ID_NONE,
804 804
     NULL,
805
-    raw_write_packet,
805
+    ff_raw_write_packet,
806 806
     .flags= AVFMT_NOTIMESTAMPS,
807 807
 };
808 808
 #endif
... ...
@@ -845,7 +831,7 @@ AVOutputFormat h261_muxer = {
845 845
     CODEC_ID_NONE,
846 846
     CODEC_ID_H261,
847 847
     NULL,
848
-    raw_write_packet,
848
+    ff_raw_write_packet,
849 849
     .flags= AVFMT_NOTIMESTAMPS,
850 850
 };
851 851
 #endif
... ...
@@ -874,7 +860,7 @@ AVOutputFormat h263_muxer = {
874 874
     CODEC_ID_NONE,
875 875
     CODEC_ID_H263,
876 876
     NULL,
877
-    raw_write_packet,
877
+    ff_raw_write_packet,
878 878
     .flags= AVFMT_NOTIMESTAMPS,
879 879
 };
880 880
 #endif
... ...
@@ -903,7 +889,7 @@ AVOutputFormat h264_muxer = {
903 903
     CODEC_ID_NONE,
904 904
     CODEC_ID_H264,
905 905
     NULL,
906
-    raw_write_packet,
906
+    ff_raw_write_packet,
907 907
     .flags= AVFMT_NOTIMESTAMPS,
908 908
 };
909 909
 #endif
... ...
@@ -918,7 +904,7 @@ AVOutputFormat cavsvideo_muxer = {
918 918
     CODEC_ID_NONE,
919 919
     CODEC_ID_CAVS,
920 920
     NULL,
921
-    raw_write_packet,
921
+    ff_raw_write_packet,
922 922
     .flags= AVFMT_NOTIMESTAMPS,
923 923
 };
924 924
 #endif
... ...
@@ -961,7 +947,7 @@ AVOutputFormat m4v_muxer = {
961 961
     CODEC_ID_NONE,
962 962
     CODEC_ID_MPEG4,
963 963
     NULL,
964
-    raw_write_packet,
964
+    ff_raw_write_packet,
965 965
     .flags= AVFMT_NOTIMESTAMPS,
966 966
 };
967 967
 #endif
... ...
@@ -990,7 +976,7 @@ AVOutputFormat mjpeg_muxer = {
990 990
     CODEC_ID_NONE,
991 991
     CODEC_ID_MJPEG,
992 992
     NULL,
993
-    raw_write_packet,
993
+    ff_raw_write_packet,
994 994
     .flags= AVFMT_NOTIMESTAMPS,
995 995
 };
996 996
 #endif
... ...
@@ -1019,7 +1005,7 @@ AVOutputFormat mlp_muxer = {
1019 1019
     CODEC_ID_MLP,
1020 1020
     CODEC_ID_NONE,
1021 1021
     NULL,
1022
-    raw_write_packet,
1022
+    ff_raw_write_packet,
1023 1023
     .flags= AVFMT_NOTIMESTAMPS,
1024 1024
 };
1025 1025
 #endif
... ...
@@ -1030,7 +1016,7 @@ AVOutputFormat srt_muxer = {
1030 1030
     .long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
1031 1031
     .mime_type      = "application/x-subrip",
1032 1032
     .extensions     = "srt",
1033
-    .write_packet   = raw_write_packet,
1033
+    .write_packet   = ff_raw_write_packet,
1034 1034
     .flags          = AVFMT_NOTIMESTAMPS,
1035 1035
     .subtitle_codec = CODEC_ID_SRT,
1036 1036
 };
... ...
@@ -1060,7 +1046,7 @@ AVOutputFormat truehd_muxer = {
1060 1060
     CODEC_ID_TRUEHD,
1061 1061
     CODEC_ID_NONE,
1062 1062
     NULL,
1063
-    raw_write_packet,
1063
+    ff_raw_write_packet,
1064 1064
     .flags= AVFMT_NOTIMESTAMPS,
1065 1065
 };
1066 1066
 #endif
... ...
@@ -1075,7 +1061,7 @@ AVOutputFormat mpeg1video_muxer = {
1075 1075
     CODEC_ID_NONE,
1076 1076
     CODEC_ID_MPEG1VIDEO,
1077 1077
     NULL,
1078
-    raw_write_packet,
1078
+    ff_raw_write_packet,
1079 1079
     .flags= AVFMT_NOTIMESTAMPS,
1080 1080
 };
1081 1081
 #endif
... ...
@@ -1090,7 +1076,7 @@ AVOutputFormat mpeg2video_muxer = {
1090 1090
     CODEC_ID_NONE,
1091 1091
     CODEC_ID_MPEG2VIDEO,
1092 1092
     NULL,
1093
-    raw_write_packet,
1093
+    ff_raw_write_packet,
1094 1094
     .flags= AVFMT_NOTIMESTAMPS,
1095 1095
 };
1096 1096
 #endif
... ...
@@ -1164,26 +1150,11 @@ AVOutputFormat rawvideo_muxer = {
1164 1164
     CODEC_ID_NONE,
1165 1165
     CODEC_ID_RAWVIDEO,
1166 1166
     NULL,
1167
-    raw_write_packet,
1167
+    ff_raw_write_packet,
1168 1168
     .flags= AVFMT_NOTIMESTAMPS,
1169 1169
 };
1170 1170
 #endif
1171 1171
 
1172
-#if CONFIG_ROQ_MUXER
1173
-AVOutputFormat roq_muxer =
1174
-{
1175
-    "RoQ",
1176
-    NULL_IF_CONFIG_SMALL("raw id RoQ format"),
1177
-    NULL,
1178
-    "roq",
1179
-    0,
1180
-    CODEC_ID_ROQ_DPCM,
1181
-    CODEC_ID_ROQ,
1182
-    roq_write_header,
1183
-    raw_write_packet,
1184
-};
1185
-#endif
1186
-
1187 1172
 #if CONFIG_SHORTEN_DEMUXER
1188 1173
 AVInputFormat shorten_demuxer = {
1189 1174
     "shn",
... ...
@@ -1238,7 +1209,7 @@ AVOutputFormat pcm_ ## name ## _muxer = {\
1238 1238
     codec,\
1239 1239
     CODEC_ID_NONE,\
1240 1240
     NULL,\
1241
-    raw_write_packet,\
1241
+    ff_raw_write_packet,\
1242 1242
     .flags= AVFMT_NOTIMESTAMPS,\
1243 1243
 };
1244 1244
 
... ...
@@ -27,6 +27,8 @@
27 27
 int pcm_read_seek(AVFormatContext *s,
28 28
                   int stream_index, int64_t timestamp, int flags);
29 29
 
30
+int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt);
31
+
30 32
 int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
31 33
 
32 34
 #endif /* AVFORMAT_RAW_H */