diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-05-09 21:40:08 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-06-21 19:52:17 +0200 |
commit | e85f6f7f8d037c0af0f294000718d9ba22753baa (patch) | |
tree | 05c805b8ef8001af5a30b94c8ed0da4aa2c1cd3b /libavcodec/avcodec.h | |
parent | 40dd5166d2ba4f9035b93748840e408cd8be40e5 (diff) |
lavc: allow using AVCodecContext.hw_frames_ctx for decoding
For now it will only be used by the default get_buffer2 callback for
allocating hw frames.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c4bf708e3b..ace761dd56 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3078,15 +3078,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; } AVCodecContext; |