[Libva] Question about vaPutSurface

Gwenole Beauchesne gb.devel at gmail.com
Tue Jun 24 21:41:56 PDT 2014


Hi,

2014-06-25 3:07 GMT+02:00 Zhao, Yakui <yakui.zhao at intel.com>:
> On Tue, 2014-06-24 at 05:27 -0600, Jean-Yves Avenard wrote:
>> Hi.
>>
>> Following earlier discussion, I've replaced our use of
>> vaCopySurfaceGLC with a call to vaPutSurface.
>>
>> This is the resulting change:
>> https://github.com/MythTV/mythtv/commit/9ef798e543e63785d898eb23e77ca1a2a7d08c4b
>>
>> I have issue with the way the frame is scaled on the screen following
>> that change, and I can't make the logic of it.
>>
>> On my laptop, 11" macbook air with haswell i6-4650U with HD5000
>> graphic adapter. It has a 1366x768 screen. The resolution of the
>> screen is probably irrelevant as it doesn't matter the size of the
>> window I'm displaying to, it always exhibit the same behaviour.
>>
>> 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.

Please define "it". If this refers to the VA driver, then, no, it must
respect the source and target regions. The calibration you mention is
only needed to honour the aspect ratio of associated subpictures. If
the user requests rendering to a pixmap of the specified size, this
has to be fulfilled.

Thanks,
Gwenole.

> Of course you can use any region to display it if the stretching doesn't
> matter.
>
>
>> m_size.width() return 1440, and m_size.height() returns 1080.
>> The texture and XPixmap created are also 1440x1080 (same size as the
>> video being played)
>>
>> So I need to use destw of 1014 and a desth of 576. Those aren't exact,
>> it's the values I found that filled completely my screen and it
>> doesn't look like the people are on an extreme diet.
>>
>> For a video that is 720x576
>> I have to use:
>> destw = 510
>> desth = 326
>>
>> For a 1920x800, I use destw = 1800 and desth = 600
>>
>> Any thoughts, feedbacks will be greatly appreciated.
>>
>> Thanks !
>> JY
>> _______________________________________________
>> Libva mailing list
>> Libva at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/libva
>
>
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva



-- 
Gwenole Beauchesne
Intel Corporation SAS / 2 rue de Paris, 92196 Meudon Cedex, France
Registration Number (RCS): Nanterre B 302 456 199


More information about the Libva mailing list