Commit 4ff5e969 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix merge conflicts for src/osd/osd.c

parent 6f7b6bf6
...@@ -123,6 +123,9 @@ extern "C" { ...@@ -123,6 +123,9 @@ extern "C" {
#define SUBCAT_PLAYLIST_SD 702 #define SUBCAT_PLAYLIST_SD 702
#define SUBCAT_PLAYLIST_EXPORT 703 #define SUBCAT_PLAYLIST_EXPORT 703
#define CAT_OSD 8
#define SUBCAT_OSD_IMPORT 801
struct config_category_t struct config_category_t
{ {
int i_id; int i_id;
......
...@@ -395,6 +395,11 @@ struct osd_menu_t ...@@ -395,6 +395,11 @@ struct osd_menu_t
/* quick link in the linked list. */ /* quick link in the linked list. */
osd_button_t *p_last_button; /*< pointer to last button in the list */ osd_button_t *p_last_button; /*< pointer to last button in the list */
/* misc parser */
module_t *p_module; /*< pointer to parser module */
char *psz_file; /*< Config file name */
image_handler_t *p_image; /*< handler to image loading and conversion libraries */
}; };
/** /**
......
SOURCES_osd_parser = \
parser.c \
simple.c \
osd_menu.c \
osd_menu.h \
xml.c \
$(NULL)
\ No newline at end of file
/*****************************************************************************
* parser.c : OSD import module
*****************************************************************************
* Copyright (C) 2007 M2X
* $Id: $
*
* Authors: Jean-Paul Saman
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _OSD_MENU_PARSER_H_
#define _OSD_MENU_PARSER_H_
/* OSD Menu structure support routines for internal use by
* OSD Menu configuration file parsers only.
*/
osd_menu_t *osd_MenuNew( osd_menu_t *, const char *, int, int );
osd_button_t *osd_ButtonNew( const char *, int, int );
osd_state_t *osd_StateNew( vlc_object_t *, const char *, const char * );
void osd_MenuFree ( vlc_object_t *, osd_menu_t * );
void osd_ButtonFree( vlc_object_t *, osd_button_t * );
void osd_StatesFree( vlc_object_t *, osd_state_t * );
#endif
\ No newline at end of file
/*****************************************************************************
* parser.c : OSD import module
*****************************************************************************
* Copyright (C) 2007 M2X
* $Id: $
*
* Authors: Jean-Paul Saman
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_config.h>
#include <vlc_keys.h>
#include <vlc_image.h>
#include <vlc_osd.h>
#include <vlc_charset.h>
#include "osd_menu.h"
/***************************************************************************
* Prototypes
***************************************************************************/
int osd_parser_simpleOpen ( vlc_object_t *p_this );
void osd_parser_simpleClose( vlc_object_t *p_this );
int osd_parser_xmlOpen ( vlc_object_t *p_this );
void osd_parser_xmlClose ( vlc_object_t *p_this );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_category( CAT_MISC );
set_subcategory( SUBCAT_OSD_IMPORT );
add_submodule();
set_description( _("OSD configuration importer") );
add_shortcut( "import-osd" );
set_capability( "osd parser" , 0);
set_callbacks( osd_parser_simpleOpen, osd_parser_simpleClose );
add_submodule();
set_description( _("XML OSD configuration importer") );
add_shortcut( "import-osd-xml" );
set_capability( "osd parser" , 0);
set_callbacks( osd_parser_xmlOpen, osd_parser_xmlClose );
vlc_module_end();
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <vlc_keys.h> #include <vlc_keys.h>
#include <vlc_osd.h> #include <vlc_osd.h>
#include "libvlc.h" #include "libvlc.h"
#include <vlc_image.h>
#undef OSD_MENU_DEBUG #undef OSD_MENU_DEBUG
...@@ -77,6 +78,12 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file ) ...@@ -77,6 +78,12 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
return NULL; return NULL;
} }
/* Stuff needed for Parser */
p_osd->p_image = image_HandlerCreate( p_this );
if( !p_osd->p_image )
msg_Err( p_this, "unable to load images" );
p_osd->psz_file = strdup( psz_file );
/* Parse configuration file */ /* Parse configuration file */
if( osd_ConfigLoader( p_this, psz_file, &p_osd ) ) if( osd_ConfigLoader( p_this, psz_file, &p_osd ) )
goto error; goto error;
...@@ -116,6 +123,13 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file ) ...@@ -116,6 +123,13 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
error: error:
msg_Err( p_this, "creating OSD menu object failed" ); msg_Err( p_this, "creating OSD menu object failed" );
if( p_osd->p_image )
image_HandlerDelete( p_osd->p_image );
if( p_osd->psz_file )
free( p_osd->psz_file );
vlc_mutex_unlock( lockval.p_address );
vlc_object_destroy( p_osd ); vlc_object_destroy( p_osd );
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
return NULL; return NULL;
...@@ -141,6 +155,12 @@ void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd ) ...@@ -141,6 +155,12 @@ void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
var_Destroy( p_osd, "osd-menu-update" ); var_Destroy( p_osd, "osd-menu-update" );
osd_ConfigUnload( p_this, &p_osd ); osd_ConfigUnload( p_this, &p_osd );
if( p_osd->p_image )
image_HandlerDelete( p_osd->p_image );
if( p_osd->psz_file )
free( p_osd->psz_file );
vlc_object_detach( p_osd ); vlc_object_detach( p_osd );
vlc_object_destroy( p_osd ); vlc_object_destroy( p_osd );
p_osd = NULL; p_osd = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment