summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-03-24 21:01:20 +0100
committerLuca Barbato <lu_zero@gentoo.org>2014-05-12 12:59:16 +0200
commitdab56b5fd5b1e9e0b1492305c37aede88c500876 (patch)
tree2a75a386a081bc6f43f7bda4d43ae301f2b117e9 /video
parent5cbfdac2a82f4340971d31fcf05b333cdf6d3c12 (diff)
downloadmpv-dab56b5fd5b1e9e0b1492305c37aede88c500876.tar.bz2
mpv-dab56b5fd5b1e9e0b1492305c37aede88c500876.tar.xz
vda: Simplify codec selection
VDA supports h264 only.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vda.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/video/decode/vda.c b/video/decode/vda.c
index 6ac34aed89..a8d044c14f 100644
--- a/video/decode/vda.c
+++ b/video/decode/vda.c
@@ -30,29 +30,6 @@ struct priv {
struct vda_context vda_ctx;
};
-struct profile_entry {
- enum AVCodecID av_codec;
- int ff_profile;
- uint32_t vda_codec;
-};
-
-static const struct profile_entry profiles[] = {
- { AV_CODEC_ID_H264, FF_PROFILE_UNKNOWN, 'avc1' },
-};
-
-static const struct profile_entry *find_codec(enum AVCodecID id, int ff_profile)
-{
- for (int n = 0; n < MP_ARRAY_SIZE(profiles); n++) {
- if (profiles[n].av_codec == id &&
- (profiles[n].ff_profile == ff_profile ||
- profiles[n].ff_profile == FF_PROFILE_UNKNOWN))
- {
- return &profiles[n];
- }
- }
- return NULL;
-}
-
struct vda_error {
int code;
char *reason;
@@ -91,7 +68,7 @@ static int probe(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info,
{
hwdec_request_api(info, "vda");
- if (!find_codec(mp_codec_to_av_codec_id(decoder), FF_PROFILE_UNKNOWN))
+ if (mp_codec_to_av_codec_id(decoder) != AV_CODEC_ID_H264)
return HWDEC_ERR_NO_CODEC;
return 0;
}
@@ -103,13 +80,10 @@ static int init_vda_decoder(struct lavc_ctx *ctx)
if (p->vda_ctx.decoder)
ff_vda_destroy_decoder(&p->vda_ctx);
- const struct profile_entry *pe =
- find_codec(ctx->avctx->codec_id, ctx->avctx->profile);
-
p->vda_ctx = (struct vda_context) {
.width = ctx->avctx->width,
.height = ctx->avctx->height,
- .format = pe->vda_codec,
+ .format = 'avc1',
// equals to k2vuyPixelFormat (= YUY2/UYVY)
.cv_pix_fmt_type = kCVPixelFormatType_422YpCbCr8,