Commit 6f0aba82 authored by JP Dinger's avatar JP Dinger

Clean up vcdx a bit. Or a lot. It compiles, but I can't test. Since apparently...

Clean up vcdx a bit. Or a lot. It compiles, but I can't test. Since apparently nobody uses this anyway it shouldn't be a big problem.
parent 4f050947
SOURCES_vcdx = \
access.h \
access.c \
intf.c \
intf.h \
vcd.c \
vcd.h \
vcdplayer.h \
......
......@@ -48,10 +48,7 @@
#include <libvcd/logging.h>
#include "vcd.h"
#include "info.h"
#include "intf.h"
extern void VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
const vcdinfo_itemid_t *p_itemid );
#include "access.h"
/*****************************************************************************
* Local prototypes
......@@ -1039,12 +1036,12 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
*/
case ACCESS_GET_META:
{
vlc_meta_t **pp_meta = (vlc_meta_t**)va_arg( args, vlc_meta_t** );
dbg_print( INPUT_DBG_EVENT, "get meta info" );
#if 0
if( p_vcdplayer->p_meta )
{
vlc_meta_t **pp_meta = (vlc_meta_t**)va_arg(args,vlc_meta_t**);
*pp_meta = vlc_meta_Duplicate( p_vcdplayer->p_meta );
dbg_print( INPUT_DBG_META, "%s", "Meta copied" );
}
......
/*****************************************************************************
* intf.h: send info to intf.
* access.h : VCD access.c routine headers
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Author: Stéphane Borel <stef@via.ecp.fr>
* Copyright (C) 2004 the VideoLAN team
*
* 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
......@@ -16,37 +13,19 @@
* 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.
* 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 VCD_ACCESS_H
#define VCD_ACCESS_H
#include <vlc_common.h>
#include <vlc_input.h>
#include "vcdplayer.h"
void VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
const vcdinfo_itemid_t *p_itemid );
/*****************************************************************************
* intf_sys_t: description and status of interface
*****************************************************************************/
struct intf_sys_t
{
input_thread_t *p_input;
vcdplayer_t *p_vcdplayer;
int VCDOpen ( vlc_object_t * );
void VCDClose ( vlc_object_t * );
bool b_still; /* True if we are in a still frame */
bool b_infinite_still; /* True if still wait time is infinite */
mtime_t m_still_time; /* Time in microseconds remaining
to wait in still frame.
*/
#ifdef FINISHED
vcdplay_ctrl_t control;
#else
int control;
#endif
bool b_click, b_move, b_key_pressed;
vlc_mutex_t lock;
};
int vcdIntfStillTime( struct intf_thread_t * p_intf, uint8_t wait_time);
int vcdIntfResetStillTime( intf_thread_t *p_intf );
#endif /* VCD_ACCESS_H */
/*****************************************************************************
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 the VideoLAN team
* $Id$
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* 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
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stddef.h>
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_access.h>
#include <vlc_interface.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include "vcd.h"
#include "vcdplayer.h"
#include "intf.h"
/* how many packets vcdx_Demux will read in each loop */
/* #define vcdplay_READ_ONCE 64 */
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Demux ( input_thread_t * );
/*****************************************************************************
* Private structure
*****************************************************************************/
struct demux_sys_t
{
vcd_data_t * p_vcd;
module_t * p_module;
mpeg_demux_t mpeg;
};
/*****************************************************************************
* VCDInit: initializes structures
*****************************************************************************/
int VCDInit ( vlc_object_t *p_this )
{
input_thread_t *p_input = (input_thread_t *)p_this;
vcd_data_t * p_vcd = (vcd_data_t *)p_input->p_sys;
demux_sys_t * p_demux;
printf("++++ VCDInit CALLED\n");
if( p_input->stream.i_method != INPUT_METHOD_VCD )
{
return VLC_EGENERIC;
}
p_demux = p_input->p_demux_data = malloc( sizeof(demux_sys_t ) );
if( p_demux == NULL )
{
return VLC_ENOMOD;
}
p_input->p_private = (void*)&p_demux->mpeg;
p_demux->p_module = module_need( p_input, "mpeg-system", NULL, false );
if( p_demux->p_module == NULL )
{
free( p_input->p_demux_data );
return VLC_ENOMOD;
}
p_input->p_demux_data->p_vcd = p_vcd;
p_input->pf_demux = Demux;
p_input->pf_demux_control = demux_vaControlDefault;
p_input->pf_rewind = NULL;
p_vcd->p_intf = NULL;
p_vcd->i_still_time = 0;
return VLC_SUCCESS;
}
/*****************************************************************************
* VCDEnd: frees unused data
*****************************************************************************/
void VCDEnd ( vlc_object_t *p_this )
{
input_thread_t *p_input = (input_thread_t *)p_this;
vcd_data_t * p_vcd = p_input->p_demux_data->p_vcd;
#if FIXED
intf_thread_t * p_intf = NULL;
p_intf = vlc_object_find( p_input, VLC_OBJECT_INTF, FIND_CHILD );
if( p_intf != NULL )
{
intf_StopThread( p_intf );
vlc_object_detach( p_intf );
vlc_object_release( p_intf );
vlc_object_release( p_intf );
}
p_vcd->p_intf = NULL;
#endif
module_unneed( p_input, p_input->p_demux_data->p_module );
free( p_input->p_demux_data );
}
/*****************************************************************************
* Demux
*****************************************************************************/
static int Demux( input_thread_t * p_input )
{
vcd_data_t * p_vcd;
data_packet_t * p_data;
ssize_t i_result;
ptrdiff_t i_remains;
int i_data_nb = 0;
p_vcd = p_input->p_demux_data->p_vcd;
/* Read headers to compute payload length */
do
{
i_result = p_input->p_demux_data->mpeg.pf_read_ps( p_input, &p_data );
if( i_result <= 0 )
{
return i_result;
}
i_remains = p_input->p_last_data - p_input->p_current_data;
p_input->p_demux_data->mpeg.pf_demux_ps( p_input, p_data );
++i_data_nb;
}
while( i_remains );
// if( p_vcd->b_still && p_vcd->b_end_of_cell && p_vcd->p_intf != NULL )
if( p_vcd->i_still_time && p_vcd->b_end_of_cell && p_vcd->p_intf != NULL )
{
pgrm_descriptor_t * p_pgrm;
/* when we receive still_time flag, we have to pause immediately */
var_SetInteger( p_input, "state", PAUSE_S );
vcdIntfStillTime( p_vcd->p_intf, p_vcd->i_still_time );
p_vcd->i_still_time = 0;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_pgrm = p_input->stream.p_selected_program;
p_pgrm->i_synchro_state = SYNCHRO_REINIT;
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_ClockManageControl( p_input, p_pgrm, 0 );
}
return i_data_nb;
}
This diff is collapsed.
......@@ -16,9 +16,9 @@
* 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.
* 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.
*****************************************************************************/
/*****************************************************************************
......@@ -37,23 +37,8 @@
#include <vlc_plugin.h>
#include <vlc_charset.h>
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
int VCDOpen ( vlc_object_t * );
void VCDClose ( vlc_object_t * );
int VCDOpenIntf ( vlc_object_t * );
void VCDCloseIntf ( vlc_object_t * );
int VCDInit ( vlc_object_t * );
void VCDEnd ( vlc_object_t * );
int DebugCallback ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val,
void *p_data );
int BlocksPerReadCallback ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val,
void *p_data );
#include "vcd.h"
#include "access.h"
/*****************************************************************************
* Option help text
......
This diff is collapsed.
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