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 c1a5fca1 parent aa234694 files · +28 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +23 −1
  3. libavcodec/utils.c +1 −0
  4. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182017-02-13 - xxxxxxx - lavc 57.80.100 - avcodec.h
19 Add AVCodecContext.hw_device_ctx.
20
182017-02-11 - xxxxxxx - lavu 55.47.100 - frame.h212017-02-11 - xxxxxxx - lavu 55.47.100 - frame.h
19 Add AVFrame.opaque_ref.22 Add AVFrame.opaque_ref.
20 23
libavcodec/avcodec.h+23−1
@@ -3536,7 +3536,8 @@ typedef struct AVCodecContext { · 3535 unmodified lines
3536 /**3536 /**
3537 * A reference to the AVHWFramesContext describing the input (for encoding)3537 * A reference to the AVHWFramesContext describing the input (for encoding)
3538 * or output (decoding) frames. The reference is set by the caller and3538 * or output (decoding) frames. The reference is set by the caller and
3539 * afterwards owned (and freed) by libavcodec.3539 * afterwards owned (and freed) by libavcodec - it should never be read by
3540 * the caller after being set.
3540 *3541 *
3541 * - decoding: This field should be set by the caller from the get_format()3542 * - decoding: This field should be set by the caller from the get_format()
3542 * callback. The previous reference (if any) will always be3543 * callback. The previous reference (if any) will always be
@@ -3586,6 +3587,27 @@ typedef struct AVCodecContext { · 43 unmodified lines
3586 */3587 */
3587 int64_t max_pixels;3588 int64_t max_pixels;
3588 3589
3590 /**
3591 * A reference to the AVHWDeviceContext describing the device which will
3592 * be used by a hardware encoder/decoder. The reference is set by the
3593 * caller and afterwards owned (and freed) by libavcodec.
3594 *
3595 * This should be used if either the codec device does not require
3596 * hardware frames or any that are used are to be allocated internally by
3597 * libavcodec. If the user wishes to supply any of the frames used as
3598 * encoder input or decoder output then hw_frames_ctx should be used
3599 * instead. When hw_frames_ctx is set in get_format() for a decoder, this
3600 * field will be ignored while decoding the associated stream segment, but
3601 * may again be used on a following one after another get_format() call.
3602 *
3603 * For both encoders and decoders this field should be set before
3604 * avcodec_open2() is called and must not be written to thereafter.
3605 *
3606 * Note that some decoders may require this field to be set initially in
3607 * order to support hw_frames_ctx at all - in that case, all frames
3608 * contexts used must be created on the same device.
3609 */
3610 AVBufferRef *hw_device_ctx;
3589} AVCodecContext;3611} AVCodecContext;
3590 3612
3591AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);3613AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
libavcodec/utils.c+1−0
@@ -3067,6 +3067,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 3066 unmodified lines
3067 avctx->nb_coded_side_data = 0;3067 avctx->nb_coded_side_data = 0;
3068 3068
3069 av_buffer_unref(&avctx->hw_frames_ctx);3069 av_buffer_unref(&avctx->hw_frames_ctx);
3070 av_buffer_unref(&avctx->hw_device_ctx);
3070 3071
3071 if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)3072 if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
3072 av_opt_free(avctx->priv_data);3073 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 7931#define LIBAVCODEC_VERSION_MINOR 80
32#define LIBAVCODEC_VERSION_MICRO 10032#define LIBAVCODEC_VERSION_MICRO 100
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