History

lavc: Add device context field to AVCodecContext

For use by codec implementations which can allocate frames internally.

Mark Thompson committed 9 years ago

Commit 44f2eda1 parent 07b51364 files · +29 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +24 −1
  3. libavcodec/utils.c +1 −0
  4. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2015-08-28 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162017-xx-xx - xxxxxxx - lavc 57.34.0 - avcodec.h
17 Add AVCodecContext.hw_device_ctx.
18
162017-02-11 - xxxxxxx - lavu 55.32.0 - frame.h192017-02-11 - xxxxxxx - lavu 55.32.0 - frame.h
17 Add AVFrame.opaque_ref.20 Add AVFrame.opaque_ref.
18 21
libavcodec/avcodec.h+24−1
@@ -3093,7 +3093,8 @@ typedef struct AVCodecContext { · 3092 unmodified lines
3093 /**3093 /**
3094 * A reference to the AVHWFramesContext describing the input (for encoding)3094 * A reference to the AVHWFramesContext describing the input (for encoding)
3095 * or output (decoding) frames. The reference is set by the caller and3095 * or output (decoding) frames. The reference is set by the caller and
3096 * afterwards owned (and freed) by libavcodec.3096 * afterwards owned (and freed) by libavcodec - it should never be read by
3097 * the caller after being set.
3097 *3098 *
3098 * - decoding: This field should be set by the caller from the get_format()3099 * - decoding: This field should be set by the caller from the get_format()
3099 * callback. The previous reference (if any) will always be3100 * callback. The previous reference (if any) will always be
@@ -3139,6 +3140,28 @@ typedef struct AVCodecContext { · 39 unmodified lines
3139 * (with the display dimensions being determined by the crop_* fields).3140 * (with the display dimensions being determined by the crop_* fields).
3140 */3141 */
3141 int apply_cropping;3142 int apply_cropping;
3143
3144 /**
3145 * A reference to the AVHWDeviceContext describing the device which will
3146 * be used by a hardware encoder/decoder. The reference is set by the
3147 * caller and afterwards owned (and freed) by libavcodec.
3148 *
3149 * This should be used if either the codec device does not require
3150 * hardware frames or any that are used are to be allocated internally by
3151 * libavcodec. If the user wishes to supply any of the frames used as
3152 * encoder input or decoder output then hw_frames_ctx should be used
3153 * instead. When hw_frames_ctx is set in get_format() for a decoder, this
3154 * field will be ignored while decoding the associated stream segment, but
3155 * may again be used on a following one after another get_format() call.
3156 *
3157 * For both encoders and decoders this field should be set before
3158 * avcodec_open2() is called and must not be written to thereafter.
3159 *
3160 * Note that some decoders may require this field to be set initially in
3161 * order to support hw_frames_ctx at all - in that case, all frames
3162 * contexts used must be created on the same device.
3163 */
3164 AVBufferRef *hw_device_ctx;
3142} AVCodecContext;3165} AVCodecContext;
3143 3166
3144/**3167/**
libavcodec/utils.c+1−0
@@ -794,6 +794,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 793 unmodified lines
794 avctx->nb_coded_side_data = 0;794 avctx->nb_coded_side_data = 0;
795 795
796 av_buffer_unref(&avctx->hw_frames_ctx);796 av_buffer_unref(&avctx->hw_frames_ctx);
797 av_buffer_unref(&avctx->hw_device_ctx);
797 798
798 if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)799 if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
799 av_opt_free(avctx->priv_data);800 av_opt_free(avctx->priv_data);
libavcodec/version.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include "libavutil/version.h"28#include "libavutil/version.h"
29 29
30#define LIBAVCODEC_VERSION_MAJOR 5730#define LIBAVCODEC_VERSION_MAJOR 57
31#define LIBAVCODEC_VERSION_MINOR 3331#define LIBAVCODEC_VERSION_MINOR 34
32#define LIBAVCODEC_VERSION_MICRO 032#define LIBAVCODEC_VERSION_MICRO 0
33 33
34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t