[VDPAU] [PATCH] vdpauinfo: print supported PutBits indexed color formats
Jose Soltren
jsoltren at nvidia.com
Mon Sep 15 10:17:27 PDT 2014
On 2014/09/12, 17:30 , "Aaron Plattner" <aplattner at nvidia.com> wrote:
>This parallels the loop that prints supported YCbCr formats. There is
>only one
>palette color format currently, so just use that for the query.
>
>Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
>---
>This is *really* the the last thing I wanted to do before declaring
>vdpauinfo version 1.0. I know I said that before, but I forgot about
>this TODO item from the original codebase.
>
>Here's what it does to the output on my system:
> name width height nat types
> ----------------------------------------------------
>-B8G8R8A8 16384 16384 y Y8U8V8A8 V8U8Y8A8
>-R10G10B10A2 16384 16384 y Y8U8V8A8 V8U8Y8A8
>+B8G8R8A8 16384 16384 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
>+R10G10B10A2 16384 16384 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
>
>
> vdpauinfo.cpp | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
>diff --git a/vdpauinfo.cpp b/vdpauinfo.cpp
>index bcca6aa..5e97f5b 100644
>--- a/vdpauinfo.cpp
>+++ b/vdpauinfo.cpp
>@@ -25,8 +25,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
>ARISING
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> OTHER DEALINGS IN THE SOFTWARE.
> */
>-/// TODO
>-/// - list color table formats for queryOutputSurface
>
> #include <stdarg.h>
> #include <stdlib.h>
>@@ -96,11 +94,6 @@ Desc indexed_types[] = {
> };
> const size_t indexed_type_count = sizeof(indexed_types)/sizeof(Desc);
>
>-Desc color_table_formats[] = {
>-{"B8G8R8X8", VDP_COLOR_TABLE_FORMAT_B8G8R8X8},
>-};
>-const size_t color_table_format_count =
>sizeof(color_table_formats)/sizeof(Desc);
>-
>
> void queryVideoSurface(VDPDeviceImpl *device)
> {
>@@ -166,11 +159,24 @@ void queryOutputSurface(VDPDeviceImpl *device)
> printf("%s ", ycbcr_types[y].name);
> }
> }
>+
>+ for(int y=0; y<indexed_type_count; ++y)
>+ {
>+ // There is currently only one color table format. This
>will
>+ // have to be reconsidered if additional color table
>formats are
>+ // added.
>+ rv =
>device->OutputSurfaceQueryPutBitsIndexedCapabilities(
>+ device->device, rgb_types[x].id, indexed_types[y].id,
>+ VDP_COLOR_TABLE_FORMAT_B8G8R8X8, &is_supported);
>+ if(rv == VDP_STATUS_OK && is_supported)
>+ {
>+ printf("%s ", indexed_types[y].name);
>+ }
>+ }
>+
> printf("\n");
> }
> }
>- // OutputSurfaceQueryPutBitsIndexedCapabilities
>- // rgba, idx, colortable -> supported
> }
>
> /***************** Bitmap surface ****************/
>--
>2.1.0
This looks fine to me.
Reviewed-by: José Hiram Soltren <jsoltren at nvidia.com>
--
nvpublic
>_______________________________________________
>VDPAU mailing list
>VDPAU at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/vdpau
More information about the VDPAU
mailing list