summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2011-12-29 17:47:21 +0100
committerJohns <johns98@gmx.net>2011-12-29 17:47:21 +0100
commit1f2d1d235e162b8913f381e426ce40540460485a (patch)
treebd9b50dcbbc768cae352c7ea4d80a91fc04e5ed4 /video.c
parentf1792644685a6ba8f8233ae5b5f4a3faab35a1a3 (diff)
downloadvdr-plugin-softhddevice-1f2d1d235e162b8913f381e426ce40540460485a.tar.gz
vdr-plugin-softhddevice-1f2d1d235e162b8913f381e426ce40540460485a.tar.bz2
Vpdau displays black, when no video available.
Diffstat (limited to 'video.c')
-rw-r--r--video.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/video.c b/video.c
index fad0f57..accab80 100644
--- a/video.c
+++ b/video.c
@@ -4661,6 +4661,44 @@ static void VdpauMixVideo(VdpauDecoder * decoder)
}
///
+/// Create and display a black empty surface.
+///
+/// @param decoder VDPAU hw decoder
+///
+static void VdpauBlackSurface(VdpauDecoder * decoder)
+{
+ VdpStatus status;
+ void *image;
+ void const *data[1];
+ uint32_t pitches[1];
+ VdpRect dst_rect;
+
+ Debug(3, "video/vdpau: black surface\n");
+
+ // FIXME: clear video window area
+ (void)decoder;
+
+ image = calloc(4, VideoWindowWidth * VideoWindowHeight);
+
+ dst_rect.x0 = 0;
+ dst_rect.y0 = 0;
+ dst_rect.x1 = dst_rect.x0 + VideoWindowWidth;
+ dst_rect.y1 = dst_rect.y0 + VideoWindowHeight;
+ data[0] = image;
+ pitches[0] = VideoWindowWidth * 4;
+
+ 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);
+}
+
+///
/// Advance displayed frame.
///
static void VdpauAdvanceFrame(void)
@@ -4755,8 +4793,8 @@ static void VdpauDisplayFrame(void)
filled = atomic_read(&decoder->SurfacesFilled);
// need 1 frame for progressive, 3 frames for interlaced
if (filled < 1 + 2 * decoder->Interlaced) {
- // FIXME: render black surface
- // FIXME: or rewrite MixVideo to support less surfaces
+ // FIXME: rewrite MixVideo to support less surfaces
+ VdpauBlackSurface(decoder);
continue;
}