Commit 1bb171da authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vda: use avcodec context parameters

parent e8d10e59
......@@ -367,7 +367,6 @@ endif
libvda_plugin_la_SOURCES = \
video_chroma/copy.c video_chroma/copy.h \
packetizer/h264_nal.c packetizer/h264_nal.h \
codec/avcodec/vda.c
libvda_plugin_la_CFLAGS = $(AM_CFLAGS) $(AVCODEC_CFLAGS)
libvda_plugin_la_LDFLAGS = -Wl,-framework,CoreFoundation,-framework,VideoDecodeAcceleration,-framework,QuartzCore
......
......@@ -37,7 +37,6 @@
#include "avcodec.h"
#include "va.h"
#include "../../packetizer/h264_nal.h"
#include "../../video_chroma/copy.h"
#include <libavcodec/vda.h>
......@@ -102,41 +101,31 @@ static int Open(vlc_va_t *va,
(void) fmt;
(void) p_sys;
VLC_UNUSED(avctx);
size_t i_profile = 0xFFFF, i_level = 0xFFFF;
bool b_ret = false;
switch (fmt->i_codec) {
case VLC_CODEC_H264:
b_ret = h264_get_profile_level(fmt, &i_profile, &i_level, NULL);
if (!b_ret) {
msg_Warn( va, "H264 profile and level parsing failed because it didn't arrive yet");
return VLC_EGENERIC;
}
msg_Dbg( va, "trying to decode MPEG-4 Part 10: profile %zu, level %zu", i_profile, i_level);
switch (avctx->codec_id) {
case AV_CODEC_ID_H264:
msg_Dbg( va, "trying to decode MPEG-4 Part 10: profile %d, level %d", avctx->profile, avctx->level);
switch (i_profile) {
case PROFILE_H264_BASELINE:
case PROFILE_H264_MAIN:
case PROFILE_H264_HIGH:
switch (avctx->profile & ~FF_PROFILE_H264_INTRA) {
case FF_PROFILE_H264_CONSTRAINED_BASELINE:
case FF_PROFILE_H264_BASELINE:
case FF_PROFILE_H264_MAIN:
case FF_PROFILE_H264_HIGH:
break;
default:
{
msg_Dbg( va, "unsupported H264 profile %zu", i_profile);
msg_Dbg( va, "unsupported H264 profile %d", avctx->profile);
return -1;
}
}
break;
default:
#ifndef NDEBUG
msg_Err( va, "'%4.4s' is not supported", (char *)&fmt->i_codec);
msg_Err( va, "codec %d is not supported", avctx->codec_id);
#endif
return VLC_EGENERIC;
break;
}
vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
......
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