History

Merge commit '5b145290df2998a9836a93eb925289c6c8b63af0'

* commit '5b145290df2998a9836a93eb925289c6c8b63af0': lavc: Add support for increasing hardware frame pool sizes

Mark Thompson committed 8 years ago

Commit d23fff02 parents d401ba6 5b145295 files · +28 −1Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +14 −0
  3. libavcodec/decode.c +9 −0
  4. libavcodec/options_table.h +1 −0
  5. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182018-02-xx - xxxxxxx - lavc 58.11.100 - avcodec.h
19 Add AVCodecContext.extra_hw_frames.
20
182018-02-06 - 0fd475704e - lavd 58.1.100 - avdevice.h212018-02-06 - 0fd475704e - lavd 58.1.100 - avdevice.h
19 Deprecate use of av_input_audio_device_next(), av_input_video_device_next(),22 Deprecate use of av_input_audio_device_next(), av_input_video_device_next(),
20 av_output_audio_device_next(), av_output_video_device_next().23 av_output_audio_device_next(), av_output_video_device_next().
libavcodec/avcodec.h+14−0
@@ -3255,6 +3255,20 @@ typedef struct AVCodecContext { · 3254 unmodified lines
3255 * (with the display dimensions being determined by the crop_* fields).3255 * (with the display dimensions being determined by the crop_* fields).
3256 */3256 */
3257 int apply_cropping;3257 int apply_cropping;
3258
3259 /*
3260 * Video decoding only. Sets the number of extra hardware frames which
3261 * the decoder will allocate for use by the caller. This must be set
3262 * before avcodec_open2() is called.
3263 *
3264 * Some hardware decoders require all frames that they will use for
3265 * output to be defined in advance before decoding starts. For such
3266 * decoders, the hardware frame pool must therefore be of a fixed size.
3267 * The extra frames set here are on top of any number that the decoder
3268 * needs internally in order to operate normally (for example, frames
3269 * used as reference pictures).
3270 */
3271 int extra_hw_frames;
3258} AVCodecContext;3272} AVCodecContext;
3259 3273
3260#if FF_API_CODEC_GET_SET3274#if FF_API_CODEC_GET_SET
libavcodec/decode.c+9−0
@@ -1229,6 +1229,15 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, · 1228 unmodified lines
1229 1229
1230 ret = hwa->frame_params(avctx, frames_ref);1230 ret = hwa->frame_params(avctx, frames_ref);
1231 if (ret >= 0) {1231 if (ret >= 0) {
1232 AVHWFramesContext *frames_ctx = (AVHWFramesContext*)frames_ref->data;
1233
1234 if (frames_ctx->initial_pool_size) {
1235 // If the user has requested that extra output surfaces be
1236 // available then add them here.
1237 if (avctx->extra_hw_frames > 0)
1238 frames_ctx->initial_pool_size += avctx->extra_hw_frames;
1239 }
1240
1232 *out_frames_ref = frames_ref;1241 *out_frames_ref = frames_ref;
1233 } else {1242 } else {
1234 av_buffer_unref(&frames_ref);1243 av_buffer_unref(&frames_ref);
libavcodec/options_table.h+1−0
@@ -476,6 +476,7 @@ static const AVOption avcodec_options[] = { · 475 unmodified lines
476{"ignore_level", "ignore level even if the codec level used is unknown or higher than the maximum supported level reported by the hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, "hwaccel_flags" },476{"ignore_level", "ignore level even if the codec level used is unknown or higher than the maximum supported level reported by the hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, "hwaccel_flags" },
477{"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"},477{"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"},
478{"allow_profile_mismatch", "attempt to decode anyway if HW accelerated decoder's supported profiles do not exactly match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"},478{"allow_profile_mismatch", "attempt to decode anyway if HW accelerated decoder's supported profiles do not exactly match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"},
479{"extra_hw_frames", "Number of extra hardware frames to allocate for the user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, V|D },
479{NULL},480{NULL},
480};481};
481 482
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 5830#define LIBAVCODEC_VERSION_MAJOR 58
31#define LIBAVCODEC_VERSION_MINOR 1031#define LIBAVCODEC_VERSION_MINOR 11
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