+ VdpStatus vdp_st;
+ VdpBool is_supported = false;
+ uint32_t max_level, max_macroblocks, max_width, max_height;
+
+ // query device capabilities to ensure that VDPAU can handle the requested codec
+ vdp_st = m_vdpauConfig.context->GetProcs().vdp_decoder_query_caps(m_vdpauConfig.context->GetDevice(),
+ profile, &is_supported, &max_level, &max_macroblocks, &max_width, &max_height);
+
+ // test to make sure there is a possibility the codec will work
+ if (CheckStatus(vdp_st, __LINE__))
+ {
+ CLog::Log(LOGERROR, "VDPAU::Open: error %s(%d) checking for decoder support", m_vdpauConfig.context->GetProcs().vdp_get_error_string(vdp_st), vdp_st);
+ return false;
+ }
+
+ if (max_width < avctx->coded_width || max_height < avctx->coded_height)
+ {
+ CLog::Log(LOGWARNING,"VDPAU::Open: requested picture dimensions (%i, %i) exceed hardware capabilities ( %i, %i).",
+ avctx->coded_width, avctx->coded_height, max_width, max_height);
+ return false;
+ }
+