[Libva] Question about vaPutSurface

Zhao, Yakui yakui.zhao at intel.com
Tue Jun 24 19:31:39 PDT 2014


On Tue, 2014-06-24 at 19:14 -0600, Jean-Yves Avenard wrote:
> Hi
> 
> On 25 June 2014 11:07, Zhao, Yakui <yakui.zhao at intel.com> wrote:
> >> To have a 1440x1080 video properly scaled, I need to call vaPutSurface with:
> >>     va_status = vaPutSurface(m_display->m_va_disp, surface,
> >>                              pic->m_pixmap,
> >>                              0, 0,
> >>                              m_size.width(), m_size.height(),
> >>                              0, 0,
> >>                              1014, 576, //m_size.width(), m_size.height(),
> >>                              NULL, 0,
> >>                              field);
> >>
> >
> > The vaPutSurface contains two groups of parameters to determine how to
> > display the corresponding video.
> >   >Src rectangle: This determines the region of source region.
> >   >Dest rectangle: This determines where the video is displayed on the
> > target window/pixmap
> >
> > Under some scenarios the dimension of the video source is different with
> > that of the target window/pixmap. In such case it will use the
> > width/height ratio of the source video to calibrate the corresponding
> > dest region, which is to avoid the stretching.
> > Of course you can use any region to display it if the stretching doesn't
> > matter.
> 
> Thanks for your answer.
> 
> However, it doesn't make much sense to me.
> I'm already making use of the src and dest rectangle as you can see in
> my snippet above.
> 
> And more importantly, the GL viewport of the destination rectangle is
> set to be of the dimension of the source rectangle.
> 
> There should be no stretching, scaling to be done of any kind, seeing
> that source rectangle and destination rectangle are of the same
> dimension.

As we mentioned in the previous email, the dest region parameter of
vaPutSurface determines where it is displayed on the target
window/pixmap. 
But one note is that the target window/pixmap is not directly displayed
instead it is managed/composed by the window manager. Maybe the window
manager will do some stretching although vaPutSurface doesn't do the
stretching.

> 
> Yet, somehow, vaPutSurface doesn't respect that and apply some
> stretching magic I'm yet to comprehend




More information about the Libva mailing list