]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '57b6704ecd0f56d6a3092e448687cfd837bb0ac1'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Dec 2014 11:41:10 +0000 (12:41 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Dec 2014 11:41:10 +0000 (12:41 +0100)
* commit '57b6704ecd0f56d6a3092e448687cfd837bb0ac1':
  avcodec: add AVCodecContext.sw_pix_fmt

Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
doc/APIchanges
libavcodec/avcodec.h
libavcodec/utils.c
libavcodec/version.h

index 5b0e1e5824dcb2fc784ca4765d71033ee4747dda..caa05d13b8199133028187e6afdfc30bdc2d2ae7 100644 (file)
@@ -15,6 +15,9 @@ libavutil:     2014-08-09
 
 API changes, most recent first:
 
+201x-xx-xx - xxxxxxx - lavc 56.8.0 - avcodec.h
+  Add AVCodecContext.sw_pix_fmt.
+
 2014-12-04 - xxxxxxx - lavc 56.14.100 - dv_profile.h
   Add av_dv_codec_profile2().
 
index 4b6b00cd0203280c6f99e376f87902c3c9d59fd8..527824601e3404091a3b482411abe495303dca73 100644 (file)
@@ -3004,6 +3004,13 @@ typedef struct AVCodecContext {
      */
     AVRational framerate;
 
+    /**
+     * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
+     * - encoding: unused.
+     * - decoding: Set by libavcodec before calling get_format()
+     */
+    enum AVPixelFormat sw_pix_fmt;
+
     /**
      * Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
      * Code outside libavcodec should access this field using:
index f6d99ab3ddd3798bea570b95d2bb33e465d1a1af..1ec5caed82fa68a7d8f5ff335bfe761e90b48e16 100644 (file)
@@ -890,10 +890,13 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
     if ((ret = ff_init_buffer_info(avctx, frame)) < 0)
         return ret;
 
-    if (hwaccel && hwaccel->alloc_frame) {
-        ret = hwaccel->alloc_frame(avctx, frame);
-        goto end;
-    }
+    if (hwaccel) {
+        if (hwaccel->alloc_frame) {
+            ret = hwaccel->alloc_frame(avctx, frame);
+            goto end;
+        }
+    } else
+        avctx->sw_pix_fmt = avctx->pix_fmt;
 
 #if FF_API_GET_BUFFER
 FF_DISABLE_DEPRECATION_WARNINGS
@@ -1196,6 +1199,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
     while (fmt[n] != AV_PIX_FMT_NONE)
         ++n;
 
+    av_assert0(n >= 1);
+    avctx->sw_pix_fmt = fmt[n - 1];
+    av_assert2(!is_hwaccel_pix_fmt(avctx->sw_pix_fmt));
+
     choices = av_malloc_array(n + 1, sizeof(*choices));
     if (!choices)
         return AV_PIX_FMT_NONE;
index 3124fb537be2cc23e4a1648b102dbbb98ceee427..d85a2542c7909fa1667f08cf7fab22052a4e4bcd 100644 (file)
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR  16
+#define LIBAVCODEC_VERSION_MINOR  17
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \