mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec: add AVCodecContext.sw_pix_fmt
This carries the pixel format that would be used if it were not for hardware acceleration. This is equal to AVCodecContext.pix_fmt if hardware acceleration is not in use. Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
4cfbeef31d
commit
57b6704ecd
@ -13,6 +13,9 @@ libavutil: 2014-08-09
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
201x-xx-xx - xxxxxxx - lavc 56.8.0 - avcodec.h
|
||||||
|
Add AVCodecContext.sw_pix_fmt.
|
||||||
|
|
||||||
2014-11-xx - xxxxxxx - lavf 56.06.3 - avformat.h
|
2014-11-xx - xxxxxxx - lavf 56.06.3 - avformat.h
|
||||||
Add AVFormatContext.avoid_negative_ts.
|
Add AVFormatContext.avoid_negative_ts.
|
||||||
|
|
||||||
|
@ -2800,6 +2800,13 @@ typedef struct AVCodecContext {
|
|||||||
* - encoding: unused
|
* - encoding: unused
|
||||||
*/
|
*/
|
||||||
AVRational framerate;
|
AVRational framerate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
|
||||||
|
* - encoding: unused.
|
||||||
|
* - decoding: Set by libavcodec before calling get_format()
|
||||||
|
*/
|
||||||
|
enum AVPixelFormat sw_pix_fmt;
|
||||||
} AVCodecContext;
|
} AVCodecContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -665,10 +665,13 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (hwaccel && hwaccel->alloc_frame) {
|
if (hwaccel) {
|
||||||
ret = hwaccel->alloc_frame(avctx, frame);
|
if (hwaccel->alloc_frame) {
|
||||||
goto end;
|
ret = hwaccel->alloc_frame(avctx, frame);
|
||||||
}
|
goto end;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
avctx->sw_pix_fmt = avctx->pix_fmt;
|
||||||
|
|
||||||
#if FF_API_GET_BUFFER
|
#if FF_API_GET_BUFFER
|
||||||
FF_DISABLE_DEPRECATION_WARNINGS
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
@ -933,6 +936,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
|
|||||||
while (fmt[n] != AV_PIX_FMT_NONE)
|
while (fmt[n] != AV_PIX_FMT_NONE)
|
||||||
++n;
|
++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));
|
choices = av_malloc_array(n + 1, sizeof(*choices));
|
||||||
if (!choices)
|
if (!choices)
|
||||||
return AV_PIX_FMT_NONE;
|
return AV_PIX_FMT_NONE;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "libavutil/version.h"
|
#include "libavutil/version.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 56
|
#define LIBAVCODEC_VERSION_MAJOR 56
|
||||||
#define LIBAVCODEC_VERSION_MINOR 7
|
#define LIBAVCODEC_VERSION_MINOR 8
|
||||||
#define LIBAVCODEC_VERSION_MICRO 0
|
#define LIBAVCODEC_VERSION_MICRO 0
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user