]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 28 Jun 2012 21:57:31 +0000 (23:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 28 Jun 2012 21:57:31 +0000 (23:57 +0200)
* qatar/master:
  flv: add support for G.711
  doc: git: Add checklist with test steps to perform before pushing
  flvenc: K&R formatting cosmetics
  movenc: Add channel layouts for PCM.

Conflicts:
libavformat/flvenc.c
tests/ref/fate/acodec-pcm-s16be
tests/ref/fate/acodec-pcm-s24be
tests/ref/fate/acodec-pcm-s32be
tests/ref/fate/acodec-pcm-s8

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
doc/git-howto.texi
libavformat/flv.h
libavformat/flvdec.c
libavformat/flvenc.c
tests/ref/fate/acodec-pcm-s16be
tests/ref/fate/acodec-pcm-s24be
tests/ref/fate/acodec-pcm-s32be
tests/ref/fate/acodec-pcm-s8

index 44514537ecb0029d317ba46932f59d1874c4df73,938e165c1beb9b6c9a16ad60c5893af54bbb6eba..12025a5eed59f0df82bb93d684c382ea779a139f
@@@ -346,7 -346,62 +346,55 @@@ git checkout -b svn_23456 $SHA
  
  where @var{$SHA1} is the commit hash from the @command{git log} output.
  
 -descendant of the Libav master branch, which is the only one from which
 -pushing to Libav is possible. Then run the following command:
+ @chapter pre-push checklist
+ Once you have a set of commits that you feel are ready for pushing,
+ work through the following checklist to doublecheck everything is in
+ proper order. This list tries to be exhaustive. In case you are just
+ pushing a typo in a comment, some of the steps may be unnecessary.
+ Apply your common sense, but if in doubt, err on the side of caution.
+ First make sure your Git repository is on a branch that is a direct
 -@item @command{/path/to/libav/configure}
++descendant of the FFmpeg master branch, which is the only one from which
++pushing to FFmpeg is possible. Then run the following command:
+ @itemize
+ @item @command{git log --patch --stat origin/master..}
+ to make sure that only the commits you want to push are pending, that
+ the log messages of the commits are correct and descriptive and contain
+ no cruft from @command{git am} and to doublecheck that the commits you
+ want to push really only contain the changes they are supposed to contain.
+ @item @command{git status}
+ to ensure no local changes still need to be committed and that no local
+ changes may have thrown off the results of your testing.
+ @end itemize
+ Next let the code pass through a full run of our testsuite. Before you do,
+ the command @command{make fate-rsync} will update the test samples. Changes
+ to the samples set are not very common and commits depending on samples
+ changes are delayed for at least 24 hours to allow the new samples to
+ propagate, so updating it once per day is sufficient.  Now execute
+ @itemize
+ @item @command{make distclean}
 -Finally, after pushing, mark all patches as committed on
 -@url{http://patches.libav.org/,patchwork}.
 -Sometimes this is not automatically done when a patch has been
 -slightly modified from the version on the mailing list.
 -Also update previous incarnations of the patches you push so that
 -patchwork is not cluttered with cruft.
 -
++@item @command{/path/to/ffmpeg/configure}
+ @item @command{make check}
+ @end itemize
+ While the test suite covers a wide range of possible problems, it is not
+ a panacea. Do not hesitate to perform any other tests necessary to convince
+ yourself that the changes you are about to push actually work as expected.
+ Also note that every single commit should pass the test suite, not just
+ the result of a series of patches. So if you have a series of related
+ commits, run the test suite on every single commit.
  @chapter Server Issues
  
 -Contact the project admins @email{git@@libav.org} if you have technical
 +Contact the project admins @email{root@@ffmpeg.org} if you have technical
  problems with the GIT server.
Simple merge
Simple merge
index c636c66badd2c6eafe34ff33ab599c832c29cf7a,d77507dd620a6fa2ec00f28507ecc3c1bdda33dc..f6933a7b3590dbcc784fff119d8cf7e07ea0637c
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include "libavutil/intreadwrite.h"
+ #include "libavutil/dict.h"
  #include "libavutil/intfloat.h"
++#include "libavutil/avassert.h"
+ #include "avc.h"
  #include "avformat.h"
  #include "flv.h"
  #include "internal.h"
- #include "avc.h"
  #include "metadata.h"
- #include "libavutil/dict.h"
- #include "libavutil/avassert.h"
  
 -#undef NDEBUG
 -#include <assert.h>
  
  static const AVCodecTag flv_video_codec_ids[] = {
-     {CODEC_ID_FLV1,    FLV_CODECID_H263  },
-     {CODEC_ID_H263,    FLV_CODECID_REALH263},
-     {CODEC_ID_MPEG4,   FLV_CODECID_MPEG4 },
-     {CODEC_ID_FLASHSV, FLV_CODECID_SCREEN},
-     {CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2},
-     {CODEC_ID_VP6F,    FLV_CODECID_VP6   },
-     {CODEC_ID_VP6,     FLV_CODECID_VP6   },
-     {CODEC_ID_VP6A,    FLV_CODECID_VP6A  },
-     {CODEC_ID_H264,    FLV_CODECID_H264  },
-     {CODEC_ID_NONE,    0}
+     { CODEC_ID_FLV1,     FLV_CODECID_H263 },
++    { CODEC_ID_H263,     FLV_CODECID_REALH263 },
++    { CODEC_ID_MPEG4,    FLV_CODECID_MPEG4 },
+     { CODEC_ID_FLASHSV,  FLV_CODECID_SCREEN },
+     { CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2 },
+     { CODEC_ID_VP6F,     FLV_CODECID_VP6 },
+     { CODEC_ID_VP6,      FLV_CODECID_VP6 },
++    { CODEC_ID_VP6A,     FLV_CODECID_VP6A },
+     { CODEC_ID_H264,     FLV_CODECID_H264 },
+     { CODEC_ID_NONE,     0 }
  };
  
  static const AVCodecTag flv_audio_codec_ids[] = {
@@@ -356,13 -353,13 +372,13 @@@ static int flv_write_header(AVFormatCon
  
      for (i = 0; i < s->nb_streams; i++) {
          AVCodecContext *enc = s->streams[i]->codec;
 -        if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
 +        if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
              int64_t pos;
              avio_w8(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ?
-                      FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
+                     FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
              avio_wb24(pb, 0); // size patched later
              avio_wb24(pb, 0); // ts
-             avio_w8(pb, 0); // ts ext
+             avio_w8(pb, 0);   // ts ext
              avio_wb24(pb, 0); // streamid
              pos = avio_tell(pb);
              if (enc->codec_id == CODEC_ID_AAC) {
@@@ -399,9 -396,8 +415,8 @@@ static int flv_write_trailer(AVFormatCo
          AVCodecContext *enc = s->streams[i]->codec;
          FLVStreamContext *sc = s->streams[i]->priv_data;
          if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
-                 (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)) {
 -            enc->codec_id == CODEC_ID_H264)
++                (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4))
              put_avc_eos_tag(pb, sc->last_ts);
-         }
      }
  
      file_size = avio_tell(pb);
  
  static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
  {
-     AVIOContext *pb = s->pb;
-     AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
-     FLVContext *flv = s->priv_data;
+     AVIOContext *pb      = s->pb;
+     AVCodecContext *enc  = s->streams[pkt->stream_index]->codec;
+     FLVContext *flv      = s->priv_data;
      FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data;
      unsigned ts;
-     int size= pkt->size;
-     uint8_t *data= NULL;
+     int size = pkt->size;
+     uint8_t *data = NULL;
      int flags, flags_size;
  
- //    av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", enc->codec_type, timestamp, size);
+     // av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n",
+     //        enc->codec_type, timestamp, size);
  
-     if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
-        enc->codec_id == CODEC_ID_VP6A || enc->codec_id == CODEC_ID_AAC)
-         flags_size= 2;
-     else if(enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)
-         flags_size= 5;
+     if (enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
 -        enc->codec_id == CODEC_ID_AAC)
++        enc->codec_id == CODEC_ID_VP6A || enc->codec_id == CODEC_ID_AAC)
+         flags_size = 2;
 -    else if (enc->codec_id == CODEC_ID_H264)
++    else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)
+         flags_size = 5;
      else
-         flags_size= 1;
+         flags_size = 1;
  
      switch (enc->codec_type) {
      case AVMEDIA_TYPE_VIDEO:
          avio_w8(pb, FLV_TAG_TYPE_VIDEO);
  
          flags = enc->codec_tag;
-         if(flags == 0) {
-             av_log(s, AV_LOG_ERROR, "video codec %s not compatible with flv\n", avcodec_get_name(enc->codec_id));
+         if (flags == 0) {
+             av_log(s, AV_LOG_ERROR,
 -                   "video codec %X not compatible with flv\n",
 -                   enc->codec_id);
++                   "video codec %s not compatible with flv\n",
++                   avcodec_get_name(enc->codec_id));
              return -1;
          }
  
      default:
          return AVERROR(EINVAL);
      }
 -    if (enc->codec_id == CODEC_ID_H264)
 -        /* check if extradata looks like MP4 */
-         if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
 +    if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
 +        /* check if extradata looks like mp4 formated */
+         if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1)
              if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
                  return -1;
-         }
 +    } else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
 +               (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
 +        av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
 +        return -1;
 +    }
      if (flv->delay == AV_NOPTS_VALUE)
          flv->delay = -pkt->dts;
      if (pkt->dts < -flv->delay) {
-         av_log(s, AV_LOG_WARNING, "Packets are not in the proper order with "
-                                   "respect to DTS\n");
+         av_log(s, AV_LOG_WARNING,
+                "Packets are not in the proper order with respect to DTS\n");
          return AVERROR(EINVAL);
      }
  
          avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
          avio_wb32(pb, data_size + 11);
      } else {
-     avio_w8(pb,flags);
-     if (enc->codec_id == CODEC_ID_VP6)
-         avio_w8(pb,0);
-     if (enc->codec_id == CODEC_ID_VP6F || enc->codec_id == CODEC_ID_VP6A)
-         avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);
-     else if (enc->codec_id == CODEC_ID_AAC)
-         avio_w8(pb,1); // AAC raw
-     else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
-         avio_w8(pb,1); // AVC NALU
-         avio_wb24(pb,pkt->pts - pkt->dts);
-     }
+         avio_w8(pb,flags);
+         if (enc->codec_id == CODEC_ID_VP6)
 -            avio_w8(pb, 0);
 -        if (enc->codec_id == CODEC_ID_VP6F)
