Hi10p use software decoding. No hardware support now.

Force hardware decoding may result in crash
This commit is contained in:
wang-bin
2014-01-26 20:35:16 +08:00
parent 42ee9f2839
commit ff641bf8fe
2 changed files with 20 additions and 3 deletions
+1 -2
View File
@@ -1251,8 +1251,7 @@ bool AVPlayer::setupVideoThread()
//vd->isAvailable() //TODO: the value is wrong now
vd->setCodecContext(vCodecCtx);
vd->setOptions(video_codec_opt);
vd->prepare();
if (vd->open()) {
if (vd->prepare() && vd->open()) {
video_dec = vd;
qDebug("**************Video decoder found");
break;
+19 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2013 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2013-2014 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -139,6 +139,24 @@ bool VideoDecoderFFmpegHW::prepare()
qWarning("call this after AVCodecContext is set!");
return false;
}
//TODO: setup profile in open. vlc/modules/hw/vdpau/avcodec.c, xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
if (d.codec_ctx->codec_id == CODEC_ID_H264) {
// check Hi10p. NO HW support now
switch (d.codec_ctx->profile) {
//case FF_PROFILE_H264_HIGH: //VDP_DECODER_PROFILE_H264_HIGH
case FF_PROFILE_H264_HIGH_10:
case FF_PROFILE_H264_HIGH_10_INTRA:
case FF_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_422_INTRA:
//case FF_PROFILE_H264_HIGH_444: //ignored by xbmc
case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
case FF_PROFILE_H264_HIGH_444_INTRA:
case FF_PROFILE_H264_CAVLC_444:
return false;
default:
break;
}
}
//TODO: neccesary?
#if 0
if (!d.setup(&d.codec_ctx->hwaccel_context, &d.codec_ctx->pix_fmt, d.codec_ctx->width, d.codec_ctx->height)) {