Commit f5aed5af authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Remove CDDAX module

No maintainer, buggy code and no major feature in.
Sorry guys
parent 2146ab41
......@@ -102,6 +102,7 @@ Removed modules:
* WinCE interface
* opie, qte and qte_main
* opengllayer
* cddax. Use cdda instead
Changes between 1.0.2 and 1.0.3:
......
......@@ -189,7 +189,7 @@ case "${host_os}" in
bsdi*)
SYS=bsdi
CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
VLC_ADD_LIBS([dvd dvdcss vcd cdda vcdx cddax],[-ldvd])
VLC_ADD_LIBS([dvd dvdcss vcd cdda vcdx],[-ldvd])
;;
*bsd*)
SYS="${host_os}"
......@@ -246,8 +246,6 @@ case "${host_os}" in
echo " Assuming --enable-theora"
enable_shout="yes"
echo " Assuming --enable-shout"
enable_cddax="yes"
echo " Assuming --enable-cddax"
enable_vcdx="yes"
echo " Assuming --enable-vcdx"
enable_caca="yes"
......@@ -348,7 +346,7 @@ case "${host_os}" in
VLC_ADD_LIBS([libvlccore],[-lws2_32 -lnetapi32 -lwinmm])
VLC_ADD_LDFLAGS([vlc],[-mwindows])
VLC_ADD_LIBS([activex mozilla],[-lgdi32])
VLC_ADD_LIBS([cdda vcdx cddax sdl_image aout_sdl vout_sdl],[-lwinmm])
VLC_ADD_LIBS([cdda vcdx sdl_image aout_sdl vout_sdl],[-lwinmm])
VLC_ADD_LIBS([access_http access_mms access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout access_output_rtmp sap slp oldhttp stream_out_standard stream_out_rtp stream_out_raop vod_rtsp access_realrtsp rtp oldtelnet oldrc netsync gnutls growl_udp flac ts audioscrobbler lua remoteosd zvbi audiobargraph_a],[-lws2_32])
VLC_ADD_LIBS([access_file], [-lshlwapi])
dnl
......@@ -604,7 +602,7 @@ fi
SOCKET_LIBS=""
AC_CHECK_FUNCS(connect,,[
AC_CHECK_LIB(socket,connect,[
VLC_ADD_LIBS([libvlccore cdda cddax],-lsocket)
VLC_ADD_LIBS([libvlccore cdda],-lsocket)
SOCKET_LIBS="-lsocket"
])
])
......@@ -2489,44 +2487,8 @@ then
fi
dnl
dnl VCDX and CDDAX modules
dnl VCDX modules
dnl
AC_ARG_ENABLE(cddax,
AS_HELP_STRING([--enable-cddax],[audio CD plugin with CD Text and CD paranoia
via libcdio (default disabled)]))
AC_ARG_ENABLE(libcddb,
[ --enable-libcddb CDDB support for libcdio audio CD (default enabled)])
if test "${enable_cddax}" = "yes"
then
if test "$have_libcdio" = "yes"
then
AC_DEFINE(HAVE_CDDAX, 1, [Define for the audio CD plugin using libcdio])
VLC_ADD_LIBS([cddax],[$LIBCDIO_LIBS])
VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
VLC_ADD_PLUGIN([cddax])
PKG_CHECK_MODULES(LIBCDIO_PARANOIA, libcdio_paranoia >= 0.72, [
VLC_ADD_LIBS([cddax],[$LIBCDIO_CDDA_LIBS $LIBCDIO_CDDA_LIBS $LIBCDIO_PARANOIA_LIBS])],
AC_MSG_WARN([CD Paranoia support disabled because no libcdio >= 0.72 found]))
else
AC_MSG_WARN([cddax plugin disabled because ok libcdio library not found or disabled])
HAVE_CDDAX=no
fi
if test "$enable_libcddb" != "no"; then
PKG_CHECK_MODULES(LIBCDDB, libcddb >= 0.9.5, [
HAVE_LIBCDDB=yes
AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
VLC_ADD_LIBS([cddax],[$LIBCDDB_LIBS])
VLC_ADD_CFLAGS([cddax],[$LIBCDDB_CFLAGS])
],
[AC_MSG_WARN(new enough libcddb not found. CDDB access disabled)
HAVE_LIBCDDB=no])
fi
fi
AC_ARG_ENABLE(vcdx,
[ --enable-vcdx VCD with navigation via libvcdinfo (default disabled)])
......@@ -2610,8 +2572,8 @@ then
then
VLC_ADD_PLUGIN([vcd])
VLC_ADD_PLUGIN([cdda])
VLC_ADD_LDFLAGS([vcd vcdx cdda cddax],[-Wl,-framework,IOKit,-framework,CoreFoundation])
VLC_ADD_LIBS([vcdx cddax cdda],[-liconv])
VLC_ADD_LDFLAGS([vcd vcdx cdda],[-Wl,-framework,IOKit,-framework,CoreFoundation])
VLC_ADD_LIBS([vcdx cdda],[-liconv])
fi
if test "$enable_libcddb" != "no"; then
......@@ -5167,7 +5129,6 @@ AC_CONFIG_FILES([
modules/access/dshow/Makefile
modules/access/dvb/Makefile
modules/access/mms/Makefile
modules/access/cdda/Makefile
modules/access/rtp/Makefile
modules/access/rtsp/Makefile
modules/access/vcd/Makefile
......
......@@ -69,7 +69,6 @@ $Id$
* canvas: Automatically resize and padd a video
* cc: CC 608/708 subtitles decoder
* cdda: input module to read audio CDs
* cddax: input module to read audio CDs via libcdio
* cdg: CD-G decoder
* chain: Video filtering using a chain of video filter modules
* chorus_flanger: variable delay audio filter
......
......@@ -3,7 +3,7 @@
# obviously does not. Here is a fix for that.
LIBTOOL=@LIBTOOL@ --tag=CC
BASE_SUBDIRS = dvb mms cdda rtp rtsp vcd vcdx screen bd zip
BASE_SUBDIRS = dvb mms rtp rtsp vcd vcdx screen bd zip
EXTRA_SUBDIRS = bda dshow
SUBDIRS = $(BASE_SUBDIRS)
DIST_SUBDIRS = $(BASE_SUBDIRS) $(EXTRA_SUBDIRS)
......
SOURCES_cddax = \
access.c \
access.h \
callback.c \
callback.h \
cdda.c \
cdda.h \
info.c \
info.h \
$(NULL)
/*****************************************************************************
* access.c : CD digital audio input module for vlc using libcdio
*****************************************************************************
* Copyright (C) 2000, 2003, 2004, 2005 the VideoLAN team
* $Id$
*
* Authors: Rocky Bernstein <rocky@panix.com>
* Laurent Aimar <fenrir@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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "callback.h" /* FIXME - reorganize callback.h, cdda.h better */
#include "cdda.h" /* private structures. Also #includes vlc things */
#include "info.h" /* headers for meta info retrieval */
#include "access.h"
#include <vlc_keys.h>
#include <vlc_dialog.h>
#include <cdio/cdio.h>
#include <cdio/logging.h>
#include <cdio/cd_types.h>
/* #ifdef variables below are defined via config.h via #include vlc above. */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* FIXME: This variable is a hack. Would be nice to eliminate. */
access_t *p_cdda_input = NULL;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t CDDARead( access_t *, uint8_t *, size_t );
static block_t *CDDAReadBlocks( access_t * p_access );
static int CDDASeek( access_t * p_access, int64_t i_pos );
static int CDDAControl( access_t *p_access, int i_query,
va_list args );
static int CDDAInit( access_t *p_access, cdda_data_t *p_cdda ) ;
/****************************************************************************
* Private functions
****************************************************************************/
/* process messages that originate from libcdio.
called by CDDAOpen
*/
static void
cdio_log_handler( cdio_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if( p_cdda == NULL )
return;
switch( level )
{
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
if (p_cdda->i_debug & INPUT_DBG_CDIO)
msg_Dbg( p_cdda_input, "%s", message);
break;
case CDIO_LOG_WARN:
msg_Warn( p_cdda_input, "%s", message);
break;
case CDIO_LOG_ERROR:
case CDIO_LOG_ASSERT:
msg_Err( p_cdda_input, "%s", message);
break;
default:
msg_Warn( p_cdda_input, "%s\n%s %d", message,
"the above message had unknown cdio log level",
level);
break;
}
}
#ifdef HAVE_LIBCDDB
/*! This routine is called by libcddb routines on error.
called by CDDAOpen
*/
static void
cddb_log_handler( cddb_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
switch( level )
{
case CDDB_LOG_DEBUG:
case CDDB_LOG_INFO:
if( !(p_cdda->i_debug & INPUT_DBG_CDDB) )
return;
/* Fall through if to warn case */
default:
cdio_log_handler( level, message );
break;
}
}
#endif /*HAVE_LIBCDDB*/
/*! This routine is when vlc is not fully set up (before full initialization)
or is not around (before finalization).
*/
static void
uninit_log_handler( cdio_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = NULL;
if( p_cdda_input )
p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
switch( level )
{
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
if( !p_cdda || !(p_cdda->i_debug & (INPUT_DBG_CDIO|INPUT_DBG_CDDB)) )
return;
/* Fall through if to warn case */
case CDIO_LOG_WARN:
fprintf( stderr, "WARN: %s\n", message );
break;
case CDIO_LOG_ERROR:
fprintf( stderr, "ERROR: %s\n", message );
break;
case CDIO_LOG_ASSERT:
fprintf( stderr, "ASSERT ERROR: %s\n", message );
break;
default:
fprintf( stderr, "UNKNOWN ERROR: %s\n%s %d\n", message,
"The above message had unknown cdio log level",
level );
break;
}
/* gl_default_cdio_log_handler (level, message); */
}
/* Only used in audio control mode. Gets the current LSN from the
CD-ROM drive. */
static int64_t get_audio_position ( access_t *p_access )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
lsn_t i_offset;
#if LIBCDIO_VERSION_NUM >= 73
if( p_cdda->b_audio_ctl )
{
cdio_subchannel_t sub;
CdIo_t *p_cdio = p_cdda->p_cdio;
if( DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub) )
{
if( (sub.audio_status != CDIO_MMC_READ_SUB_ST_PAUSED) &&
(sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY) )
return CDIO_INVALID_LSN;
if( ! p_cdda->b_nav_mode )
{
i_offset = cdio_msf_to_lba( (&sub.abs_addr) );
}
else
{
i_offset = cdio_msf_to_lba( (&sub.rel_addr) );
}
}
else
{
i_offset = p_cdda->i_lsn;
}
}
else
{
i_offset = p_cdda->i_lsn;
}
#else
i_offset = p_cdda->i_lsn;
#endif
return i_offset;
}
/*****************************************************************************
* CDDAReadBlocks: reads a group of blocks from the CD-DA and returns
* an allocated pointer to the data. NULL is returned if no data
* read. It is also possible if we haven't read a RIFF header in which
* case one that we creaded during Open/Initialization is returned.
*****************************************************************************/
static block_t * CDDAReadBlocks( access_t * p_access )
{
block_t *p_block;
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
int i_blocks = p_cdda->i_blocks_per_read;
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called i_lsn: %d i_pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size );
/* Check end of file */
if( p_access->info.b_eof )
return NULL;
if( !p_cdda->b_header )
{
/* Return only the dummy RIFF header we created in Open/Init */
p_block = block_New( p_access, sizeof( WAVEHEADER ) );
memcpy( p_block->p_buffer, &p_cdda->waveheader, sizeof(WAVEHEADER) );
p_cdda->b_header = true;
return p_block;
}
/* Check end of track */
while( p_cdda->i_lsn > cdio_get_track_last_lsn(p_cdda->p_cdio,
p_cdda->i_track) )
{
bool go_on;
if( p_cdda->b_nav_mode )
go_on = p_cdda->i_lsn > p_cdda->last_disc_frame;
else
go_on = p_cdda->i_track >= p_cdda->i_first_track+p_cdda->i_titles-1 ;
if( go_on )
{
dbg_print( (INPUT_DBG_LSN), "EOF");
p_access->info.b_eof = true;
return NULL;
}
p_access->info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_META;
p_access->info.i_title++;
p_cdda->i_track++;
if( p_cdda-> b_nav_mode )
{
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free(psz_title);
}
else
{
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
}
/* Possibly adjust i_blocks so we don't read past the end of a track. */
if( p_cdda->i_lsn + i_blocks >=
cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track+1) )
{
i_blocks = cdio_get_track_lsn( p_cdda->p_cdio, p_cdda->i_track+1 )
- p_cdda->i_lsn;
}
/* Do the actual reading */
p_block = block_New( p_access, i_blocks * CDIO_CD_FRAMESIZE_RAW );
if( !p_block)
{
msg_Err( p_access, "cannot get a new block of size: %i",
i_blocks * CDIO_CD_FRAMESIZE_RAW );
dialog_Fatal( p_access, _("CD reading failed"),
_("VLC could not get a new block of size: %i."),
i_blocks * CDIO_CD_FRAMESIZE_RAW );
return NULL;
}
{
#if LIBCDIO_VERSION_NUM >= 72
driver_return_code_t rc = DRIVER_OP_SUCCESS;
if( p_cdda->e_paranoia && p_cdda->paranoia )
{
int i;
for( i = 0; i < i_blocks; i++ )
{
int16_t *p_readbuf = cdio_paranoia_read( p_cdda->paranoia, NULL );
char *psz_err = cdio_cddap_errors( p_cdda->paranoia_cd );
char *psz_mes = cdio_cddap_messages( p_cdda->paranoia_cd );
if( psz_mes || psz_err )
msg_Err( p_access, "%s%s", psz_mes ? psz_mes: "",
psz_err ? psz_err: "" );
free( psz_err );
free( psz_mes );
if( !p_readbuf )
{
msg_Err( p_access, "paranoia read error on frame %i",
p_cdda->i_lsn+i );
}
else
memcpy( p_block->p_buffer + i * CDIO_CD_FRAMESIZE_RAW,
p_readbuf, CDIO_CD_FRAMESIZE_RAW );
}
}
else
rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks );
#else
#define DRIVER_OP_SUCCESS 0
int rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks);
#endif
if( rc != DRIVER_OP_SUCCESS )
{
msg_Err( p_access, "could not read %d sectors starting from %lu",
i_blocks, (long unsigned int) p_cdda->i_lsn );
block_Release( p_block );
/* If we had problems above, assume the problem is with
the first sector of the read and set to skip it. In
the future libcdio may have cdparanoia support.
*/
p_cdda->i_lsn++;
p_access->info.i_pos += CDIO_CD_FRAMESIZE_RAW;
return NULL;
}
}
p_cdda->i_lsn += i_blocks;
p_access->info.i_pos += i_blocks * CDIO_CD_FRAMESIZE_RAW;
return p_block;
}
/*****************************************************************************
* CDDARead: Handler for audio control reads the CD-DA.
*****************************************************************************/
static ssize_t
CDDARead( access_t * p_access, uint8_t *p_buffer, size_t i_len )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called lsn: %d pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size);
/* Check end of file */
if( p_access->info.b_eof )
return 0;
{
lsn_t i_lsn = get_audio_position(p_access);
if( CDIO_INVALID_LSN == i_lsn )
{
dbg_print( (INPUT_DBG_LSN), "invalid lsn" );
memset( p_buffer, 0, i_len );
return i_len;
}
p_cdda->i_lsn = i_lsn;
p_access->info.i_pos = p_cdda->i_lsn * CDIO_CD_FRAMESIZE_RAW;
}
dbg_print( (INPUT_DBG_LSN), "updated lsn: %d", p_cdda->i_lsn );
/* Check end of track */
while( p_cdda->i_lsn > cdio_get_track_last_lsn( p_cdda->p_cdio,
p_cdda->i_track) )
{
if( p_cdda->i_track >= p_cdda->i_first_track + p_cdda->i_titles - 1 )
{
dbg_print( (INPUT_DBG_LSN), "EOF");
p_access->info.b_eof = true;
return 0;
}
p_access->info.i_update |= INPUT_UPDATE_TITLE;
p_access->info.i_title++;
p_cdda->i_track++;
if( p_cdda-> b_nav_mode )
{
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free( psz_title );
}
else
{
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
}
memset( p_buffer, 0, i_len );
return i_len;
}
/*! Pause CD playing via audio control */
static bool cdda_audio_pause( CdIo_t *p_cdio )
{
bool b_ok = true;
#if LIBCDIO_VERSION_NUM >= 73
cdio_subchannel_t sub;
if( DRIVER_OP_SUCCESS == cdio_audio_read_subchannel( p_cdio, &sub ) )
{
if( sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY )
{
b_ok = DRIVER_OP_SUCCESS == cdio_audio_pause(p_cdio);
}
}
else
b_ok = false;
#endif
return b_ok;
}
#if LIBCDIO_VERSION_NUM >= 73
/*! play CD using audio controls */
static driver_return_code_t
cdda_audio_play( CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn )
{
msf_t start_msf;
msf_t last_msf;
cdio_lsn_to_msf( start_lsn, &start_msf );
cdio_lsn_to_msf( end_lsn, &last_msf );
cdda_audio_pause( p_cdio );
return cdio_audio_play_msf( p_cdio, &start_msf, &last_msf );
}
#endif
/****************************************************************************
* CDDASeek - change position for subsequent reads. For example, this
* can happen if the user moves a position slider bar in a GUI.
****************************************************************************/
static int CDDASeek( access_t * p_access, int64_t i_pos )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_SEEK),
"lsn %lu, offset: %lld",
(long unsigned int) p_cdda->i_lsn, i_pos );
p_cdda->i_lsn = (i_pos / CDIO_CD_FRAMESIZE_RAW);
#if LIBCDIO_VERSION_NUM >= 72
if( p_cdda->e_paranoia && p_cdda->paranoia )
cdio_paranoia_seek( p_cdda->paranoia, p_cdda->i_lsn, SEEK_SET );
#endif
#if LIBCDIO_VERSION_NUM >= 73
if( p_cdda->b_audio_ctl )
{
track_t i_track = cdio_get_track( p_cdda->p_cdio, p_cdda->i_lsn );
lsn_t i_last_lsn;
if( p_cdda->b_nav_mode )
i_last_lsn = p_cdda->last_disc_frame;
else
i_last_lsn = cdio_get_track_last_lsn( p_cdda->p_cdio, i_track );
cdda_audio_play( p_cdda->p_cdio, p_cdda->i_lsn, i_last_lsn );
}
#endif
if( ! p_cdda->b_nav_mode )
p_cdda->i_lsn += cdio_get_track_lsn( p_cdda->p_cdio, p_cdda->i_track );
/* Seeked backwards and we are doing disc mode. */
if( p_cdda->b_nav_mode && p_access->info.i_pos > i_pos )
{
track_t i_track;
char *psz_title;
for( i_track = p_cdda->i_track; i_track > 1 &&
p_cdda->i_lsn < cdio_get_track_lsn( p_cdda->p_cdio, i_track );
i_track--, p_access->info.i_title-- )
;
p_cdda->i_track = i_track;
p_access->info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_META ;
psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME,
psz_title );
free( psz_title );
}
p_access->info.i_pos = i_pos;
p_access->info.b_eof = false;
return VLC_SUCCESS;
}
/*
Set up internal state so that we play a given track.
If we are using audio-ctl mode we also activate CD-ROM
to play.
*/
static bool cdda_play_track( access_t *p_access, track_t i_track )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;