|
|
#1 | |
|
Registered User
Join Date: Sep 2009
Posts: 57
|
I want to be able to letterbox a video window (native X rendering with decode/render using VDPAU) to paint black borders around the video when screen size is bigger. When I move the source co-ordinates by an offset to output to destination surface, the screen positions are correct, the area covered by the offset ( picture's x,y from scereen (x,y)) are black color however the area to the right and bottom of it are all green.
When I create the mixer, I enable VDP_VIDEO_MIXER_ATTRIBUTE_BACKGROUND_COLOR and set a background as attribute value (black) , but its not working. I have tried other ways, such as fill the surfaces with put_bits function, use the function VdpPresentationQueueSetBackgroundColor etc but all to no avail. What are the fundamental requirements for this simple thing to work? thanks |
|
|
|
|
|
|
#2 | |
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
It sounds like one of the following is happening:
1) Your VdpOutputSurfaces aren't large enough to fill your window. 2) Your VdpPresentationQueueDisplay parameters are clipping the VdpOutputSurface to a size that's smaller than the window. Either of those will cause the window to show the presentation queue's background color in the regions not covered by the VdpOutputSurface's clipped size. I'm surprised that VdpPresentationQueueSetBackgroundColor doesn't affect the color of this right/bottom region. Does behaviour differ based on blit vs. overlay presentation queue? What about if you call VdpPresentationQueueSetBackgroundColor before displaying any surfaces? Alternatively, if this clipping isn't an issue, then I guess the rectangles you're passing to VdpVideoMixerRender aren't covering the surfaces in the way you want. If that doesn't help, can you create a small test application that demonstrates the issue? |
|
|
|
|
|
|
#3 | |||||
|
Registered User
Join Date: Sep 2009
Posts: 57
|
Quote:
Quote:
Quote:
Quote:
Quote:
Another question, if I want to render multiple video windows sharing the same output window (lets say four 640x480 covering a 1920x1080 area), and I have individual VDP Device, VDP Decoder, mixer etc, do you think when all of these windows are relocated with the VdpVideoMixerRender function to different screen positions, the window will flicker? Do I have to create 1920x1080 output surfaces for all of them? |
|||||
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Sep 2009
Posts: 57
|
VdpPresentationQueueDisplay was the culprit! I gave the full window regions and Its now showing up properly. However that raises the same question I asked before,
"Another question, if I want to render multiple video windows sharing the same output window (lets say four 640x480 covering a 1920x1080 area), and I have individual VDP Device, VDP Decoder, mixer etc, do you think when all of these windows are relocated with the VdpVideoMixerRender function to different screen positions, the window will flicker? Do I have to create 1920x1080 output surfaces for all of them?" It seems that the multiple VDP decoders will have to share the same presentation queue (because once I create a 1080 P window and a presentation queue backing it up, subsequent VdpPresentationQueueTargetCreateX11 fails because the window cant be reused, this leads me to come to the conclusion above. So could you please elaborate what common resources should be created and shared and what resources should be created for individual video streams and not shared? The resources being the X11 window, presentation queue, presentation queue target, VDP device, VDP decoder, VDP mixer, video surfaces, output surfaces |
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
If you want to render 4 separate streams into the same window, you have two choices:
Choice 1: Create 1 VdpDevice Create 1 VdpPresentationQueue Create 4 VdpVideoDecoders Create 4 VdpVideoMixers (1 per stream; the mixer maintains stream-specific history) Create 1 set of window-sized VdpOutputSurfaces For each display frame, for each of the 4 streams, use the stream's VdpVideoMixer to render to a subset of the selected VdpOutputSurface, and then pass this combined surface to the VdpPresentationQueue. Advantages: * Single presentation queue means it's easy to keep the videos synchronized. * Single device and presentation queue means there's less overhead. Choice 2: Use child X windows to sub-divide your top-level window into 4 windows. For each window, use a separate VdpPresentationQueue, VdpVideoMixer, and VdpDecoder. These can be in the same or separate VdpDevice. Advantages: * The N streams can be completely separately managed by your application. |
|
|
|
|
|
#6 | |
|
Registered User
Join Date: Sep 2009
Posts: 57
|
Quote:
The way I have it right now, choice 2 will be easier to implement, but I think since each stream will have their own presentation time for rendering, the overall view of the whole window wont look very pleasing to the eye. I will find out shortly. |
|
|
|
|
![]() |
| Thread Tools | |
|
|