summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2014-04-09 16:50:20 +0200
committerTorsten Jager <t.jager@gmx.de>2014-04-09 16:50:20 +0200
commit19c7c142c3e1538c95dc022934a51b5ab59c5f7a (patch)
treec77c6f53f2f510e442a2870b5e037a0ab03ce4ca /src
parent5e5a3208b361785b9790874d1ca38887a078a397 (diff)
downloadxine-lib-19c7c142c3e1538c95dc022934a51b5ab59c5f7a.tar.gz
xine-lib-19c7c142c3e1538c95dc022934a51b5ab59c5f7a.tar.bz2
Handle "no vo soft render space": enable vo_x(cb)xv.
Also, do a proper blackfill to avoid green edges.
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_xcbxv.c18
-rw-r--r--src/video_out/video_out_xv.c28
2 files changed, 44 insertions, 2 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index 82953e57f..64c45cfee 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -387,10 +387,25 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
dispose_ximage(this, frame);
create_ximage(this, frame, width, height, format);
+ if (!frame->image) {
+ frame->vo_frame.base[0] = NULL;
+ frame->vo_frame.base[1] = NULL;
+ frame->vo_frame.base[2] = NULL;
+ frame->req_width = 0;
+ frame->vo_frame.width = 0;
+ return;
+ }
if(format == XINE_IMGFMT_YUY2) {
frame->vo_frame.pitches[0] = frame->xv_pitches[0];
frame->vo_frame.base[0] = frame->image + frame->xv_offsets[0];
+ {
+ const union {uint8_t bytes[4]; uint32_t word;} black = {{0, 128, 0, 128}};
+ uint32_t *q = (uint32_t *)frame->vo_frame.base[0];
+ int i;
+ for (i = frame->vo_frame.pitches[0] * frame->xv_height / 4; i > 0; i--)
+ *q++ = black.word;
+ }
}
else {
frame->vo_frame.pitches[0] = frame->xv_pitches[0];
@@ -399,6 +414,9 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->vo_frame.base[0] = frame->image + frame->xv_offsets[0];
frame->vo_frame.base[1] = frame->image + frame->xv_offsets[2];
frame->vo_frame.base[2] = frame->image + frame->xv_offsets[1];
+ memset (frame->vo_frame.base[0], 0, frame->vo_frame.pitches[0] * frame->xv_height);
+ memset (frame->vo_frame.base[1], 128, frame->vo_frame.pitches[1] * frame->xv_height / 2);
+ memset (frame->vo_frame.base[2], 128, frame->vo_frame.pitches[2] * frame->xv_height / 2);
}
/* allocated frame size may not match requested size */
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 24c25993b..2e4b6e94a 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -413,8 +413,13 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
_x_abort();
}
- image = XvCreateImage (this->display, this->xv_port,
- xv_format, data, width, height);
+ if (data) {
+ image = XvCreateImage (this->display, this->xv_port, xv_format, data, width, height);
+ if (!image)
+ free (data);
+ } else
+ image = NULL;
+
shminfo->shmaddr = 0;
}
return image;
@@ -472,10 +477,26 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
}
frame->image = create_ximage (this, &frame->shminfo, width, height, format);
+ if (!frame->image) {
+ UNLOCK_DISPLAY (this);
+ frame->vo_frame.base[0] = NULL;
+ frame->vo_frame.base[1] = NULL;
+ frame->vo_frame.base[2] = NULL;
+ frame->req_width = 0;
+ frame->vo_frame.width = 0;
+ return;
+ }
if(format == XINE_IMGFMT_YUY2) {
frame->vo_frame.pitches[0] = frame->image->pitches[0];
frame->vo_frame.base[0] = frame->image->data + frame->image->offsets[0];
+ {
+ const union {uint8_t bytes[4]; uint32_t word;} black = {{0, 128, 0, 128}};
+ uint32_t *q = (uint32_t *)frame->vo_frame.base[0];
+ int i;
+ for (i = frame->vo_frame.pitches[0] * frame->image->height / 4; i > 0; i--)
+ *q++ = black.word;
+ }
}
else {
frame->vo_frame.pitches[0] = frame->image->pitches[0];
@@ -484,6 +505,9 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->vo_frame.base[0] = frame->image->data + frame->image->offsets[0];
frame->vo_frame.base[1] = frame->image->data + frame->image->offsets[2];
frame->vo_frame.base[2] = frame->image->data + frame->image->offsets[1];
+ memset (frame->vo_frame.base[0], 0, frame->vo_frame.pitches[0] * frame->image->height);
+ memset (frame->vo_frame.base[1], 128, frame->vo_frame.pitches[1] * frame->image->height / 2);
+ memset (frame->vo_frame.base[2], 128, frame->vo_frame.pitches[2] * frame->image->height / 2);
}
/* allocated frame size may not match requested size */