summaryrefslogtreecommitdiff
path: root/src/xine-engine/xine.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2009-11-20 01:45:13 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2009-11-20 01:45:13 +0000
commit34e3074e5efa935f2022d870842517d4e0d445c4 (patch)
tree076a9d822c8ca8a09c8d67343fe13e44d19df461 /src/xine-engine/xine.c
parentf791bb6196c70f923375f0614f178bddaece877b (diff)
parente18856000d2bd7d6447ab6c59d3eb8ee3d354dfc (diff)
downloadxine-lib-34e3074e5efa935f2022d870842517d4e0d445c4.tar.gz
xine-lib-34e3074e5efa935f2022d870842517d4e0d445c4.tar.bz2
Merge vdpau. THIS CONTAINS ABI CHANGES and is therefore not xine-lib 1.1.
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r--src/xine-engine/xine.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index aebbffb39..1154a4602 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1972,6 +1972,8 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0);
frame = stream->video_out->get_last_frame (stream->video_out);
+ if (frame)
+ frame->lock(frame);
stream->xine->port_ticket->release(stream->xine->port_ticket, 0);
if (!frame) {
@@ -2003,6 +2005,30 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
switch (frame->format) {
+ default:
+ if (frame->proc_provide_standard_frame_data) {
+ uint8_t *img = data->img;
+ size_t img_size = data->img_size;
+ data->img = 0;
+ data->img_size = 0;
+
+ /* ask frame implementation for required img buffer size */
+ frame->proc_provide_standard_frame_data(frame, data);
+ required_size = data->img_size;
+
+ data->img = img;
+ data->img_size = img_size;
+ break;
+ }
+
+ if (!data->img && !(flags & XINE_FRAME_DATA_ALLOCATE_IMG))
+ break; /* not interested in image data */
+
+ xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
+ "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
+ /* fall though and provide "green" YV12 image */
+ data->format = XINE_IMGFMT_YV12;
+
case XINE_IMGFMT_YV12:
required_size = frame->width * frame->height
+ ((frame->width + 1) / 2) * ((frame->height + 1) / 2)
@@ -2015,26 +2041,21 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
+ ((frame->width + 1) / 2) * frame->height;
break;
- default:
- if (data->img || (flags & XINE_FRAME_DATA_ALLOCATE_IMG)) {
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
- _x_abort ();
- }
-
- required_size = 0;
}
if (flags & XINE_FRAME_DATA_ALLOCATE_IMG) {
/* return allocated buffer size */
data->img_size = required_size;
/* allocate img or fail */
- if (!(data->img = calloc(1, required_size)))
+ if (!(data->img = calloc(1, required_size))) {
+ frame->free(frame);
return 0;
+ }
} else {
/* fail if supplied buffer is to small */
if (data->img && !img_size_unknown && data->img_size < required_size) {
data->img_size = required_size;
+ frame->free(frame);
return 0;
}
/* return used buffer size */
@@ -2070,11 +2091,14 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
break;
default:
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
- _x_abort ();
+ if (frame->proc_provide_standard_frame_data)
+ frame->proc_provide_standard_frame_data(frame, data);
+ else if (!(flags & XINE_FRAME_DATA_ALLOCATE_IMG))
+ memset(data->img, 0, data->img_size);
}
}
+
+ frame->free(frame);
return 1;
}