]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rawenc.c
lavf: move AVStream.last_in_packet_buffer to AVStreamInternal
[ffmpeg] / libavformat / rawenc.c
index 809ca23b1a5d28b2f735673619cfe3d288d4edcf..32704f9bfdf5df3b41cb7e2e8ba74d7473655be9 100644 (file)
@@ -39,6 +39,18 @@ static int force_one_stream(AVFormatContext *s)
                s->oformat->name);
         return AVERROR(EINVAL);
     }
+    if (   s->oformat->audio_codec != AV_CODEC_ID_NONE
+        && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
+        av_log(s, AV_LOG_ERROR, "%s files have exactly one audio stream\n",
+               s->oformat->name);
+        return AVERROR(EINVAL);
+    }
+    if (   s->oformat->video_codec != AV_CODEC_ID_NONE
+        && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
+        av_log(s, AV_LOG_ERROR, "%s files have exactly one video stream\n",
+               s->oformat->name);
+        return AVERROR(EINVAL);
+    }
     return 0;
 }
 
@@ -117,6 +129,19 @@ AVOutputFormat ff_aptx_hd_muxer = {
 };
 #endif
 
+#if CONFIG_AVS2_MUXER
+AVOutputFormat ff_avs2_muxer = {
+    .name              = "avs2",
+    .long_name         = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
+    .extensions        = "avs,avs2",
+    .audio_codec       = AV_CODEC_ID_NONE,
+    .video_codec       = AV_CODEC_ID_AVS2,
+    .write_header      = force_one_stream,
+    .write_packet      = ff_raw_write_packet,
+    .flags             = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
 #if CONFIG_CAVSVIDEO_MUXER
 AVOutputFormat ff_cavsvideo_muxer = {
     .name              = "cavsvideo",