Commit cc085993 authored by Luca Barbato's avatar Luca Barbato

avcodec: remove ff_is_hwaccel_pix_fmt

It is used only in one place and is unlikely it would be needed
elsewhere.
parent c1a02e88
...@@ -415,12 +415,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int ...@@ -415,12 +415,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
*v_shift = desc->log2_chroma_h; *v_shift = desc->log2_chroma_h;
} }
int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
return desc->flags & PIX_FMT_HWACCEL;
}
int avpicture_fill(AVPicture *picture, uint8_t *ptr, int avpicture_fill(AVPicture *picture, uint8_t *ptr,
enum AVPixelFormat pix_fmt, int width, int height) enum AVPixelFormat pix_fmt, int width, int height)
{ {
......
...@@ -85,11 +85,6 @@ struct AVCodecDefault { ...@@ -85,11 +85,6 @@ struct AVCodecDefault {
const uint8_t *value; const uint8_t *value;
}; };
/**
* Determine whether pix_fmt is a hardware accelerated format.
*/
int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt);
/** /**
* Return the hardware accelerated codec for codec codec_id and * Return the hardware accelerated codec for codec codec_id and
* pixel format pix_fmt. * pixel format pix_fmt.
......
...@@ -628,9 +628,15 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, ...@@ -628,9 +628,15 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
return 0; return 0;
} }
static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
return desc->flags & PIX_FMT_HWACCEL;
}
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt) enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
{ {
while (*fmt != AV_PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt)) while (*fmt != AV_PIX_FMT_NONE && is_hwaccel_pix_fmt(*fmt))
++fmt; ++fmt;
return fmt[0]; return fmt[0];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment