Skip to content

Commit

Permalink
VDPAU: Avoid an extra call to VideoDisplayProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Dec 7, 2011
1 parent 2427bc2 commit a103875
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -1825,7 +1825,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
#ifdef USING_VDPAU
MythCodecID vdpau_mcid;
vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
width, height,
width, height, dec,
mpeg_version(enc->codec_id),
!FlagIsSet(kDecodeAllowGPU));

Expand Down
7 changes: 2 additions & 5 deletions mythtv/libs/libmythtv/videoout_vdpau.cpp
Expand Up @@ -918,21 +918,18 @@ QStringList VideoOutputVDPAU::GetAllowedRenderers(
}

MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
uint width, uint height,
uint width, uint height, const QString &decoder,
uint stream_type, bool no_acceleration)
{
bool use_cpu = no_acceleration;
VideoDisplayProfile vdp;
vdp.SetInput(QSize(width, height));
QString dec = vdp.GetDecoder();

MythCodecID test_cid = (MythCodecID)(kCodec_MPEG1_VDPAU + (stream_type-1));
use_cpu |= !codec_is_vdpau_hw(test_cid);
if (test_cid == kCodec_MPEG4_VDPAU)
use_cpu |= !MythRenderVDPAU::IsMPEG4Available();
if (test_cid == kCodec_H264_VDPAU)
use_cpu |= !MythRenderVDPAU::H264DecoderSizeSupported(width, height);
if ((dec != "vdpau") || getenv("NO_VDPAU") || use_cpu)
if ((decoder != "vdpau") || getenv("NO_VDPAU") || use_cpu)
return (MythCodecID)(kCodec_MPEG1 + (stream_type-1));

return test_cid;
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/videoout_vdpau.h
Expand Up @@ -52,6 +52,7 @@ class VideoOutputVDPAU : public VideoOutput
static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
const QSize &video_dim);
static MythCodecID GetBestSupportedCodec(uint width, uint height,
const QString &decoder,
uint stream_type,
bool no_acceleration);
virtual bool IsPIPSupported(void) const { return true; }
Expand Down

0 comments on commit a103875

Please sign in to comment.