Faster VdpauBlackSurface version.

This commit is contained in:
Johns 2012-03-30 17:19:31 +02:00
parent 6058f3da56
commit b41f934c37
2 changed files with 27 additions and 24 deletions

View File

@ -2,6 +2,7 @@ User johns
Date: Date:
Release Version 0.5.0 Release Version 0.5.0
Faster VdpauBlackSurface version.
Fix bug: VideoSetPts wrong position for multi frame packets. Fix bug: VideoSetPts wrong position for multi frame packets.
User: CafeDelMar User: CafeDelMar

50
video.c
View File

@ -7248,38 +7248,40 @@ static void VdpauMixVideo(VdpauDecoder * decoder)
/// @param decoder VDPAU hw decoder /// @param decoder VDPAU hw decoder
/// ///
/// @FIXME: render only video area, not fullscreen! /// @FIXME: render only video area, not fullscreen!
/// decoder->Output.. isn't correct setup for radio stations
/// ///
static void VdpauBlackSurface(VdpauDecoder * decoder) static void VdpauBlackSurface(VdpauDecoder * decoder)
{ {
VdpStatus status; VdpStatus status;
void *image; VdpRect source_rect;
void const *data[1]; VdpRect output_rect;
uint32_t pitches[1];
VdpRect dst_rect;
Debug(3, "video/vdpau: black surface\n"); source_rect.x0 = 0;
source_rect.y0 = 0;
source_rect.x1 = 0;
source_rect.y1 = 0;
// FIXME: clear video window area if ( 0 ) {
(void)decoder; // FIXME: wrong for radio channels
output_rect.x0 = decoder->OutputX; // video output (scale)
image = calloc(4, VideoWindowWidth * VideoWindowHeight); output_rect.y0 = decoder->OutputY;
output_rect.x1 = decoder->OutputX + decoder->OutputWidth;
dst_rect.x0 = 0; output_rect.y1 = decoder->OutputY + decoder->OutputHeight;
dst_rect.y0 = 0; } else {
dst_rect.x1 = dst_rect.x0 + VideoWindowWidth; output_rect.x0 = 0;
dst_rect.y1 = dst_rect.y0 + VideoWindowHeight; output_rect.y0 = 0;
data[0] = image; output_rect.x1 = VideoWindowWidth;
pitches[0] = VideoWindowWidth * 4; output_rect.y1 = VideoWindowHeight;
status =
VdpauOutputSurfacePutBitsNative(VdpauSurfacesRb[VdpauSurfaceIndex],
data, pitches, &dst_rect);
if (status != VDP_STATUS_OK) {
Error(_("video/vdpau: output surface put bits failed: %s\n"),
VdpauGetErrorString(status));
} }
free(image); status = VdpauOutputSurfaceRenderOutputSurface(
VdpauSurfacesRb[VdpauSurfaceIndex], &output_rect,
VdpauOsdOutputSurface[!VdpauOsdSurfaceIndex], &source_rect, NULL, NULL,
VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
if (status != VDP_STATUS_OK) {
Error(_("video/vdpau: can't render output surface: %s\n"),
VdpauGetErrorString(status));
}
} }
/// ///