mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-25 18:01:32 +00:00
COMPAT: compile even with antique version of ffmpeg/libavcodec
This commit is contained in:
@@ -338,6 +338,7 @@ void v210_to_yuv444p10le(AVFrame * __restrict out_frame, unsigned char * __restr
|
||||
}
|
||||
}
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 57 || (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR >= 23)
|
||||
void v210_to_p010le(AVFrame * __restrict out_frame, unsigned char * __restrict in_data, int width, int height)
|
||||
{
|
||||
for(int y = 0; y < height; y += 2) {
|
||||
@@ -397,6 +398,7 @@ void v210_to_p010le(AVFrame * __restrict out_frame, unsigned char * __restrict i
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void r10k_to_yuv422p10le(AVFrame * __restrict out_frame, unsigned char * __restrict in_data, int width, int height)
|
||||
{
|
||||
@@ -1493,6 +1495,7 @@ void yuv444p10le_to_rgb24(char * __restrict dst_buffer, AVFrame * __restrict in_
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 57 || (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR >= 23)
|
||||
void p010le_to_v210(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
|
||||
int width, int height, int pitch, int * __restrict rgb_shift)
|
||||
{
|
||||
@@ -1585,6 +1588,7 @@ void p010le_to_uyvy(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HWACC_VDPAU
|
||||
void av_vdpau_to_ug_vdpau(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
|
||||
|
||||
@@ -201,7 +201,9 @@ static const struct {
|
||||
{ v210, AV_PIX_FMT_YUV420P10LE, v210_to_yuv420p10le },
|
||||
{ v210, AV_PIX_FMT_YUV422P10LE, v210_to_yuv422p10le },
|
||||
{ v210, AV_PIX_FMT_YUV444P10LE, v210_to_yuv444p10le },
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 57 || (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR >= 24)
|
||||
{ v210, AV_PIX_FMT_P010LE, v210_to_p010le },
|
||||
#endif
|
||||
{ UYVY, AV_PIX_FMT_YUV422P, uyvy_to_yuv422p },
|
||||
{ UYVY, AV_PIX_FMT_YUVJ422P, uyvy_to_yuv422p },
|
||||
{ UYVY, AV_PIX_FMT_YUV420P, uyvy_to_yuv420p },
|
||||
@@ -214,7 +216,9 @@ static const struct {
|
||||
{ RGBA, AV_PIX_FMT_GBRP, rgba_to_gbrp },
|
||||
{ R10k, AV_PIX_FMT_GBRP10LE, r10k_to_gbrp10le },
|
||||
{ R10k, AV_PIX_FMT_YUV422P10LE, r10k_to_yuv422p10le },
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 55 || (LIBAVFORMAT_VERSION_MAJOR == 55 && LIBAVFORMAT_VERSION_MINOR >= 24)
|
||||
{ R12L, AV_PIX_FMT_GBRP12LE, r12l_to_gbrp12le },
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef void av_to_uv_convert(char * __restrict dst_buffer, AVFrame * __restrict in_frame, int width, int height, int pitch, int * __restrict rgb_shift);
|
||||
@@ -278,8 +282,10 @@ static const struct {
|
||||
{AV_PIX_FMT_YUV444P10LE, v210, yuv444p10le_to_v210, true},
|
||||
{AV_PIX_FMT_YUV444P10LE, UYVY, yuv444p10le_to_uyvy, false},
|
||||
{AV_PIX_FMT_YUV444P10LE, RGB, yuv444p10le_to_rgb24, false},
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 57 || (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR >= 24)
|
||||
{AV_PIX_FMT_P010LE, v210, p010le_to_v210, true},
|
||||
{AV_PIX_FMT_P010LE, UYVY, p010le_to_uyvy, true},
|
||||
#endif
|
||||
// 8-bit YUV
|
||||
{AV_PIX_FMT_YUV420P, v210, yuv420p_to_v210, false},
|
||||
{AV_PIX_FMT_YUV420P, UYVY, yuv420p_to_uyvy, true},
|
||||
@@ -311,9 +317,11 @@ static const struct {
|
||||
{AV_PIX_FMT_GBRP10LE, R10k, gbrp10le_to_r10k, true},
|
||||
{AV_PIX_FMT_GBRP10LE, RGB, gbrp10le_to_rgb, false},
|
||||
{AV_PIX_FMT_GBRP10LE, RGBA, gbrp10le_to_rgba, false},
|
||||
#if LIBAVFORMAT_VERSION_MAJOR > 55 || (LIBAVFORMAT_VERSION_MAJOR == 55 && LIBAVFORMAT_VERSION_MINOR >= 24)
|
||||
{AV_PIX_FMT_GBRP12LE, R12L, gbrp12le_to_r12l, true},
|
||||
{AV_PIX_FMT_GBRP12LE, RGB, gbrp12le_to_rgb, false},
|
||||
{AV_PIX_FMT_GBRP12LE, RGBA, gbrp12le_to_rgba, false},
|
||||
#endif
|
||||
{AV_PIX_FMT_RGB48LE, RG48, memcpy_data, true},
|
||||
{AV_PIX_FMT_RGB48LE, R12L, rgb48le_to_r12l, false},
|
||||
{AV_PIX_FMT_RGB48LE, RGBA, rgb48le_to_rgba, false},
|
||||
|
||||
@@ -853,10 +853,20 @@ static list<enum AVPixelFormat> get_available_pix_fmts(struct video_desc in_desc
|
||||
sort(available_formats.begin(), available_formats.end(), [bits_per_comp, is_rgb, preferred_subsampling](enum AVPixelFormat a, enum AVPixelFormat b) {
|
||||
const struct AVPixFmtDescriptor *pda = av_pix_fmt_desc_get(a);
|
||||
const struct AVPixFmtDescriptor *pdb = av_pix_fmt_desc_get(b);
|
||||
#if defined(FF_API_PLUS1_MINUS1)
|
||||
int deptha = pda->comp[0].depth;
|
||||
int depthb = pdb->comp[0].depth;
|
||||
#else
|
||||
int deptha = pda->comp[0].depth_minus1;
|
||||
int depthb = pdb->comp[0].depth_minus1;
|
||||
#endif
|
||||
#if defined(AV_PIX_FMT_FLAG_RGB)
|
||||
bool rgba = pda->flags & AV_PIX_FMT_FLAG_RGB;
|
||||
bool rgbb = pdb->flags & AV_PIX_FMT_FLAG_RGB;
|
||||
#else
|
||||
bool rgba = pda->flags & PIX_FMT_RGB;
|
||||
bool rgbb = pdb->flags & PIX_FMT_RGB;
|
||||
#endif
|
||||
int subsa = get_subsampling(a);
|
||||
int subsb = get_subsampling(b);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user