mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
Merge commit '57b6704ecd'
* commit '57b6704ecd':
avcodec: add AVCodecContext.sw_pix_fmt
Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
d16079abf4
4 changed files with 22 additions and 5 deletions
|
|
@ -890,10 +890,13 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
|
|||
if ((ret = ff_init_buffer_info(avctx, frame)) < 0)
|
||||
return ret;
|
||||
|
||||
if (hwaccel && hwaccel->alloc_frame) {
|
||||
ret = hwaccel->alloc_frame(avctx, frame);
|
||||
goto end;
|
||||
}
|
||||
if (hwaccel) {
|
||||
if (hwaccel->alloc_frame) {
|
||||
ret = hwaccel->alloc_frame(avctx, frame);
|
||||
goto end;
|
||||
}
|
||||
} else
|
||||
avctx->sw_pix_fmt = avctx->pix_fmt;
|
||||
|
||||
#if FF_API_GET_BUFFER
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
|
|
@ -1196,6 +1199,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
|
|||
while (fmt[n] != AV_PIX_FMT_NONE)
|
||||
++n;
|
||||
|
||||
av_assert0(n >= 1);
|
||||
avctx->sw_pix_fmt = fmt[n - 1];
|
||||
av_assert2(!is_hwaccel_pix_fmt(avctx->sw_pix_fmt));
|
||||
|
||||
choices = av_malloc_array(n + 1, sizeof(*choices));
|
||||
if (!choices)
|
||||
return AV_PIX_FMT_NONE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue