[MPlayer-dev-eng] [PATCH] Add VO control to retrieve AVCodecContext.hwaccel_context

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Apr 2 13:25:30 CEST 2009


On Thu, Apr 02, 2009 at 11:05:29AM +0200, Gwenole Beauchesne wrote:
> Here is a patch to add a VO control to retrieve 
> AVCodecContext.hwaccel_context. This is FFmpeg and HW accel specific.

Hm. Am I right that only VAAPI needs this but not VDPAU? Would you mind
briefly describing due to which VAAPI design differences it needs it?

> @@ -151,6 +151,12 @@ static int control(struct vf_instance_s* vf, int request, void* data)
>  	*(double *)data = vf->priv->pts;
>  	return CONTROL_TRUE;
>      }
> +    case VFCTRL_GET_HWACCEL_CONTEXT:
> +    {
> +        if(!video_out) return CONTROL_FALSE; // vo not configured?
> +        return(video_out->control(VOCTRL_GET_HWACCEL_CONTEXT, data)
> +               == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
> +    }

IMO e.g.
if (video_out->control(VOCTRL_GET_HWACCEL_CONTEXT, data) != VO_TRUE)
    return CONTROL_FALSE;
return CONTROL_TRUE;
is much nicer.
Apart from that I don't think it makes sense until a patch actually
using it is close to passing review.



More information about the MPlayer-dev-eng mailing list