Commit 51e76e12 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dvdread, modules/access/dvdread.c:

  + major rewrite of the dvdread module.
  + dvdread is now an access_demux module.
parent 9eb3e68f
......@@ -1211,71 +1211,70 @@ if test "${enable_livedotcom}" = "yes"; then
fi
fi
dnl
dnl dnl
dnl dnl dvdread module: check for libdvdread
dnl dnl
dnl AC_ARG_ENABLE(dvdread,
dnl [ --enable-dvdread dvdread input module (default disabled)])
dnl if test "${enable_dvdread}" != "no"
dnl then
dnl AC_ARG_WITH(dvdread,
dnl [ --with-dvdread=PATH libdvdread headers and libraries])
dnl AC_ARG_WITH(dvdread-tree,
dnl [ --with-dvdread-tree=PATH libdvdread tree for static linking])
dnl if test -z "${with_dvdread}"
dnl then
dnl if test -z "${with_dvdread_tree}"
dnl then
dnl AC_CHECK_HEADERS(dvdread/dvd_reader.h,
dnl [ AX_ADD_PLUGINS([dvdread])
dnl AX_ADD_LDFLAGS([dvdread],[-ldvdread ${LDFLAGS_dvdcss}])
dnl ],[
dnl if test -n "${enable_dvdread}"
dnl then
dnl AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
dnl AC_MSG_ERROR([cannot find libdvdread headers])
dnl fi
dnl ])
dnl else
dnl AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
dnl real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
dnl if test -z "${real_dvdread_tree}"
dnl then
dnl dnl The given directory can't be found
dnl AC_MSG_RESULT(no)
dnl AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
dnl fi
dnl if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
dnl then
dnl dnl Use a custom libdvdread
dnl AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
dnl AX_ADD_BUILTINS([dvdread])
dnl AX_ADD_LDFLAGS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LDFLAGS_dvdcss}])
dnl AX_ADD_CPPFLAGS([dvdread],[-I${real_dvdread_tree}])
dnl else
dnl dnl The given libdvdread wasn't built
dnl AC_MSG_RESULT(no)
dnl AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
dnl fi
dnl fi
dnl else
dnl AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
dnl if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
dnl then
dnl dnl Use ${with_dvdread}/include/dvdread/dvd_reader.h
dnl AC_MSG_RESULT(yes)
dnl AX_ADD_PLUGINS([dvdread])
dnl AX_ADD_LDFLAGS([dvdread],[-L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}])
dnl AX_ADD_CPPFLAGS([dvdread],[-I${with_dvdread}/include])
dnl else
dnl dnl No libdvdread could be found, sorry
dnl AC_MSG_RESULT(no)
dnl AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
dnl fi
dnl fi
dnl fi
dnl dvdread module: check for libdvdread
dnl
AC_ARG_ENABLE(dvdread,
[ --enable-dvdread dvdread input module (default disabled)])
if test "${enable_dvdread}" != "no"
then
AC_ARG_WITH(dvdread,
[ --with-dvdread=PATH libdvdread headers and libraries])
AC_ARG_WITH(dvdread-tree,
[ --with-dvdread-tree=PATH libdvdread tree for static linking])
if test -z "${with_dvdread}"
then
if test -z "${with_dvdread_tree}"
then
AC_CHECK_HEADERS(dvdread/dvd_reader.h,
[ AX_ADD_PLUGINS([dvdread])
AX_ADD_LDFLAGS([dvdread],[-ldvdread ${LDFLAGS_dvdcss}])
],[
if test -n "${enable_dvdread}"
then
AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
AC_MSG_ERROR([cannot find libdvdread headers])
fi
])
else
AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
if test -z "${real_dvdread_tree}"
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
fi
if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
then
dnl Use a custom libdvdread
AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
AX_ADD_BUILTINS([dvdread])
AX_ADD_LDFLAGS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LDFLAGS_dvdcss}])
AX_ADD_CPPFLAGS([dvdread],[-I${real_dvdread_tree}])
else
dnl The given libdvdread wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
fi
fi
else
AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
then
dnl Use ${with_dvdread}/include/dvdread/dvd_reader.h
AC_MSG_RESULT(yes)
AX_ADD_PLUGINS([dvdread])
AX_ADD_LDFLAGS([dvdread],[-L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}])
AX_ADD_CPPFLAGS([dvdread],[-I${with_dvdread}/include])
else
dnl No libdvdread could be found, sorry
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
fi
fi
fi
dnl
dnl libdvdnav plugin
......
......@@ -4,8 +4,8 @@ SOURCES_access_udp = udp.c
SOURCES_access_tcp = tcp.c
SOURCES_access_http = http.c
SOURCES_access_ftp = ftp.c
SOURCES_dvdread = dvdread.c
SOURCES_slp = slp.c
SOURCES_access2 = access2.c
SOURCES_cdda = \
cdda.c \
vcd/cdrom.c \
......
This diff is collapsed.
SOURCES_dvdread = \
dvdread.c \
input.c \
input.h \
$(NULL)
/*****************************************************************************
* dvdread.c : DvdRead input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: dvdread.c,v 1.7 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* 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> /* strdup() */
#include <vlc/vlc.h>
/*****************************************************************************
* External prototypes
*****************************************************************************/
int E_(OpenDVD) ( vlc_object_t * );
void E_(CloseDVD) ( vlc_object_t * );
int E_(InitDVD) ( vlc_object_t * );
void E_(EndDVD) ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("DVD input (using libdvdread)") );
set_capability( "access", 110 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) );
vlc_module_end();
This diff is collapsed.
/*****************************************************************************
* input.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input.h,v 1.2 2003/01/23 15:52:04 sam 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
*****************************************************************************/
/* Logical block size for DVD-VIDEO */
#define LB2OFF(x) ((off_t)(x) * (off_t)(DVD_VIDEO_LB_LEN))
#define OFF2LB(x) ((x) >> 11)
/*****************************************************************************
* thread_dvd_data_t: extension of input_thread_t for DVD specificity.
*****************************************************************************/
typedef struct thread_dvd_data_s
{
dvd_reader_t * p_dvdread;
dvd_file_t * p_title;
ifo_handle_t * p_vmg_file;
ifo_handle_t * p_vts_file;
unsigned int i_title;
unsigned int i_chapter;
unsigned int i_angle;
unsigned int i_angle_nb;
tt_srpt_t * p_tt_srpt;
pgc_t * p_cur_pgc;
dsi_t dsi_pack;
int i_ttn;
unsigned int i_pack_len;
unsigned int i_cur_block;
unsigned int i_next_vobu;
unsigned int i_end_block;
unsigned int i_cur_cell;
unsigned int i_next_cell;
vlc_bool_t b_eoc;
} thread_dvd_data_t;
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