From 4733aeda97b6185b8c237ce4ac2b89ba167e6fa7 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Wed, 9 Jan 2002 22:33:03 +0000 Subject: video_driver api changed. dxr3 decoder only functions if the dxr3 video_out driver loaded. xine_t changed. CVS patchset: 1381 CVS date: 2002/01/09 22:33:03 --- src/dxr3/dxr3_decoder.c | 20 ++++++++++++++------ src/dxr3/dxr3_video_out.c | 8 ++++++-- src/video_out/video_out_aa.c | 6 ++++-- src/video_out/video_out_syncfb.c | 6 ++++-- src/video_out/video_out_xshm.c | 6 ++++-- src/video_out/video_out_xv.c | 7 +++++-- src/xine-engine/video_out.h | 10 ++++++---- src/xine-engine/xine.c | 4 +++- src/xine-engine/xine_internal.h | 3 ++- 9 files changed, 48 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/dxr3/dxr3_decoder.c b/src/dxr3/dxr3_decoder.c index bbe0260d7..54d61cb0c 100644 --- a/src/dxr3/dxr3_decoder.c +++ b/src/dxr3/dxr3_decoder.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: dxr3_decoder.c,v 1.56 2002/01/07 23:36:37 jcdutton Exp $ + * $Id: dxr3_decoder.c,v 1.57 2002/01/09 22:33:03 jcdutton Exp $ * * dxr3 video and spu decoder plugin. Accepts the video and spu data * from XINE and sends it directly to the corresponding dxr3 devices. @@ -137,16 +137,22 @@ static int dxr3_check_vo(config_values_t* cfg) static int dxr3_tested = 0; static int dxr3_ok; -static void dxr3_presence_test() +static void dxr3_presence_test( xine_t* xine) { int fd, val; + vo_info_t *info; if (dxr3_tested) return; dxr3_tested = 1; dxr3_ok = 0; - + if (xine && xine->video_driver ) { + info = xine->video_driver->get_info(); + if ((strncmp (info->id, "dxr3", 4)) != 0) { + return; + } + } if ((fd = open(devname, O_WRONLY))<0) { printf("dxr3: not detected (%s: %s)\n", devname, strerror(errno)); @@ -734,7 +740,7 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, cfg = xine->config; devname = cfg->register_string (cfg, LOOKUP_DEV, DEFAULT_DEV, "Dxr3: Device Name",NULL,NULL,NULL); - dxr3_presence_test (); + dxr3_presence_test ( xine ); if (!dxr3_ok) return NULL; this = (dxr3_decoder_t *) malloc (sizeof (dxr3_decoder_t)); @@ -1047,8 +1053,10 @@ spu_decoder_t *init_spu_decoder_plugin (int iface_version, xine_t *xine) cfg = xine->config; devname = cfg->register_string (cfg, LOOKUP_DEV, DEFAULT_DEV, NULL,NULL,NULL,NULL); - dxr3_presence_test (); - if (!dxr3_ok) return NULL; + dxr3_presence_test ( xine ); + if (!dxr3_ok) { + return NULL; + } this = (spudec_decoder_t *) malloc (sizeof (spudec_decoder_t)); diff --git a/src/dxr3/dxr3_video_out.c b/src/dxr3/dxr3_video_out.c index 6084bcb96..e1197d6e2 100644 --- a/src/dxr3/dxr3_video_out.c +++ b/src/dxr3/dxr3_video_out.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: dxr3_video_out.c,v 1.4 2001/12/24 19:31:13 hrm Exp $ + * $Id: dxr3_video_out.c,v 1.5 2002/01/09 22:33:04 jcdutton Exp $ * * mpeg1 encoding video out plugin for the dxr3. * @@ -162,6 +162,8 @@ int dxr3_fame_init(dxr3_driver_t *); #define MV_COMMAND 0 +vo_info_t *get_video_out_plugin_info(); + /* some helper stuff so that the decoder plugin can test for the * presence of the dxr3 vo driver */ /* to be called by dxr3 video out init and exit handlers */ @@ -510,6 +512,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) /* * allocate plugin struct */ +printf("dxr3_video_out:init_plugin\n"); this = malloc (sizeof (dxr3_driver_t)); @@ -530,6 +533,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) this->vo_driver.get_property_min_max = dxr3_get_property_min_max; this->vo_driver.gui_data_exchange = dxr3_gui_data_exchange; this->vo_driver.exit = dxr3_exit; + this->vo_driver.get_info = get_video_out_plugin_info; this->config=config; this->mpeg_source = 0; /* set by update_frame, by checking the flag */ @@ -632,7 +636,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) } static vo_info_t vo_info_dxr3 = { - 2, /* api version */ + 3, /* api version */ "dxr3", "xine video output plugin for dxr3 cards", VISUAL_TYPE_X11, diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index ae8d76767..92e69ee28 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.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: video_out_aa.c,v 1.13 2001/10/03 15:14:03 jkeil Exp $ + * $Id: video_out_aa.c,v 1.14 2002/01/09 22:33:04 jcdutton Exp $ * * video_out_aa.c, ascii-art output plugin for xine * @@ -76,6 +76,7 @@ typedef struct { /* * our video driver */ +vo_info_t *get_video_out_plugin_info(); static uint32_t aa_get_capabilities (vo_driver_t *this) { return VO_CAP_YV12 | VO_CAP_YUY2; @@ -288,12 +289,13 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = aa_get_property_min_max; this->vo_driver.gui_data_exchange = NULL; this->vo_driver.exit = aa_exit; + this->vo_driver.get_info = get_video_out_plugin_info; return (vo_driver_t*) this; } static vo_info_t vo_info_aa = { - 2, + 3, "aa", "xine video output plugin using the ascii-art library", VISUAL_TYPE_AA, diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index db8214150..36104a518 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.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: video_out_syncfb.c,v 1.49 2001/12/29 15:43:02 miguelfreitas Exp $ + * $Id: video_out_syncfb.c,v 1.50 2002/01/09 22:33:04 jcdutton Exp $ * * video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine * @@ -161,6 +161,7 @@ int gX11Fail; /* * internal video_out_syncfb functions */ +vo_info_t *get_video_out_plugin_info(); /* returns boolean value (1 success, 0 failure) */ int syncfb_overlay_on(syncfb_driver_t* this) { @@ -1281,6 +1282,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = syncfb_get_property_min_max; this->vo_driver.gui_data_exchange = syncfb_gui_data_exchange; this->vo_driver.exit = syncfb_exit; + this->vo_driver.get_info = get_video_out_plugin_info; this->deinterlace_enabled = 0; @@ -1288,7 +1290,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_syncfb = { - 2, + 3, "SyncFB", "xine video output plugin using the SyncFB module for Matrox G200/G400 cards", VISUAL_TYPE_X11, diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index d6a744f80..b308ff16a 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.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: video_out_xshm.c,v 1.52 2001/11/28 22:19:12 miguelfreitas Exp $ + * $Id: video_out_xshm.c,v 1.53 2002/01/09 22:33:04 jcdutton Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -159,6 +159,7 @@ int gX11Fail; /* * first, some utility functions */ +vo_info_t *get_video_out_plugin_info(); int HandleXError (Display *display, XErrorEvent *xevent) { @@ -1224,6 +1225,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = xshm_get_property_min_max; this->vo_driver.gui_data_exchange = xshm_gui_data_exchange; this->vo_driver.exit = xshm_exit; + this->vo_driver.get_info = get_video_out_plugin_info; /* @@ -1348,7 +1350,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_shm = { - 2, + 3, "XShm", "xine video output plugin using the MIT X shared memory extension", VISUAL_TYPE_X11, diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 8306ec79c..d01bb6830 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.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: video_out_xv.c,v 1.87 2002/01/05 13:49:30 miguelfreitas Exp $ + * $Id: video_out_xv.c,v 1.88 2002/01/09 22:33:04 jcdutton Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -168,6 +168,8 @@ struct xv_driver_s { int gX11Fail; +vo_info_t *get_video_out_plugin_info(); + static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1369,6 +1371,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = xv_get_property_min_max; this->vo_driver.gui_data_exchange = xv_gui_data_exchange; this->vo_driver.exit = xv_exit; + this->vo_driver.get_info = get_video_out_plugin_info; /* * init properties @@ -1499,7 +1502,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_xv = { - 2, + 3, "Xv", "xine video output plugin using the MIT X video extension", VISUAL_TYPE_X11, diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 569b054d1..c615a7fa8 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.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: video_out.h,v 1.34 2002/01/08 16:47:57 cvogler Exp $ + * $Id: video_out.h,v 1.35 2002/01/09 22:33:04 jcdutton Exp $ * * * xine version of video_out.h @@ -53,6 +53,7 @@ extern "C" { typedef struct vo_frame_s vo_frame_t; typedef struct vo_driver_s vo_driver_t ; typedef struct vo_instance_s vo_instance_t; +typedef struct vo_info_s vo_info_t; typedef struct img_buf_fifo_s img_buf_fifo_t; typedef struct vo_overlay_s vo_overlay_t; typedef struct video_overlay_instance_s video_overlay_instance_t; @@ -254,7 +255,7 @@ struct vo_instance_s { * from generic vo functions. */ -#define VIDEO_OUT_IFACE_VERSION 2 +#define VIDEO_OUT_IFACE_VERSION 3 struct vo_driver_s { @@ -302,6 +303,7 @@ struct vo_driver_s { void *data); void (*exit) (vo_driver_t *this); + vo_info_t* (*get_info) (); }; @@ -385,7 +387,7 @@ vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) ; * return value: vo_info_t* : some information about the plugin */ -typedef struct vo_info_s { +struct vo_info_s { int interface_version; /* plugin interface version */ char *id; /* id of this plugin */ @@ -393,7 +395,7 @@ typedef struct vo_info_s { int visual_type; /* visual type supported by this plugin */ int priority; /* priority of this plugin for auto-probing */ -} vo_info_t; +}; #ifdef __cplusplus } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index a2485353b..a9909dc67 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.96 2002/01/08 16:47:57 cvogler Exp $ + * $Id: xine.c,v 1.97 2002/01/09 22:33:04 jcdutton Exp $ * * top-level xine functions * @@ -436,6 +436,8 @@ xine_t *xine_init (vo_driver_t *vo, "extension", NULL}; int i; + this->video_driver = vo; + /* init log buffers */ for (i = 0; i < XINE_LOG_NUM; i++) this->log_buffers[i] = new_scratch_buffer (25); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 9ffcadd4c..b57c355eb 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.68 2002/01/05 21:54:17 miguelfreitas Exp $ + * $Id: xine_internal.h,v 1.69 2002/01/09 22:33:04 jcdutton Exp $ * */ @@ -190,6 +190,7 @@ struct xine_s { int spu_channel_auto; int spu_channel; + vo_driver_t *video_driver; vo_instance_t *video_out; fifo_buffer_t *video_fifo; pthread_t video_thread; -- cgit v1.2.3