]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '84adab333cddeefc3cfd843089dee23f58bd372c'
authorHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 12:18:18 +0000 (13:18 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 12:18:18 +0000 (13:18 +0100)
* commit '84adab333cddeefc3cfd843089dee23f58bd372c':
  lavc: add stream-global packet side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
doc/APIchanges
libavcodec/avcodec.h
libavcodec/utils.c

diff --cc doc/APIchanges
index 265d6d548987fd9c5b3a37a6059fa3d4b3b827a9,bd7323c37b7e4d04612e1880a51094e9568d1ab2..e99c7e647665b2e0cef2d4670e825b09a4fa8aac
@@@ -14,13 -12,12 +14,14 @@@ libavutil:     2015-08-2
  
  
  API changes, most recent first:
- 2015-12-17 - xxxxxxx - lavc 57.18.100 / 57.11.0 - avcodec.h
-   Add av_packet_add_side_data().
 -
 -2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h
++2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h
+   xxxxxxx - Add av_packet_add_side_data().
+   xxxxxxx - Add AVCodecContext.coded_side_data.
  
 -2015-xx-xx - xxxxxxx - lavc 57.9.1 - avcodec.h
 +2015-12-11 - xxxxxxx - lavf 57.20.100 - avformat.h
 +  Add av_program_add_stream_index()
 +
 +2015-11-29 - xxxxxxx - lavc 57.16.101 - avcodec.h
    Deprecate rtp_callback without replacement, i.e. it won't be possible to
    get image slices before the full frame is encoded any more. The libavformat
    rtpenc muxer can still be used for RFC-2190 packetization.
index a60d28c5abb81ca4ece1c2e5401875b35093d7a3,80cf644aef5836d782bdbb443a797e1789df67c3..2821286d23fb31569c7bd32e3a3ab994c004cc93
@@@ -3174,152 -2926,17 +3174,162 @@@ typedef struct AVCodecContext 
       */
      enum AVPixelFormat sw_pix_fmt;
  
 +    /**
 +     * Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
 +     * Code outside libavcodec should access this field using:
 +     * av_codec_{get,set}_pkt_timebase(avctx)
 +     * - encoding unused.
 +     * - decoding set by user.
 +     */
 +    AVRational pkt_timebase;
 +
 +    /**
 +     * AVCodecDescriptor
 +     * Code outside libavcodec should access this field using:
 +     * av_codec_{get,set}_codec_descriptor(avctx)
 +     * - encoding: unused.
 +     * - decoding: set by libavcodec.
 +     */
 +    const AVCodecDescriptor *codec_descriptor;
 +
 +#if !FF_API_LOWRES
 +    /**
 +     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
 +     * - encoding: unused
 +     * - decoding: Set by user.
 +     * Code outside libavcodec should access this field using:
 +     * av_codec_{get,set}_lowres(avctx)
 +     */
 +     int lowres;
 +#endif
 +
 +    /**
 +     * Current statistics for PTS correction.
 +     * - decoding: maintained and used by libavcodec, not intended to be used by user apps
 +     * - encoding: unused
 +     */
 +    int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far
 +    int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far
 +    int64_t pts_correction_last_pts;       /// PTS of the last frame
 +    int64_t pts_correction_last_dts;       /// DTS of the last frame
 +
 +    /**
 +     * Character encoding of the input subtitles file.
 +     * - decoding: set by user
 +     * - encoding: unused
 +     */
 +    char *sub_charenc;
 +
 +    /**
 +     * Subtitles character encoding mode. Formats or codecs might be adjusting
 +     * this setting (if they are doing the conversion themselves for instance).
 +     * - decoding: set by libavcodec
 +     * - encoding: unused
 +     */
 +    int sub_charenc_mode;
 +#define FF_SUB_CHARENC_MODE_DO_NOTHING  -1  ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance)
 +#define FF_SUB_CHARENC_MODE_AUTOMATIC    0  ///< libavcodec will select the mode itself
 +#define FF_SUB_CHARENC_MODE_PRE_DECODER  1  ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
 +
 +    /**
 +     * Skip processing alpha if supported by codec.
 +     * Note that if the format uses pre-multiplied alpha (common with VP6,
 +     * and recommended due to better video quality/compression)
 +     * the image will look as if alpha-blended onto a black background.
 +     * However for formats that do not use pre-multiplied alpha
 +     * there might be serious artefacts (though e.g. libswscale currently
 +     * assumes pre-multiplied alpha anyway).
 +     * Code outside libavcodec should access this field using AVOptions
 +     *
 +     * - decoding: set by user
 +     * - encoding: unused
 +     */
 +    int skip_alpha;
 +
 +    /**
 +     * Number of samples to skip after a discontinuity
 +     * - decoding: unused
 +     * - encoding: set by libavcodec
 +     */
 +    int seek_preroll;
 +
 +#if !FF_API_DEBUG_MV
 +    /**
 +     * debug motion vectors
 +     * Code outside libavcodec should access this field using AVOptions
 +     * - encoding: Set by user.
 +     * - decoding: Set by user.
 +     */
 +    int debug_mv;
 +#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
 +#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
 +#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
 +#endif
 +
 +    /**
 +     * custom intra quantization matrix
 +     * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix()
 +     * - encoding: Set by user, can be NULL.
 +     * - decoding: unused.
 +     */
 +    uint16_t *chroma_intra_matrix;
 +
 +    /**
 +     * dump format separator.
 +     * can be ", " or "\n      " or anything else
 +     * Code outside libavcodec should access this field using AVOptions
 +     * (NO direct access).
 +     * - encoding: Set by user.
 +     * - decoding: Set by user.
 +     */
 +    uint8_t *dump_separator;
 +
 +    /**
 +     * ',' separated list of allowed decoders.
 +     * If NULL then all are allowed
 +     * - encoding: unused
 +     * - decoding: set by user through AVOPtions (NO direct access)
 +     */
 +    char *codec_whitelist;
 +
 +    /*
 +     * Properties of the stream that gets decoded
 +     * To be accessed through av_codec_get_properties() (NO direct access)
 +     * - encoding: unused
 +     * - decoding: set by libavcodec
 +     */
 +    unsigned properties;
 +#define FF_CODEC_PROPERTY_LOSSLESS        0x00000001
 +#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
++
+     /**
+      * Additional data associated with the entire coded stream.
+      *
+      * - decoding: unused
+      * - encoding: may be set by libavcodec after avcodec_open2().
+      */
+     AVPacketSideData *coded_side_data;
+     int            nb_coded_side_data;
  } AVCodecContext;
  
 +AVRational av_codec_get_pkt_timebase         (const AVCodecContext *avctx);
 +void       av_codec_set_pkt_timebase         (AVCodecContext *avctx, AVRational val);
 +
 +const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx);
 +void                     av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc);
 +
 +unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
 +
 +int  av_codec_get_lowres(const AVCodecContext *avctx);
 +void av_codec_set_lowres(AVCodecContext *avctx, int val);
 +
 +int  av_codec_get_seek_preroll(const AVCodecContext *avctx);
 +void av_codec_set_seek_preroll(AVCodecContext *avctx, int val);
 +
 +uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx);
 +void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val);
 +
  /**
   * AVProfile.
   */
index 94ec2f6da1b23daf0dc644deefd972fbf4e9d17a,f3361a016fc131d9f32d1185af24f7a6191a4660..b03988584767f2b2a860e3354db452d6d2b59704
@@@ -2507,16 -1603,11 +2507,17 @@@ void avsubtitle_free(AVSubtitle *sub
  
  av_cold int avcodec_close(AVCodecContext *avctx)
  {
+     int i;
 +    if (!avctx)
 +        return 0;
 +
      if (avcodec_is_open(avctx)) {
          FramePool *pool = avctx->internal->pool;
-         int i;
 -
 +        if (CONFIG_FRAME_THREAD_ENCODER &&
 +            avctx->internal->frame_thread_encoder && avctx->thread_count > 1) {
 +            ff_frame_thread_encoder_free(avctx);
 +        }
          if (HAVE_THREADS && avctx->internal->thread_ctx)
              ff_thread_free(avctx);
          if (avctx->codec && avctx->codec->close)