Commit fd05dc69 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/vcdx/*: Brand new VCD input module using libcdio, libvcd and libvcdinfo. Courtesy of Rocky Bernstein.
* modules/access/cddax.c: Brand new CDDA input module using libcdio. Courtesy of Rocky Bernstein.
* modules/LIST: update.
parent 0f814562
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.83 2003/10/04 11:59:59 gbazin Exp $
dnl $Id: configure.ac,v 1.84 2003/10/04 18:55:12 gbazin Exp $
AC_INIT(vlc,0.6.3-cvs)
......@@ -79,7 +79,7 @@ case "${target_os}" in
bsdi*)
SYS=bsdi
CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
AX_ADD_LDFLAGS([dvd dvdcss vcd cdda],[-ldvd])
AX_ADD_LDFLAGS([dvd dvdcss vcd cdda vcdx cddax],[-ldvd])
;;
*bsd*)
SYS="${target_os}"
......@@ -1439,6 +1439,29 @@ then
fi
fi
dnl
dnl VCDX and CDX modules
dnl
AC_ARG_ENABLE(vcdx,
[ --enable-vcdx VCD support with Navigation for Linux and Win32 (default enabled)])
if test "${enable_vcdx}" != "no"
then
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.63,
enable_cdda="no"
AX_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
AX_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
AX_ADD_PLUGINS([cddax]),
[AC_MSG_WARN(libcdio library not found)])
PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.18-cdio,
enable_vcd="no"
AX_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
AX_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
AX_ADD_PLUGINS([vcdx]),
[AC_MSG_WARN(vcdinfo library not found)])
fi
dnl
dnl Satellite input module
dnl
......@@ -3360,6 +3383,7 @@ AC_OUTPUT([
modules/access/satellite/Makefile
modules/access/v4l/Makefile
modules/access/vcd/Makefile
modules/access/vcdx/Makefile
modules/access_output/Makefile
modules/audio_filter/Makefile
modules/audio_filter/channel_mixer/Makefile
......
List of vlc plugins (221)
$Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
$Id: LIST,v 1.13 2003/10/04 18:55:13 gbazin Exp $
* a52: A/52 basic parser
* a52: A/52 basic parser/packetizer
* a52old: Old A/52 decoder
* a52sys: A/52 decapsulation demuxer.
* a52tofloat32: A/52 audio converter & decoder plugin, using liba52
......@@ -63,6 +61,8 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* cdda: input module to read audio CDs
* cddax: input module to read audio CDs vi libcdio
* cinepak: Cinepack video decoder
* clone: Clone video filter
......@@ -85,15 +85,9 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* distort: miscellaneous image effects filter.
* downmix3dn: 3D Now! accelerated version of downmix.
* downmix: downmix module, used by the AC3 decoder.
* downmixsse: SSE accelerated version of downmix.
* dshow: DirectShow access plugin for encoding cards under Windows
* dts: DTS basic parser
* dts: DTS basic parser/packetizer
* dtstospdif: Audio converter that encapsulates DTS into S/PDIF
......@@ -196,22 +190,6 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* id3tag: ID3 tag parser/skipper using libid3tag
* idctaltivec: AltiVec accelerated version of idct.
* idctclassic: another version of idct.
* idct: inverse DCT module, used by mpeg_video_old
* idctmmxext: MMX EXT accelerated version of idct.
* idctmmx: MMX accelerated version of idct.
* imdct3dn: 3D Now! Accelerated A/52 DCT
* imdct: IMDCT module for the A/52 decoder
* imdctsse: SSE accelerated A/52 DCT
* invert: inverse video filter.
* ipv4: IPv4 network abstraction layer
......@@ -254,26 +232,14 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* mkv: Matroska demuxer
* motion3dnow: 3D Now! accelerated version of motion.
* motionaltivec: AltiVec accelerated version of motion.
* motionblur: Motion blur filter
* motionmmxext: MMX EXT accelerated version of motion.
* motionmmx: MMX accelerated version of motion.
* motion: motion compensation module for mpeg_video_old
* mp4: MP4 file input module
* mpeg_audio: MPEG audio parser and packetizer
* mpeg_audio: MPEG audio parser/packetizer
* mpeg_system: helper module for TS, PS and PES management
* mpeg_video_old: MPEG and MPEG2 video decoder.
* mpga: MPEG-I/II Audio demuxer
* mpgatofixed32: MPEG-1 & 2 audio layer I,II,III audio decoder using MAD
......@@ -300,20 +266,14 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* oss: audio output module using the OSS /dev/dsp interface.
* packetizer_a52: A/52 audio packetizer
* packetizer_copy: Simple copy packetizer
* packetizer_mpeg4audio: MPEG4 audio packetizer
* packetizer_mpeg4video: MPEG4 video packetizer
* packetizer_mpegaudio: MPEG audio packetizer
* packetizer_mpegvideo: MPEG video packetizer
* packetizer_vorbis: Vorbis packetizer
* pda: interface for iPaq using the Gtk2+ widget set.
* postprocessing_c: Video Postprocessing module
......@@ -378,7 +338,7 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* stream_out_transcode: audio & video transcoder using ffmpeg
* subsdec: Another SPU decoder
* subsdec: Another SPU decoder for text subtitles
* svgalib: SGVAlib output plugin
......@@ -392,7 +352,7 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* test4: Stress test module
* theora: a theora video decoder using the libtheora library.
* theora: a theora video decoder/packetizer using the libtheora library.
* transform: filter for horizontal and vertical image flips and
90 rotations.
......@@ -419,9 +379,11 @@ $Id: LIST,v 1.12 2003/09/18 16:46:02 lool Exp $
* vcd: input module for accessing Video CDs.
* vcdx: input module for accessing Video CDs with navigation & stills
* visual: visualisation system
* vorbis: a vorbis audio decoder using the libvorbis library.
* vorbis: a vorbis audio decoder/packetizer using the libvorbis library.
* vout_directx: video output module using the DirectX API.
......
......@@ -10,3 +10,7 @@ SOURCES_cdda = \
vcd/cdrom.h \
vcd/cdrom_internals.h \
$(NULL)
SOURCES_cddax = \
cddax.c \
vcdx/cdrom.c \
vcdx/cdrom.h
This diff is collapsed.
.deps
.dirstamp
Makefile
Makefile.am
Makefile.in
*.dll
*.dylib
*.sl
*.so
SOURCES_vcdx = \
intf.c \
intf.h \
vcd.c \
vcd.h \
vcdplayer.h \
vcdplayer.c \
cdrom.c \
cdrom.h \
demux.c \
access.c \
$(NULL)
This diff is collapsed.
/****************************************************************************
* cdrom.c: cdrom tools
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.c,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* 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, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <vlc/vlc.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <string.h>
#include <errno.h>
#include "cdrom.h"
/*****************************************************************************
* Local Prototypes
*****************************************************************************/
static void cd_log_handler (cdio_log_level_t level, const char message[]);
/*****************************************************************************
* ioctl_Open: Opens a VCD device or file and returns an opaque handle
*****************************************************************************/
cddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
{
cddev_t *p_cddev;
if( !psz_dev ) return NULL;
/*
* Initialize structure with default values
*/
p_cddev = (cddev_t *)malloc( sizeof(cddev_t) );
if( p_cddev == NULL )
{
msg_Err( p_this, "out of memory" );
return NULL;
}
/* Set where to log errors messages from libcdio. */
cdio_log_set_handler ( cd_log_handler );
p_cddev->cdio = cdio_open(psz_dev, DRIVER_UNKNOWN);
if( p_cddev->cdio == NULL )
{
free( p_cddev );
p_cddev = NULL;
}
return p_cddev;
}
/*****************************************************************************
* ioctl_Close: Closes an already opened VCD device or file.
*****************************************************************************/
void ioctl_Close( cddev_t *p_cddev )
{
cdio_destroy(p_cddev->cdio);
}
/*****************************************************************************
* ioctl_GetTracksMap: Read the Table of Contents, fill in the pp_sectors map
* if pp_sectors is not null and return the number of
* tracks available.
* We allocate and fill one more track than are on
* the CD. The last "track" is leadout track information.
* This makes finding the end of the last track uniform
* how it is done for other tracks.
*****************************************************************************/
track_t ioctl_GetTracksMap( vlc_object_t *p_this, const CdIo *cdio,
lsn_t **pp_sectors )
{
track_t i_tracks = cdio_get_num_tracks(cdio);
track_t first_track = cdio_get_first_track_num(cdio);
track_t i;
*pp_sectors = malloc( (i_tracks + 1) * sizeof(lsn_t) );
if( *pp_sectors == NULL )
{
msg_Err( p_this, "out of memory" );
return 0;
}
/* Fill the p_sectors structure with the track/sector matches.
Note cdio_get_track_lsn when given num_tracks + 1 will return
the leadout LSN.
*/
for( i = 0 ; i <= i_tracks ; i++ )
{
(*pp_sectors)[ i ] = cdio_get_track_lsn(cdio, first_track+i);
}
return i_tracks;
}
/****************************************************************************
* ioctl_ReadSector: Read a sector (2324 bytes)
****************************************************************************/
int ioctl_ReadSector( vlc_object_t *p_this, const cddev_t *p_cddev,
int i_sector, byte_t * p_buffer )
{
typedef struct {
uint8_t subheader [8];
uint8_t data [M2F2_SECTOR_SIZE];
} vcdsector_t;
vcdsector_t vcd_sector;
if (cdio_read_mode2_sector(p_cddev->cdio, &vcd_sector, i_sector, true)
!= 0)
{
// msg_Err( p_this, "Could not read sector %d", i_sector );
return -1;
}
memcpy (p_buffer, vcd_sector.data, M2F2_SECTOR_SIZE);
return( 0 );
}
/****************************************************************************
* Private functions
****************************************************************************/
/* For now we're going to just discard error messages from libcdio... */
static void
cd_log_handler (cdio_log_level_t level, const char message[])
{
return;
}
/****************************************************************************
* cdrom.h: cdrom tools header
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.h,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
*
* 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, USA.
*****************************************************************************/
#include <cdio/cdio.h>
#include <cdio/logging.h>
/*****************************************************************************
* The cddev structure
*****************************************************************************/
typedef struct cddev_s
{
int *p_sectors; /* tracks layout on the vcd */
CdIo *cdio; /* libcdio uses this to read */
} cddev_t;
/*****************************************************************************
* Prototypes
*****************************************************************************/
cddev_t *ioctl_Open ( vlc_object_t *, const char * );
void ioctl_Close ( cddev_t * );
track_t ioctl_GetTracksMap ( vlc_object_t *, const CdIo *, lsn_t ** );
int ioctl_ReadSector ( vlc_object_t *, const cddev_t *,
int, byte_t * );
/*****************************************************************************
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: demux.c,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Author: Stphane 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <vlc/intf.h>
#include "../../demux/mpeg/system.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include "vcd.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;
};
/*****************************************************************************
* InitVCD: initializes structures
*****************************************************************************/
int E_(InitVCD) ( 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_access_data;
demux_sys_t * p_demux;
printf("++++ InitVCD 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_ENOMEM;
}
p_input->p_private = (void*)&p_demux->mpeg;
p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
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_rewind = NULL;
p_vcd->p_intf = NULL;
p_vcd->i_still_time = 0;
return VLC_SUCCESS;
}
/*****************************************************************************
* EndVCD: frees unused data
*****************************************************************************/
void E_(EndVCD) ( 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;
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 );
intf_Destroy( p_intf );
}
p_vcd->p_intf = NULL;
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 */
input_SetStatus( p_input, INPUT_STATUS_PAUSE );
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;
}
/*****************************************************************************
* intf.c: Video CD interface to handle user interaction and still time
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Current modification and breakage for VCD by rocky.
*
* 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, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <unistd.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "stream_control.h"
#include "input_ext-intf.h"
#include "input_ext-dec.h"
#include "vcd.h"
/*****************************************************************************
* intf_sys_t: description and status of interface
*****************************************************************************/
struct intf_sys_t
{
input_thread_t * p_input;
vcd_data_t * p_vcd;
vlc_bool_t b_still;
vlc_bool_t b_inf_still;
mtime_t m_still_time;
#if FINISHED
vcdplay_ctrl_t control;
#else
int control;
#endif
vlc_bool_t b_click, b_move, b_key_pressed;
};
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static int InitThread ( intf_thread_t *p_intf );
static int MouseEvent ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int KeyEvent ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
/* Exported functions */
static void RunIntf ( intf_thread_t *p_intf );
/*****************************************************************************
* OpenIntf: initialize dummy interface
*****************************************************************************/
int E_(VCDOpenIntf) ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
printf("+++++Called VCDOpenIntf\n");
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
{
return( 1 );
};
p_intf->pf_run = RunIntf;
p_intf->p_sys->m_still_time = 0;
p_intf->p_sys->b_inf_still = 0;
p_intf->p_sys->b_still = 0;
return( 0 );
}
/*****************************************************************************
* CloseIntf: destroy dummy interface
*****************************************************************************/
void E_(VCDCloseIntf) ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
/* Destroy structure */
free( p_intf->p_sys );
}
/*****************************************************************************
* RunIntf: main loop
*****************************************************************************/
static void RunIntf( intf_thread_t *p_intf )
{
vlc_object_t * p_vout = NULL;
printf("+++++Called RunIntf\n");
if( InitThread( p_intf ) < 0 )
{
msg_Err( p_intf, "can't initialize intf" );
return;
}
msg_Dbg( p_intf, "intf initialized" );
/* Main loop */
while( !p_intf->b_die )
{
vlc_mutex_lock( &p_intf->change_lock );
/*
* keyboard event
*/
if( p_vout && p_intf->p_sys->b_key_pressed )
{
p_intf->p_sys->b_key_pressed = VLC_FALSE;
printf("++++key pressed...\n");
}
vlc_mutex_unlock( &p_intf->change_lock );
if( p_vout == NULL )
{
p_vout = vlc_object_find( p_intf->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
{
var_AddCallback( p_vout, "mouse-moved", MouseEvent, p_intf );
var_AddCallback( p_vout, "mouse-clicked", MouseEvent, p_intf );
var_AddCallback( p_vout, "key-pressed", KeyEvent, p_intf );
}
}
/* Wait a bit */
msleep( INTF_IDLE_SLEEP );
}
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
* InitThread:
*****************************************************************************/
static int InitThread( intf_thread_t * p_intf )
{
/* We might need some locking here */
if( !p_intf->b_die )
{
input_thread_t * p_input;
vcd_data_t * p_vcd;
p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_PARENT );
/* Maybe the input just died */
if( p_input == NULL )
{
return VLC_EGENERIC;
}
p_vcd = (vcd_data_t*)p_input->p_access_data;
p_vcd->p_intf = p_intf;
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->p_input = p_input;
p_intf->p_sys->p_vcd = p_vcd;
p_intf->p_sys->b_move = VLC_FALSE;
p_intf->p_sys->b_click = VLC_FALSE;
p_intf->p_sys->b_key_pressed = VLC_FALSE;
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
else
{
return VLC_EGENERIC;
}
}
/*****************************************************************************
* MouseEvent: callback for mouse events
*****************************************************************************/
static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *)p_data;
vlc_mutex_lock( &p_intf->change_lock );
if( psz_var[6] == 'c' ) /* "mouse-clicked" */
{
p_intf->p_sys->b_click = VLC_TRUE;
}
else if( psz_var[6] == 'm' ) /* "mouse-moved" */
{
p_intf->p_sys->b_move = VLC_TRUE;
}
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
/*****************************************************************************
* KeyEvent: callback for keyboard events
*****************************************************************************/
static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *)p_data;
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->b_key_pressed = VLC_TRUE;
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
/*****************************************************************************
* dvdIntfStillTime: function provided to demux plugin to request
* still images
*****************************************************************************/
int vcdIntfStillTime( intf_thread_t *p_intf, int i_sec )
{
vlc_mutex_lock( &p_intf->change_lock );
if( i_sec == 0xff )
{
p_intf->p_sys->b_still = 1;
p_intf->p_sys->b_inf_still = 1;
}
else if( i_sec > 0 )
{
p_intf->p_sys->b_still = 1;
p_intf->p_sys->m_still_time = 1000000 * i_sec;
}
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
/*****************************************************************************
* vcdIntfStillTime: function provided to reset still image
*****************************************************************************/
int vcdIntfResetStillTime( intf_thread_t *p_intf )
{
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->m_still_time = 0;
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
vlc_mutex_unlock( &p_intf->change_lock );
return VLC_SUCCESS;
}
/*****************************************************************************
* intf.h: send info to intf.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf.h,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
int vcdIntfStillTime( struct intf_thread_t *, int );
int vcdIntfResetStillTime( intf_thread_t *p_intf );
This diff is collapsed.
/*****************************************************************************
* vcd.h : VCD input module for vlc
* using libcdio, libvcd and libvcdinfo
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vcd.h,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
*
* 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, USA.
*****************************************************************************/
#include <libvcd/info.h>
/*****************************************************************************
* dvd_data_t: structure for communication between dvdplay access, demux
* and intf.
*****************************************************************************/
/*****************************************************************************
* vcd_data_t: structure for communication between access and intf.
*****************************************************************************/
typedef struct
{
#if FINISHED
vcdplay_ptr vmg;
#endif
intf_thread_t * p_intf;
#if DEMUX_FINISHED
int i_audio_nb;
int i_spu_nb;
#endif
int i_still_time;
vlc_bool_t b_end_of_cell;
#if FINISHED
vcdplay_event_t event;
vcdplay_ctrl_t control;
vcdplay_highlight_t hli;
#endif
} vcd_data_t;
int VCDSetArea ( input_thread_t *, input_area_t * );
void VCDSeek ( input_thread_t *, off_t );
int VCDPlay ( input_thread_t *, vcdinfo_itemid_t );
This diff is collapsed.
/*****************************************************************************
* Copyright (C) 2003 Rocky Bernstein (for VideoLAN)
* $Id: vcdplayer.h,v 1.1 2003/10/04 18:55:13 gbazin Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
*
* 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, USA.
*****************************************************************************/
/* VCD Player header. More or less media-player independent */
#ifndef _VCDPLAYER_H_
#define _VCDPLAYER_H_
#include <libvcd/info.h>
#define INPUT_DBG_MRL 1
#define INPUT_DBG_EXT 2 /* Calls from external routines */
#define INPUT_DBG_CALL 4 /* all calls */
#define INPUT_DBG_LSN 8 /* LSN changes */
#define INPUT_DBG_PBC 16 /* Playback control */
#define INPUT_DBG_CDIO 32 /* Debugging from CDIO */
#define INPUT_DBG_SEEK 64 /* Seeks to set location */
#define INPUT_DBG_STILL 128 /* Still-frame */
#define INPUT_DBG_VCDINFO 256 /* Debugging from VCDINFO */
#define INPUT_DEBUG 1
#if INPUT_DEBUG
#define dbg_print(mask, s, args...) \
if (p_vcd->i_debug & mask) \
msg_Dbg(p_input, "%s: "s, __func__ , ##args)
#else
#define dbg_print(mask, s, args...)
#endif
#define LOG_ERR(args...) msg_Err( p_input, args )
/* vcdplayer_read return status */
typedef enum {
READ_BLOCK,
READ_STILL_FRAME,
READ_ERROR,
READ_END,
} vcdplayer_read_status_t;
/*****************************************************************************
* thread_vcd_data_t: VCD information
*****************************************************************************/
typedef struct thread_vcd_data_s
{
vcdinfo_obj_t *vcd; /* CD device descriptor */
int in_still; /* 0 if not in still,
-2 if in infinite loop
-5 if a still but haven't
read wait time yet
>0 number of seconds yet to
wait */
unsigned int num_tracks; /* Nb of tracks (titles) */
unsigned int num_segments; /* Nb of segments */
unsigned int num_entries; /* Nb of entries */
unsigned int num_lids; /* Nb of List IDs */
vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY
if none */
int cur_lid; /* LID that play item is in. Implies
PBC is on. VCDPLAYER_BAD_ENTRY if
not none or not in PBC */
PsdListDescriptor pxd; /* If PBC is on, the relevant
PSD/PLD */
int pdi; /* current pld index of pxd. -1 if
no index*/
vcdinfo_itemid_t loop_item; /* Where do we loop back to?
Meaningful only in a selection
list */
int loop_count; /* # of times play-item has been
played. Meaningful only in a
selection list. */
track_t cur_track; /* Current track number */
lsn_t cur_lsn; /* Current logical sector number */
lsn_t end_lsn; /* LSN of end of current
entry/segment/track. */
lsn_t origin_lsn; /* LSN of start of seek/slider */
lsn_t * p_sectors; /* Track sectors */
lsn_t * p_entries; /* Entry points */
lsn_t * p_segments; /* Segments */
bool b_valid_ep; /* Valid entry points flag */
vlc_bool_t b_end_of_track; /* If the end of track was reached */
int i_debug; /* Debugging mask */
} thread_vcd_data_t;
bool vcdplayer_inc_play_item( input_thread_t *p_input );
bool vcdplayer_pbc_is_on(const thread_vcd_data_t *p_this);
vcdplayer_read_status_t vcdplayer_pbc_nav ( input_thread_t * p_input );
vcdplayer_read_status_t vcdplayer_non_pbc_nav ( input_thread_t * p_input );
lid_t vcdplayer_selection2lid ( input_thread_t *p_input, int entry_num ) ;
#endif /* _VCDPLAYER_H_ */
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
* indent-tabs-mode: nil
* End:
*/
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