nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   VDPAU information utility (http://www.nvnews.net/vbulletin/showthread.php?t=124978)

wump 12-19-08 10:11 AM

VDPAU information utility
 
In similar vein to utilities like glxinfo, xdpyinfo, I made a simple utility that queries and displays the VDPAU capabilities of your X display and prints them in tabular format. For example, on my 8600GT at home it shows:
Code:

display: :0.0  screen: 0
API version: 0
Information string: Unknown

Video surface:

name  width height types
-------------------------------------------
420    4096  4096  NV12 YV12
422    4096  4096  UYVY YUYV

Decoder capabilities:

name          level macbs width height
------------------------------------
MPEG1            0  8191  2032  2032
MPEG2_SIMPLE      3  8191  2032  2032
MPEG2_MAIN        3  8191  2032  2032
H264_MAIN        41  8191  2032  2032
H264_HIGH        41  8191  2032  2032

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    y  Y8U8V8A8 V8U8Y8A8
R10G10B10A2      8192  8192    y  Y8U8V8A8 V8U8Y8A8

Bitmap surface:

name              width height
------------------------------
B8G8R8A8          8192  8192
R8G8B8A8          8192  8192
R10G10B10A2      8192  8192
B10G10R10A2      8192  8192
A8                8192  8192

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL            y
DEINTERLACE_TEMPORAL_SPATIAL    y
INVERSE_TELECINE                y
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                        y

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y        1    4096
VIDEO_SURFACE_HEIGHT            y        1    4096
CHROMA_TYPE                      y 
LAYERS                          y        0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                y 
CSC_MATRIX                      y 
NOISE_REDUCTION_LEVEL            y      0.00    1.00
SHARPNESS_LEVEL                  y    -1.00    1.00
LUMA_KEY_MIN_LUMA                y 
LUMA_KEY_MAX_LUMA                y

I just wrote it as a simple first VDPAU program, to see how the API works, but I realised it might be useful to others as well.

Download link (c++ source code):
http://www.cs.rug.nl/~wladimir/vdpin...o-0.0.5.tar.gz

Changelog 0.0.5:
- show macroblocks instead of maximum number of references

iamlindoro 12-19-08 10:41 AM

Re: VDPAU information utility
 
Wump,

What a great and helpful little tool! What license is this released under? Any chance of making it not rely on being run from within an X session?

Thanks!

wump 12-19-08 10:49 AM

Re: VDPAU information utility
 
Good point about the licensing. I just added a MIT license.

About running without an X session, I don't know if that is possible at all. To bootstrap everything, I currently use
Code:

    rv = vdp_device_create_x11(display, screen, &device, &get_proc_address);
... which requires a display and a screen. If you know of a way to make a VDP device without that, let me know.

iamlindoro 12-19-08 10:58 AM

Re: VDPAU information utility
 
Hi wump,

No, I just asked an ignorant question. Of course you have to create a surface to make this work, glxinfo works the same way. Ignore me. ;)

Stephen Warren 12-19-08 11:12 AM

Re: VDPAU information utility
 
Great tool! I always meant to write it myself...

A couple of notes:

1)

Some mixer parameters don't have an associated value range, (e.g. they're enums which could theoretically be disjoint)

Code:

CHROMA_TYPE                      y  00000001 00001000
2)

Same thing for some mixer attributes.

3)

The type of mixer attributes can vary (as indeed can mixer parameters). For example, these are floats, not ints:

Code:

NOISE_REDUCTION_LEVEL            y  00000000 3f800000
SHARPNESS_LEVEL                  y  bf800000 3f800000

The docs in the header should indicate all the details for the various parameters/attributes.

wump 12-19-08 11:40 AM

Re: VDPAU information utility
 
Thanks for the suggestions, I just posted a new version that addressees those things and updated the opening post...

wump 12-19-08 11:50 AM

Re: VDPAU information utility
 
BTW:
Querying VDP_CHROMA_TYPE_444 with VideoSurfaceQueryCapabilities returns an error (VDP_STATUS_INVALID_CHROMA_TYPE), is this supposed to be the case? Shouldn't it just report supported=0 ?

maheshasolkar 12-19-08 01:41 PM

Re: VDPAU information utility
 
I get different results when I compile with the CXXFLAGS in the makefile and when I compile without any CXXFLAGS (line commented out). The difference is:

Code:

% diff info.default_cxxflags.txt info.no_cxxflags.txt
43,48c43,48
< DEINTERLACE_TEMPORAL            -
< DEINTERLACE_TEMPORAL_SPATIAL    -
< INVERSE_TELECINE                -
< NOISE_REDUCTION                  -
< SHARPNESS                        -
< LUMA_KEY                        -
---
> DEINTERLACE_TEMPORAL            y
> DEINTERLACE_TEMPORAL_SPATIAL    y
> INVERSE_TELECINE                y
> NOISE_REDUCTION                  y
> SHARPNESS                        y
> LUMA_KEY                        y

Is this expected?

I have a GeForce 8400GS, by the way. I ran the utility to see how the vdpau support is on that card.

Thanks for the nifty tool!

/Mahesh

wump 12-19-08 09:19 PM

Re: VDPAU information utility
 
Quote:

Originally Posted by maheshasolkar (Post 1880302)
I get different results when I compile with the CXXFLAGS in the makefile Is this expected?

Yes, this is pretty weird. You can reproduce this by changing line 258 to
Code:

VdpBool is_supported = true;
or
Code:

VdpBool is_supported = false;
It seems that VideoMixerQueryFeatureSupport doesn't change the value of the boolean at all ! Even though return value is VDP_STATUS_OK (this is checked). Because the value wasn't initialized by my program either it came out random. Very strange...

AaronP 12-19-08 11:02 PM

Re: VDPAU information utility
 
Neat! I just have one suggestion: replace
Code:

char *display_name = NULL;
with
Code:

char *display_name = XDisplayName(NULL);
As for VideoMixerQueryFeatureSupport, it looks like it only sets is_supported if the feature is not supported. I'll file a bug.

wump 12-21-08 05:14 AM

Re: VDPAU information utility
 
I've patched it to default to true for support of features now, this should be correct even with the bug. Also I use the XDisplayName.

Deanjo 12-22-08 06:09 PM

Re: VDPAU information utility
 
Why not put this utility up on sourceforge?


All times are GMT -5. The time now is 11:23 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.