/* ** Copyright (C) 2002-2004 Daniel Caujolle-Bert ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "common.h" typedef struct { int init; } none_private_t; static void init_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; none_private_t *private = (none_private_t *) vop->private; tox->video.port = xine_open_video_driver(tox->xine, tox->video.name, XINE_VISUAL_TYPE_NONE, (void *)NULL); private->init = 1; if(tox->video.port == NULL) { fprintf(stderr, "xine_load_video_output_plugin() failed to load '%s' driver.\n", tox->video.name); exit(1); } else pinfo("video driver '%s' successfully loaded.\n", tox->video.name); } static void deinit_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; none_private_t *private = (none_private_t *) vop->private; xine_close_video_driver(tox->xine, tox->video.port); tox->video.port = NULL; private->init = 0; } static void release_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.last_plugin; none_private_t *private = (none_private_t *) vop->private; if(private->init) deinit_video_out(tox); free(private); free(vop); } static const char *get_identifier(void) { return "Dummy video out"; } static char *_vo_none_names[] = { "none", NULL }; static const char **get_names(void) { return (const char **)_vo_none_names; } static const char *get_help(void) { return "Video out plugin which display nothing (useful for audio only playback).\n"; } static int is_fullscreen(toxine_t *tox) { return 0; } static void fullscreen(toxine_t *tox) { } toxine_vo_plugin_t *toxine_load_vo_plugin(toxine_t *tox) { toxine_vo_plugin_t *none; none_private_t *private; none = (toxine_vo_plugin_t *) xine_xmalloc(sizeof(toxine_vo_plugin_t)); private = (none_private_t *) xine_xmalloc(sizeof(none_private_t)); private->init = 0; none->video_out_init = init_video_out; none->video_out_event_loop = NULL; none->video_out_deinit = deinit_video_out; none->video_out_release = release_video_out; none->get_identifier = get_identifier; none->get_names = get_names; none->get_help = get_help; none->is_fullscreen = is_fullscreen; none->receive_xine_event = NULL; none->fullscreen = fullscreen; none->private = (void *) private; return none; }