++            avio_w8(pb,0);
++        if (enc->codec_id == CODEC_ID_VP6F || enc->codec_id == CODEC_ID_VP6A)
+             avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);
+         else if (enc->codec_id == CODEC_ID_AAC)
 -            avio_w8(pb, 1); // AAC raw
 -        else if (enc->codec_id == CODEC_ID_H264) {
 -            avio_w8(pb, 1); // AVC NALU
 -            avio_wb24(pb, pkt->pts - pkt->dts);
++            avio_w8(pb,1); // AAC raw
++        else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
++            avio_w8(pb,1); // AVC NALU
++            avio_wb24(pb,pkt->pts - pkt->dts);
+         }
  
-     avio_write(pb, data ? data : pkt->data, size);
+         avio_write(pb, data ? data : pkt->data, size);
  
-     avio_wb32(pb,size+flags_size+11); // previous tag size
-     flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
+         avio_wb32(pb, size + flags_size + 11); // previous tag size
+         flv->duration = FFMAX(flv->duration,
+                               pkt->pts + flv->delay + pkt->duration);
      }
-     avio_flush(pb);
  
+     avio_flush(pb);
      av_free(data);
  
      return pb->error;
index 1cf04ed45e559b848de4b1506cb2810404c76776,39c3838a89ae62b42b513b7a53f8eefeee209fb4..6f7222a930a8b4af03e884aca01d11b8dae271dc
@@@ -1,4 -1,4 +1,4 @@@
- 8bffa66afe9e17366af11e77882518a0 *tests/data/fate/acodec-pcm-s16be.mov
 -009a446579dd4cba793723b5e2b93c39 *tests/data/fate/acodec-pcm-s16be.mov
 -1060097 tests/data/fate/acodec-pcm-s16be.mov
