[FFmpeg-cvslog] Merge commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa'
James Almer
git at videolan.org
Wed Sep 28 19:25:38 EEST 2016
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Sep 28 13:22:00 2016 -0300| [32c25f06b79f9edcda726f6e043325d40036cdce] | committer: James Almer
Merge commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa'
* commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa':
lavc: allow using AVCodecContext.hw_frames_ctx for decoding
Conflicts:
doc/APIchanges
libavcodec/version.h
Merged-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32c25f06b79f9edcda726f6e043325d40036cdce
---
doc/APIchanges | 3 +++
libavcodec/avcodec.h | 24 +++++++++++++++++-------
libavcodec/utils.c | 15 +++++++++++++++
libavcodec/version.h | 4 ++--
4 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index e4a96cc..7acfc3e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
API changes, most recent first:
+2016-09-xx - xxxxxxx - lavc 57.59.100/ 57.23.0 - avcodec.h
+ AVCodecContext.hw_frames_ctx now may be used by decoders.
+
2016-09-27 - xxxxxxx - lavf 57.51.100 - avformat.h
Add av_stream_get_codec_timebase()
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b174116..d72ee07 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3518,15 +3518,25 @@ typedef struct AVCodecContext {
int nb_coded_side_data;
/**
- * Encoding only.
+ * A reference to the AVHWFramesContext describing the input (for encoding)
+ * or output (decoding) frames. The reference is set by the caller and
+ * afterwards owned (and freed) by libavcodec.
*
- * For hardware encoders configured to use a hwaccel pixel format, this
- * field should be set by the caller to a reference to the AVHWFramesContext
- * describing input frames. AVHWFramesContext.format must be equal to
- * AVCodecContext.pix_fmt.
+ * - decoding: This field should be set by the caller from the get_format()
+ * callback. The previous reference (if any) will always be
+ * unreffed by libavcodec before the get_format() call.
*
- * This field should be set before avcodec_open2() is called and is
- * afterwards owned and managed by libavcodec.
+ * If the default get_buffer2() is used with a hwaccel pixel
+ * format, then this AVHWFramesContext will be used for
+ * allocating the frame buffers.
+ *
+ * - encoding: For hardware encoders configured to use a hwaccel pixel
+ * format, this field should be set by the caller to a reference
+ * to the AVHWFramesContext describing input frames.
+ * AVHWFramesContext.format must be equal to
+ * AVCodecContext.pix_fmt.
+ *
+ * This field should be set before avcodec_open2() is called.
*/
AVBufferRef *hw_frames_ctx;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b0345b6..0d78f0b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -724,6 +724,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
{
int ret;
+ if (avctx->hw_frames_ctx)
+ return av_hwframe_get_buffer(avctx->hw_frames_ctx, frame, 0);
+
if ((ret = update_frame_pool(avctx, frame)) < 0)
return ret;
@@ -1119,6 +1122,8 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
av_freep(&avctx->internal->hwaccel_priv_data);
avctx->hwaccel = NULL;
+ av_buffer_unref(&avctx->hw_frames_ctx);
+
ret = avctx->get_format(avctx, choices);
desc = av_pix_fmt_desc_get(ret);
@@ -1134,6 +1139,16 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
break;
#endif
+ if (avctx->hw_frames_ctx) {
+ AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
+ if (hw_frames_ctx->format != ret) {
+ av_log(avctx, AV_LOG_ERROR, "Format returned from get_buffer() "
+ "does not match the format of provided AVHWFramesContext\n");
+ ret = AV_PIX_FMT_NONE;
+ break;
+ }
+ }
+
if (!setup_hwaccel(avctx, ret, desc->name))
break;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index c583da0..71dac40 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 58
-#define LIBAVCODEC_VERSION_MICRO 104
+#define LIBAVCODEC_VERSION_MINOR 59
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
======================================================================
diff --cc doc/APIchanges
index e4a96cc,e251490..7acfc3e
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@@ -15,63 -13,19 +15,66 @@@ libavutil: 2015-08-2
API changes, most recent first:
-2016-xx-xx - xxxxxxx - lavc 57.23.0 - avcodec.h
++2016-09-xx - xxxxxxx - lavc 57.59.100/ 57.23.0 - avcodec.h
+ AVCodecContext.hw_frames_ctx now may be used by decoders.
+
-2016-xx-xx - xxxxxxx - lavc 57.20.0 - avcodec.h
+2016-09-27 - xxxxxxx - lavf 57.51.100 - avformat.h
+ Add av_stream_get_codec_timebase()
+
+2016-09-27 - 23c0779 - lswr 2.2.100 - swresample.h
+ Add swr_build_matrix().
+
+2016-09-xx - xxxxxxx - lavc 57.58.100 - avcodec.h
+ Add AV_CODEC_CAP_AVOID_PROBING codec capability flag.
+
+2016-09-xx - xxxxxxx - lavf 57.49.100 - avformat.h
+ Add avformat_transfer_internal_stream_timing_info helper to help with stream
+ copy.
+
+2016-08-29 - 4493390 - lavfi 6.58.100 - avfilter.h
+ Add AVFilterContext.nb_threads.
+
+2016-08-15 - c3c4c72 - lavc 57.53.100 - avcodec.h
+ Add trailing_padding to AVCodecContext to match the corresponding
+ field in AVCodecParameters.
+
+2016-08-15 - b746ed7 - lavc 57.52.100 - avcodec.h
+ Add a new API for chained BSF filters and passthrough (null) BSF --
+ av_bsf_list_alloc(), av_bsf_list_free(), av_bsf_list_append(),
+ av_bsf_list_append2(), av_bsf_list_finalize(), av_bsf_list_parse_str()
+ and av_bsf_get_null_filter().
+
+2016-08-04 - 82a33c8 - lavf 57.46.100 - avformat.h
+ Add av_get_frame_filename2()
+
+2016-07-09 - 775389f / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h
Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
-2016-xx-xx - xxxxxxx - lavu 55.13.0 - hwcontext.h
+2016-06-30 - c1c7e0ab - lavf 57.41.100 - avformat.h
+ Moved codecpar field from AVStream to the end of the struct, so that
+ the following private fields are in the same location as in FFmpeg 3.0 (lavf 57.25.100).
+
+2016-06-30 - 042fb69d - lavu 55.28.100 - frame.h
+ Moved hw_frames_ctx field from AVFrame to the end of the struct, so that
+ the following private fields are in the same location as in FFmpeg 3.0 (lavu 55.17.103).
+
+2016-06-29 - 1a751455 - lavfi 6.47.100 - avfilter.h
+ Fix accidental ABI breakage in AVFilterContext.
+ ABI was broken in 8688d3a, lavfi 6.42.100 and released as ffmpeg 3.1.
+
+ Because of this, ffmpeg and ffplay built against lavfi>=6.42.100 will not be
+ compatible with lavfi>=6.47.100. Potentially also affects other users of
+ libavfilter if they are using one of the affected fields.
+
+-------- 8< --------- FFmpeg 3.1 was cut here -------- 8< ---------
+
+2016-06-26 - 481f320 / 1c9e861 - lavu 55.27.100 / 55.13.0 - hwcontext.h
Add av_hwdevice_ctx_create().
-2016-xx-xx - xxxxxxx - lavc 57.19.1 - avcodec.h
+2016-06-26 - b95534b / e47b8bb - lavc 57.48.101 / 57.19.1 - avcodec.h
Adjust values for JPEG 2000 profiles.
-2016-xx-xx - xxxxxxx - lavf 57.7.0 - avio.h
+2016-06-23 - 5d75e46 / db7968b - lavf 57.40.100 / 57.7.0 - avio.h
Add AVIODataMarkerType, write_data_type, ignore_boundary_point and
avio_write_marker.
diff --cc libavcodec/avcodec.h
index b174116,ace761d..d72ee07
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@@ -3518,59 -3078,29 +3518,69 @@@ typedef struct AVCodecContext
int nb_coded_side_data;
/**
- * Encoding only.
+ * A reference to the AVHWFramesContext describing the input (for encoding)
+ * or output (decoding) frames. The reference is set by the caller and
+ * afterwards owned (and freed) by libavcodec.
*
- * For hardware encoders configured to use a hwaccel pixel format, this
- * field should be set by the caller to a reference to the AVHWFramesContext
- * describing input frames. AVHWFramesContext.format must be equal to
- * AVCodecContext.pix_fmt.
+ * - decoding: This field should be set by the caller from the get_format()
+ * callback. The previous reference (if any) will always be
+ * unreffed by libavcodec before the get_format() call.
*
- * This field should be set before avcodec_open2() is called and is
- * afterwards owned and managed by libavcodec.
+ * If the default get_buffer2() is used with a hwaccel pixel
+ * format, then this AVHWFramesContext will be used for
+ * allocating the frame buffers.
+ *
+ * - encoding: For hardware encoders configured to use a hwaccel pixel
+ * format, this field should be set by the caller to a reference
+ * to the AVHWFramesContext describing input frames.
+ * AVHWFramesContext.format must be equal to
+ * AVCodecContext.pix_fmt.
+ *
+ * This field should be set before avcodec_open2() is called.
*/
AVBufferRef *hw_frames_ctx;
+
+ /**
+ * Control the form of AVSubtitle.rects[N]->ass
+ * - decoding: set by user
+ * - encoding: unused
+ */
+ int sub_text_format;
+#define FF_SUB_TEXT_FMT_ASS 0
+#if FF_API_ASS_TIMING
+#define FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS 1
+#endif
+
+ /**
+ * Audio only. The amount of padding (in samples) appended by the encoder to
+ * the end of the audio. I.e. this number of decoded samples must be
+ * discarded by the caller from the end of the stream to get the original
+ * audio without any trailing padding.
+ *
+ * - decoding: unused
+ * - encoding: unused
+ */
+ int trailing_padding;
+
} 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.
*/
diff --cc libavcodec/utils.c
index b0345b6,8f8efec..0d78f0b
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@@ -1129,11 -808,17 +1134,21 @@@ int ff_get_format(AVCodecContext *avctx
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
+#if FF_API_CAP_VDPAU
+ if (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+ break;
+#endif
+ if (avctx->hw_frames_ctx) {
+ AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
+ if (hw_frames_ctx->format != ret) {
+ av_log(avctx, AV_LOG_ERROR, "Format returned from get_buffer() "
+ "does not match the format of provided AVHWFramesContext\n");
+ ret = AV_PIX_FMT_NONE;
+ break;
+ }
+ }
+
if (!setup_hwaccel(avctx, ret, desc->name))
break;
diff --cc libavcodec/version.h
index c583da0,9b495e9..71dac40
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@@ -27,9 -27,9 +27,9 @@@
#include "libavutil/version.h"
-#define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 23
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MAJOR 57
- #define LIBAVCODEC_VERSION_MINOR 58
- #define LIBAVCODEC_VERSION_MICRO 104
++#define LIBAVCODEC_VERSION_MINOR 59
++#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list