]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ffmenc.c
Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
[ffmpeg] / libavformat / ffmenc.c
index 4bb28e23e82dc6e58ab76f2489bbd10ceae1574d..f9e0782c4bf00afedd9a3e4a5e6c12110d0cd629 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * FFM (ffserver live feed) muxer
- * Copyright (c) 2001 Fabrice Bellard.
+ * Copyright (c) 2001 Fabrice Bellard
  *
  * This file is part of FFmpeg.
  *
@@ -93,8 +93,7 @@ static int ffm_write_header(AVFormatContext *s)
     /* header */
     put_le32(pb, MKTAG('F', 'F', 'M', '1'));
     put_be32(pb, ffm->packet_size);
-    /* XXX: store write position in other file ? */
-    put_be64(pb, ffm->packet_size); /* current write position */
+    put_be64(pb, 0); /* current write position */
 
     put_be32(pb, s->nb_streams);
     bit_rate = 0;
@@ -120,7 +119,7 @@ static int ffm_write_header(AVFormatContext *s)
         put_be32(pb, codec->debug);
         /* specific info */
         switch(codec->codec_type) {
-        case CODEC_TYPE_VIDEO:
+        case AVMEDIA_TYPE_VIDEO:
             put_be32(pb, codec->time_base.num);
             put_be32(pb, codec->time_base.den);
             put_be16(pb, codec->width);
@@ -133,7 +132,7 @@ static int ffm_write_header(AVFormatContext *s)
             put_be16(pb, (int) (codec->qcompress * 10000.0));
             put_be16(pb, (int) (codec->qblur * 10000.0));
             put_be32(pb, codec->bit_rate_tolerance);
-            put_strz(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
+            avio_put_str(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
             put_be32(pb, codec->rc_max_rate);
             put_be32(pb, codec->rc_min_rate);
             put_be32(pb, codec->rc_buffer_size);
@@ -155,11 +154,25 @@ static int ffm_write_header(AVFormatContext *s)
             put_be64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
             put_be32(pb, codec->codec_tag);
             put_byte(pb, codec->thread_count);
+            put_be32(pb, codec->coder_type);
+            put_be32(pb, codec->me_cmp);
+            put_be32(pb, codec->partitions);
+            put_be32(pb, codec->me_subpel_quality);
+            put_be32(pb, codec->me_range);
+            put_be32(pb, codec->keyint_min);
+            put_be32(pb, codec->scenechange_threshold);
+            put_be32(pb, codec->b_frame_strategy);
+            put_be64(pb, av_dbl2int(codec->qcompress));
+            put_be64(pb, av_dbl2int(codec->qblur));
+            put_be32(pb, codec->max_qdiff);
+            put_be32(pb, codec->refs);
+            put_be32(pb, codec->directpred);
             break;
-        case CODEC_TYPE_AUDIO:
+        case AVMEDIA_TYPE_AUDIO:
             put_be32(pb, codec->sample_rate);
             put_le16(pb, codec->channels);
             put_le16(pb, codec->frame_size);
+            put_le16(pb, codec->sample_fmt);
             break;
         default:
             return -1;
@@ -197,7 +210,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
     /* packet size & key_frame */
     header[0] = pkt->stream_index;
     header[1] = 0;
-    if (pkt->flags & PKT_FLAG_KEY)
+    if (pkt->flags & AV_PKT_FLAG_KEY)
         header[1] |= FLAG_KEY_FRAME;
     AV_WB24(header+2, pkt->size);
     AV_WB24(header+5, pkt->duration);
@@ -224,19 +237,10 @@ static int ffm_write_trailer(AVFormatContext *s)
 
     put_flush_packet(pb);
 
-    if (!url_is_streamed(pb)) {
-        int64_t size;
-        /* update the write offset */
-        size = url_ftell(pb);
-        url_fseek(pb, 8, SEEK_SET);
-        put_be64(pb, size);
-        put_flush_packet(pb);
-    }
-
     return 0;
 }
 
-AVOutputFormat ffm_muxer = {
+AVOutputFormat ff_ffm_muxer = {
     "ffm",
     NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
     "",