]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rawenc.c
Merge commit '4d7ab5cfebef91820af2933ef2f622ea598e6b53'
[ffmpeg] / libavformat / rawenc.c
index eb5062610016db6a7d28b9ee28f4b753d8f1ad9b..abd7e66978e5eca159837374e9ec2e1c67baf3b0 100644 (file)
@@ -3,20 +3,20 @@
  * Copyright (c) 2001 Fabrice Bellard
  * Copyright (c) 2005 Alex Beregszaszi
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -29,6 +29,16 @@ int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
+static int force_one_stream(AVFormatContext *s)
+{
+    if (s->nb_streams != 1) {
+        av_log(s, AV_LOG_ERROR, "%s files have exactly one stream\n",
+               s->oformat->name);
+        return AVERROR(EINVAL);
+    }
+    return 0;
+}
+
 /* Note: Do not forget to add new entries to the Makefile as well. */
 
 #if CONFIG_AC3_MUXER
@@ -39,6 +49,7 @@ AVOutputFormat ff_ac3_muxer = {
     .extensions        = "ac3",
     .audio_codec       = AV_CODEC_ID_AC3,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -51,6 +62,7 @@ AVOutputFormat ff_adx_muxer = {
     .extensions        = "adx",
     .audio_codec       = AV_CODEC_ID_ADPCM_ADX,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -63,6 +75,17 @@ AVOutputFormat ff_cavsvideo_muxer = {
     .extensions        = "cavs",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_CAVS,
+    .write_header      = force_one_stream,
+    .write_packet      = ff_raw_write_packet,
+    .flags             = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_DATA_MUXER
+AVOutputFormat ff_data_muxer = {
+    .name              = "data",
+    .long_name         = NULL_IF_CONFIG_SMALL("raw data"),
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -75,6 +98,7 @@ AVOutputFormat ff_dirac_muxer = {
     .extensions        = "drc",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_DIRAC,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -87,6 +111,7 @@ AVOutputFormat ff_dnxhd_muxer = {
     .extensions        = "dnxhd",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_DNXHD,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -100,6 +125,7 @@ AVOutputFormat ff_dts_muxer = {
     .extensions        = "dts",
     .audio_codec       = AV_CODEC_ID_DTS,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -113,6 +139,7 @@ AVOutputFormat ff_eac3_muxer = {
     .extensions        = "eac3",
     .audio_codec       = AV_CODEC_ID_EAC3,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -126,6 +153,21 @@ AVOutputFormat ff_g722_muxer = {
     .extensions        = "g722",
     .audio_codec       = AV_CODEC_ID_ADPCM_G722,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
+    .write_packet      = ff_raw_write_packet,
+    .flags             = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_G723_1_MUXER
+AVOutputFormat ff_g723_1_muxer = {
+    .name              = "g723_1",
+    .long_name         = NULL_IF_CONFIG_SMALL("raw G.723.1"),
+    .mime_type         = "audio/g723",
+    .extensions        = "tco,rco",
+    .audio_codec       = AV_CODEC_ID_G723_1,
+    .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -139,6 +181,7 @@ AVOutputFormat ff_h261_muxer = {
     .extensions        = "h261",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_H261,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -152,6 +195,7 @@ AVOutputFormat ff_h263_muxer = {
     .extensions        = "h263",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_H263,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -164,6 +208,7 @@ AVOutputFormat ff_h264_muxer = {
     .extensions        = "h264",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_H264,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -201,6 +246,7 @@ AVOutputFormat ff_mjpeg_muxer = {
     .extensions        = "mjpg,mjpeg",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_MJPEG,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -213,6 +259,7 @@ AVOutputFormat ff_mlp_muxer = {
     .extensions        = "mlp",
     .audio_codec       = AV_CODEC_ID_MLP,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -226,6 +273,7 @@ AVOutputFormat ff_mpeg1video_muxer = {
     .extensions        = "mpg,mpeg,m1v",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -238,6 +286,7 @@ AVOutputFormat ff_mpeg2video_muxer = {
     .extensions        = "m2v",
     .audio_codec       = AV_CODEC_ID_NONE,
     .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
@@ -255,18 +304,6 @@ AVOutputFormat ff_rawvideo_muxer = {
 };
 #endif
 
-#if CONFIG_SRT_MUXER
-AVOutputFormat ff_srt_muxer = {
-    .name              = "srt",
-    .long_name         = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
-    .mime_type         = "application/x-subrip",
-    .extensions        = "srt",
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .subtitle_codec    = AV_CODEC_ID_SRT,
-};
-#endif
-
 #if CONFIG_TRUEHD_MUXER
 AVOutputFormat ff_truehd_muxer = {
     .name              = "truehd",
@@ -274,6 +311,20 @@ AVOutputFormat ff_truehd_muxer = {
     .extensions        = "thd",
     .audio_codec       = AV_CODEC_ID_TRUEHD,
     .video_codec       = AV_CODEC_ID_NONE,
+    .write_header      = force_one_stream,
+    .write_packet      = ff_raw_write_packet,
+    .flags             = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_VC1_MUXER
+AVOutputFormat ff_vc1_muxer = {
+    .name              = "vc1",
+    .long_name         = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
+    .extensions        = "vc1",
+    .audio_codec       = AV_CODEC_ID_NONE,
+    .video_codec       = AV_CODEC_ID_VC1,
+    .write_header      = force_one_stream,
     .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };