summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-10-07 17:08:23 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-10-07 17:08:23 +0000
commit2482f928d8723867a51961b1b4f8b94a4f5d57b0 (patch)
tree8dba7fa113b4a72a0ab0ce01fefc271e4a358f43
parent4e0b7398f077972f3759ae7f21e6dbbe866ff87b (diff)
downloadxine-lib-2482f928d8723867a51961b1b4f8b94a4f5d57b0.tar.gz
xine-lib-2482f928d8723867a51961b1b4f8b94a4f5d57b0.tar.bz2
error detection for screenshot function
CVS patchset: 758 CVS date: 2001/10/07 17:08:23
-rw-r--r--include/xine.h.tmpl.in13
-rw-r--r--src/xine-engine/xine.c12
-rw-r--r--src/xine-engine/xine_internal.h10
3 files changed, 20 insertions, 15 deletions
diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in
index 6112a99cf..09fad1936 100644
--- a/include/xine.h.tmpl.in
+++ b/include/xine.h.tmpl.in
@@ -28,7 +28,7 @@
\endverbatim
*/
/*
- * $Id: xine.h.tmpl.in,v 1.45 2001/10/07 16:57:02 guenter Exp $
+ * $Id: xine.h.tmpl.in,v 1.46 2001/10/07 17:08:23 guenter Exp $
*
*/
@@ -1374,17 +1374,18 @@ void xine_send_event(xine_t *self, event_t *event, void *data);
/**
* snapshot function
*
- * returns:
* width, height : size of image (be aware that u,v may be subsampled)
* ratio_code : aspect ratio of the frame
* format : subsampling format YUV 4:2:0 or 4:2:2
* y : lumiance information
* u,v : subsample color information
+ *
+ * return value: 1 => succ, 0=> fail
*/
-void xine_get_current_frame (xine_t *self, int *width, int *height,
- int *ratio_code, int *format,
- uint8_t **y, uint8_t **u,
- uint8_t **v);
+int xine_get_current_frame (xine_t *self, int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t **y, uint8_t **u,
+ uint8_t **v);
#define XINE_IMGFMT_YV12 0x32315659
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 3d32d0f4d..bd37285b3 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.65 2001/10/07 16:57:02 guenter Exp $
+ * $Id: xine.c,v 1.66 2001/10/07 17:08:23 guenter Exp $
*
* top-level xine functions
*
@@ -648,14 +648,17 @@ int xine_set_audio_property(xine_t *this, int property, int value) {
return ~value;
}
-void xine_get_current_frame (xine_t *this, int *width, int *height,
- int *ratio_code, int *format,
- uint8_t **y, uint8_t **u, uint8_t **v) {
+int xine_get_current_frame (xine_t *this, int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t **y, uint8_t **u, uint8_t **v) {
vo_frame_t *frame;
frame = this->video_out->get_last_frame (this->video_out);
+ if (!frame)
+ return 0;
+
*width = frame->width;
*height = frame->height;
@@ -666,5 +669,6 @@ void xine_get_current_frame (xine_t *this, int *width, int *height,
*u = frame->base[1];
*v = frame->base[2];
+ return 1;
}
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 55ca7a996..01f0b8d30 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_internal.h,v 1.47 2001/10/07 16:57:02 guenter Exp $
+ * $Id: xine_internal.h,v 1.48 2001/10/07 17:08:23 guenter Exp $
*
*/
@@ -518,10 +518,10 @@ void xine_send_event(xine_t *this, event_t *event, void *data);
* y : lumiance information
* u,v : subsample color information
*/
-void xine_get_current_frame (xine_t *this, int *width, int *height,
- int *ratio_code, int *format,
- uint8_t **y, uint8_t **u,
- uint8_t **v);
+int xine_get_current_frame (xine_t *this, int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t **y, uint8_t **u,
+ uint8_t **v);
#ifdef __cplusplus
}