++d00ca427a66be2e33ca8d63bcde41316 *tests/data/fate/acodec-pcm-s16be.mov
 +1059069 tests/data/fate/acodec-pcm-s16be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s16be.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index d0376a6eafeae9484ac69748facfe853c5c86326,20bc4e0f09e237d1fbe91a52644c2f7ea60180e5..c89e086630832f2f819905d4456092ee64e2748c
@@@ -1,4 -1,4 +1,4 @@@
- e3013cfce9b792acb9d572268012160d *tests/data/fate/acodec-pcm-s24be.mov
 -de27dae0dff0359d8f39449b17d5607f *tests/data/fate/acodec-pcm-s24be.mov
 -1589297 tests/data/fate/acodec-pcm-s24be.mov
++5d843e1f56796aae3185016f164b16b7 *tests/data/fate/acodec-pcm-s24be.mov
 +1588269 tests/data/fate/acodec-pcm-s24be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24be.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index 656a6b2a61eebe4b79b8be29dd33735fd42c02e2,302bc1ab04fa9f6f14edbfdcb26849052734389c..f7dbc52d47d17b2acb669e93180f3668052b746f
@@@ -1,4 -1,4 +1,4 @@@
- f3ef00480e89c5c791e87b8af1cc167c *tests/data/fate/acodec-pcm-s32be.mov
 -2db1e7fe92d4006103691a4b59064dc6 *tests/data/fate/acodec-pcm-s32be.mov
 -2118497 tests/data/fate/acodec-pcm-s32be.mov
++b34c66c56df1b1e75688929cf20670b9 *tests/data/fate/acodec-pcm-s32be.mov
 +2117473 tests/data/fate/acodec-pcm-s32be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32be.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index cabf004983ff7d87052ffbe5c0653fafc5a57909,f830d2fb335d07a8ad269ea2bfc58723676fb366..247c46c5cc36677312be2515406b8a55a5d91d1b
@@@ -1,4 -1,4 +1,4 @@@
- 2c504a4e48c19ea1b0e1705893b771bf *tests/data/fate/acodec-pcm-s8.mov
 -9ee95a7fff38831a1cad3b49c33e6ed9 *tests/data/fate/acodec-pcm-s8.mov
 -530897 tests/data/fate/acodec-pcm-s8.mov
++d931dc4fffa2d3398e0f31f97e7d6c3a *tests/data/fate/acodec-pcm-s8.mov
 +529853 tests/data/fate/acodec-pcm-s8.mov
  651d4eb8d98dfcdda96ae6c43d8f156b *tests/data/fate/acodec-pcm-s8.out.wav
  stddev:  147.89 PSNR: 52.93 MAXDIFF:  255 bytes:  1058400/  1058400