Commit 20ff5191 authored by Sam Hocevar's avatar Sam Hocevar

  * Added BSD/OS libdvd by Steven M. Schultz <sms@TO.GD-ES.COM> in
    extras/BSDI_dvdioctl after he suggested it. License is GPL.
  * ./configure now checks for an installed libdvd under BSD/OS and
    falls back to ours if not found.
  * Fixed harmless typos in yesterday's Solaris libdvd patches.
  * Bumped libdvdcss version number up to 0.0.3 ; release will probably
    follow once the BSDI changes have been tested.
parent 301cde4d
......@@ -4,6 +4,12 @@
HEAD
* Added BSD/OS libdvd by Steven M. Schultz <sms@TO.GD-ES.COM> in
extras/BSDI_dvdioctl after he suggested us to do so. License is GPL.
* ./configure now checks for an installed libdvd under BSD/OS and
falls back to ours if not found.
* Fixed harmless typos in yesterday's Solaris libdvd patches.
* Bumped libdvdcss version number up to 0.0.3.
* Added vlc:loop playlist command to go back at the beginning.
Usage: vlc file1.mpeg file2.mpeg ... fileN.mpeg vlc:loop
* Fixed a bug in the gtk interface which caused vlc to go amok after
......
......@@ -50,7 +50,7 @@ C_OBJ := $(INTERFACE:%=src/interface/%.o) \
#
# Misc Objects
#
ifeq ($(GETOPT),1)
ifeq ($(NEED_GETOPT),1)
C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
endif
......
......@@ -39,7 +39,6 @@ STATS = @STATS@
TRACE = @TRACE@
PROFILING = @PROFILING@
OPTIMS = @OPTIMS@
GETOPT = @GETOPT@
#
# Build environment
......@@ -92,14 +91,22 @@ LIB_YUV = @LIB_YUV@
# CFLAGS for special cases
#
CFLAGS_DVD = @CFLAGS_DVD@
CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@
#
# Other special cases
# Additional objects
#
OBJ_DVD = @OBJ_DVD@
OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
#
# Other special cases
#
NEED_GETOPT = @NEED_GETOPT@
NEED_BSDI_LIBDVD = @NEED_BSDI_LIBDVD@
LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
###############################################################################
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ fi
HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
HAVE_LIBDVDCSS=1
LIBDVDCSS_VERSION=0.0.2
LIBDVDCSS_VERSION=0.0.3
AC_SUBST(LIBDVDCSS_VERSION)
fi
......@@ -62,18 +62,17 @@ AC_CHECK_FUNCS(swab)
AC_CHECK_FUNCS(sigrelse)
dnl Check for getopt
GETOPT=0
NEED_GETOPT=0
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
[GETOPT=1])])
[NEED_GETOPT=1])])
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
AC_CHECK_LIB(dvd,dvd_cdrom_ioctl,LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd")
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
CFLAGS="${CFLAGS} -I/usr/local/include"
......@@ -250,15 +249,27 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
dnl
dnl BSDI: dvd.h
dnl
NEED_BSDI_LIBDVD=0
AC_EGREP_HEADER(dvd_struct,dvd.h,[
AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
Define if <dvd.h> defines DVD_STRUCT.)
LINUX_DVD_STRUCT=1
OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
CFLAGS_LIBDVDCSS="${CFLAGS_LIBDVDCSS} -I../BSDI_ioctl"
],[
dnl
dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
dnl
AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
NEED_BSDI_LIBDVD=1
LINUX_DVD_STRUCT=1
])
])
dnl
dnl Solaris: sys/scsi/generic/commands.h sys/scsi/impl/uscsi.h
dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
dnl
AC_CHECK_HEADER(/usr/include/sys/scsi/scsi_types.h,[
AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
])
......@@ -837,7 +848,8 @@ AC_SUBST(ASM)
AC_SUBST(TRACE)
AC_SUBST(PROFILING)
AC_SUBST(OPTIMS)
AC_SUBST(GETOPT)
AC_SUBST(NEED_GETOPT)
AC_SUBST(NEED_BSDI_LIBDVD)
AC_SUBST(MOC)
AC_SUBST(WINDRES)
......@@ -872,11 +884,13 @@ AC_SUBST(LIB_YUV)
AC_SUBST(CFLAGS_VLC)
AC_SUBST(CFLAGS_DVD)
AC_SUBST(CFLAGS_LIBDVDCSS)
AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11)
AC_SUBST(OBJ_DVD)
AC_SUBST(OBJ_LIBDVDCSS)
AC_SUBST(LOCAL_LIBDVDCSS)
......@@ -899,7 +913,7 @@ debug mode : ${DEBUG}
statistics : ${STATS}
trace mode : ${TRACE}
profiling : ${PROFILING}
need builtin getopt : ${GETOPT}
need builtin getopt : ${NEED_GETOPT}
built-in modules :${BUILTINS}
plugin modules :${PLUGINS}
vlc aliases :${ALIASES}"
......@@ -912,6 +926,7 @@ can be built : ${CAN_BUILD_LIBDVDCSS}
will be built : ${LOCAL_LIBDVDCSS}"
if test x${LOCAL_LIBDVDCSS} = x1
then
echo "need BSDI libdvd : ${NEED_BSDI_LIBDVD}"
echo "link statically : ${STATIC_LIBDVDCSS}"
else
echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
......
......@@ -15,7 +15,7 @@ Description: a free MPEG and DVD player
This is vlc, the VideoLAN Client. It plays MPEG and MPEG2 files,
DVDs, or MPEG streams from a network source.
Package: libdvdcss0.0.2
Package: libdvdcss0.0.3
Architecture: any
Depends: ${shlibs:Depends}
Description: a portable abstraction library for DVD decryption
......@@ -24,9 +24,9 @@ Description: a portable abstraction library for DVD decryption
.
This package contains the libdvdcss0 runtime library.
Package: libdvdcss0.0.2-dev
Package: libdvdcss0.0.3-dev
Architecture: any
Depends: libdvdcss0.0.2 (= ${Source-Version}), libc6-dev
Depends: libdvdcss0.0.3 (= ${Source-Version}), libc6-dev
Description: development files for libdvdcss0
libdvdcss is a portable abstraction library for DVD decryption, it
provides a simple API to access a DVD device as a block device.
......
......@@ -16,8 +16,8 @@ export PIXDIR="usr/share/pixmaps"
export GNOMEDIR="usr/share/gnome/apps/Multimedia"
# Library options
version=0.0.2
major=0
version=$(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | cut -f2 -d=)
major=$(shell echo $(version) | cut -f1 -d.)
build: build-stamp
build-stamp:
......
This diff is collapsed.
all: libdvd.a libdvd.so blkreset
blkreset: libdvd.a blkreset.c
cc -O2 -g -o blkreset blkreset.c libdvd.a
dvdioctl.o: dvdioctl.c dvd.h
cc -O2 -g -c -I. dvdioctl.c
dvdioctl.po: dvdioctl.c dvd.h
cc -O2 -fPIC -DPIC -g -c -o dvdioctl.po -I. dvdioctl.c
libdvd.a: dvdioctl.o
ar rcv libdvd.a dvdioctl.o
libdvd.so: dvdioctl.po
cc -shared -o libdvd.so dvdioctl.po
install: libdvd.a libdvd.so blkreset
install -c -m 644 libdvd.a /usr/local/lib/libdvd.a
install -c -m 755 libdvd.so /usr/local/lib/libdvd.so
ranlib /usr/local/lib/libdvd.a
install -c -m 644 dvd.h /usr/local/include/dvd.h
install -c -m 755 blkreset /usr/local/bin/blkreset
clean:
rm -f *.a *.o *.so *.po blkreset
/*
* This is a (very) simple program to be used when the blocksize on a CDrom
* drive gets set to something other than 2048 (such as 2336 when ripping
* VCDs).
*
* Uses the 'cdrom_blocksize' routine from libdvd
*/
#include <stdio.h>
#include <err.h>
#include <fcntl.h>
main(int argc, char **argv)
{
int fd;
char *device = "/dev/rsr1c";
if (argc != 2)
errx(1, "raw device name of CDROM drive needed as arg");
device = argv[1];
fd = open(device, O_RDONLY, 0);
if (fd < 0)
err(1, "open(%s)", device);
if (cdrom_blocksize(fd, 2048))
errx(1, "cdrom_blocksize for %s failed\n", device);
exit(0);
}
#ifndef _DVD_H_
#define _DVD_H_
#include <sys/cdefs.h>
#include <machine/endian.h>
#include <sys/ioctl.h>
__BEGIN_DECLS
int dvd_cdrom_ioctl(int, unsigned long, void *);
int cdrom_blocksize(int, int);
void dvd_cdrom_debug(int);
__END_DECLS
#define ioctl(a,b,c) dvd_cdrom_ioctl((a),(b),(c))
typedef unsigned char __u8;
typedef unsigned short __u16;
typedef unsigned int __u32;
#define DVD_READ_STRUCT 0x5390 /* Read structure */
#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
#define DVD_AUTH 0x5392 /* Authentication */
#define DVD_STRUCT_PHYSICAL 0x00
#define DVD_STRUCT_COPYRIGHT 0x01
#define DVD_STRUCT_DISCKEY 0x02
#define DVD_STRUCT_BCA 0x03
#define DVD_STRUCT_MANUFACT 0x04
struct dvd_layer {
__u8 book_version : 4;
__u8 book_type : 4;
__u8 min_rate : 4;
__u8 disc_size : 4;
__u8 layer_type : 4;
__u8 track_path : 1;
__u8 nlayers : 2;
__u8 track_density : 4;
__u8 linear_density : 4;
__u8 bca : 1;
__u32 start_sector;
__u32 end_sector;
__u32 end_sector_l0;
};
struct dvd_physical {
__u8 type;
__u8 layer_num;
struct dvd_layer layer[4];
};
struct dvd_copyright {
__u8 type;
__u8 layer_num;
__u8 cpst;
__u8 rmi;
};
struct dvd_disckey {
__u8 type;
unsigned agid : 2;
__u8 value[2048];
};
struct dvd_bca {
__u8 type;
int len;
__u8 value[188];
};
struct dvd_manufact {
__u8 type;
__u8 layer_num;
int len;
__u8 value[2048];
};
typedef union {
__u8 type;
struct dvd_physical physical;
struct dvd_copyright copyright;
struct dvd_disckey disckey;
struct dvd_bca bca;
struct dvd_manufact manufact;
} dvd_struct;
/*
* DVD authentication ioctl
*/
/* Authentication states */
#define DVD_LU_SEND_AGID 0
#define DVD_HOST_SEND_CHALLENGE 1
#define DVD_LU_SEND_KEY1 2
#define DVD_LU_SEND_CHALLENGE 3
#define DVD_HOST_SEND_KEY2 4
/* Termination states */
#define DVD_AUTH_ESTABLISHED 5
#define DVD_AUTH_FAILURE 6
/* Other functions */
#define DVD_LU_SEND_TITLE_KEY 7
#define DVD_LU_SEND_ASF 8
#define DVD_INVALIDATE_AGID 9
#define DVD_LU_SEND_RPC_STATE 10
#define DVD_HOST_SEND_RPC_STATE 11
/* State data */
typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
struct dvd_lu_send_agid {
__u8 type;
unsigned agid : 2;
};
struct dvd_host_send_challenge {
__u8 type;
unsigned agid : 2;
dvd_challenge chal;
};
struct dvd_send_key {
__u8 type;
unsigned agid : 2;
dvd_key key;
};
struct dvd_lu_send_challenge {
__u8 type;
unsigned agid : 2;
dvd_challenge chal;
};
#define DVD_CPM_NO_COPYRIGHT 0
#define DVD_CPM_COPYRIGHTED 1
#define DVD_CP_SEC_NONE 0
#define DVD_CP_SEC_EXIST 1
#define DVD_CGMS_UNRESTRICTED 0
#define DVD_CGMS_SINGLE 2
#define DVD_CGMS_RESTRICTED 3
struct dvd_lu_send_title_key {
__u8 type;
unsigned agid : 2;
dvd_key title_key;
int lba;
unsigned cpm : 1;
unsigned cp_sec : 1;
unsigned cgms : 2;
};
struct dvd_lu_send_asf {
__u8 type;
unsigned agid : 2;
unsigned asf : 1;
};
struct dvd_host_send_rpcstate {
__u8 type;
__u8 pdrc;
};
struct dvd_lu_send_rpcstate {
__u8 type : 2;
__u8 vra : 3;
__u8 ucca : 3;
__u8 region_mask;
__u8 rpc_scheme;
};
typedef union {
__u8 type;
struct dvd_lu_send_agid lsa;
struct dvd_host_send_challenge hsc;
struct dvd_send_key lsk;
struct dvd_lu_send_challenge lsc;
struct dvd_send_key hsk;
struct dvd_lu_send_title_key lstk;
struct dvd_lu_send_asf lsasf;
struct dvd_host_send_rpcstate hrpcs;
struct dvd_lu_send_rpcstate lrpcs;
} dvd_authinfo;
typedef struct {
__u16 report_key_length;
__u8 reserved1;
__u8 reserved2;
#if BYTE_ORDER == BIG_ENDIAN
__u8 type_code : 2;
__u8 vra : 3;
__u8 ucca : 3;
#elif BYTE_ORDER == LITTLE_ENDIAN
__u8 ucca : 3;
__u8 vra : 3;
__u8 type_code : 2;
#endif
__u8 region_mask;
__u8 rpc_scheme;
__u8 reserved3;
} rpc_state_t;
/*
* Stuff for the CDROM ioctls
*/
#define CDROMREADTOCHDR 0x5305 /* Read TOC header (cdrom_tochdr) */
#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry (cdrom_tocentry) */
#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
#define CDROMCLOSETRAY 0x5319 /* Reverse of CDROMEJECT */
#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes) */
#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes) */
#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 bytes) */
#define CD_MINS 74 /* max. minutes per CD, not really a limit */
#define CD_SECS 60 /* seconds per minute */
#define CD_FRAMES 75 /* frames per second */
#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
/* CD-ROM address types (cdrom_tocentry.cdte_format) */
#define CDROM_LBA 0x01 /* logical block: first frame is #0 */
#define CDROM_MSF 0x02 /* minute-second-frame: binary. not bcd here!*/
/* The leadout track is always 0xAA, regardless of # of tracks on disc */
#define CDROM_LEADOUT 0xAA
/* drive status returned by CDROM_DRIVE_STATUS ioctl */
#define CDS_NO_INFO 0 /* if not implemented */
#define CDS_NO_DISC 1
#define CDS_TRAY_OPEN 2
#define CDS_DRIVE_NOT_READY 3
#define CDS_DISC_OK 4
/* For compile compatibility only - we don't support changers */
#define CDSL_NONE ((int) (~0U>>1)-1)
#define CDSL_CURRENT ((int) (~0U>>1))
struct cdrom_msf
{
__u8 cdmsf_min0; /* start minute */
__u8 cdmsf_sec0; /* start second */
__u8 cdmsf_frame0; /* start frame */
__u8 cdmsf_min1; /* end minute */
__u8 cdmsf_sec1; /* end second */
__u8 cdmsf_frame1; /* end frame */
};
struct cdrom_tochdr
{
__u8 cdth_trk0; /* start track */
__u8 cdth_trk1; /* end track */
};
struct cdrom_msf0
{
__u8 minute;
__u8 second;
__u8 frame;
};
union cdrom_addr
{
struct cdrom_msf0 msf;
int lba;
};
struct cdrom_tocentry
{
__u8 cdte_track;
__u8 cdte_adr :4;
__u8 cdte_ctrl :4;
__u8 cdte_format;
union cdrom_addr cdte_addr;
__u8 cdte_datamode;
};
struct modesel_head
{
__u8 reserved1;
__u8 medium;
__u8 reserved2;
__u8 block_desc_length;
__u8 density;
__u8 number_of_blocks_hi;
__u8 number_of_blocks_med;
__u8 number_of_blocks_lo;
__u8 reserved3;
__u8 block_length_hi;
__u8 block_length_med;
__u8 block_length_lo;
};
#endif /* _DVD_H_ */
This diff is collapsed.
......@@ -9,30 +9,38 @@ MAJOR_SO := libdvdcss.so.$(shell echo $(LIBDVDCSS_VERSION) | cut -f1 -d.)
FULL_SO := libdvdcss.so.$(LIBDVDCSS_VERSION)
ifneq (,$(SOFLAGS))
ALL_SOFLAGS := $(SOFLAGS)$(MAJOR_SO)
SOFLAGS :=
endif
#
# Objects
#
LIBDVDCSS_O = libdvdcss.o css.o ioctl.o
ALL_OBJ = $(LIBDVDCSS_O)
OBJ_C = libdvdcss.o css.o ioctl.o
ALL_OBJ = $(OBJ_C) $(OBJ_LIBDVDCSS)
include ../../Makefile.modules
$(LIBDVDCSS_O): %.o: .dep/%.d
$(LIBDVDCSS_O): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(OBJ_C): %.o: .dep/%.d
$(OBJ_C): %.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
bsdi_dvdioctl.o: ../BSDI_ioctl/dvdioctl.c
$(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
../../lib/$(FULL_SO): $(LIBDVDCSS_O)
../../lib/$(FULL_SO): $(OBJ_C) $(OBJ_LIBDVDCSS)
$(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_LIBDVDCSS)
rm -f ../../lib/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_SO)
../../lib/$(BASE_A): $(LIBDVDCSS_O)
../../lib/$(BASE_A): $(OBJ_C) $(OBJ_LIBDVDCSS)
ar r $@ $^
$(RANLIB) $@
#
# Virtual targets
#
all: ../../lib/$(FULL_SO) ../../lib/$(BASE_A)
install:
......
......@@ -2,7 +2,7 @@
* ioctl.c: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ioctl.c,v 1.9 2001/08/09 08:20:26 sam Exp $
* $Id: ioctl.c,v 1.10 2001/08/09 23:12:36 sam Exp $
*
* Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
* Samuel Hocevar <sam@zoy.org>
......@@ -59,7 +59,7 @@
#ifdef SOLARIS_USCSI
# include <unistd.h>
# include <stropts.h>
# include </usr/include/sys/scsi/scsi_types.h>
# include <sys/scsi/scsi_types.h>
# include <sys/scsi/impl/uscsi.h>
#endif
......@@ -67,7 +67,7 @@
#include "common.h"
#ifdef SYS_DARWIN
# include "DVDioctl/DVDioctl.h"
# include "MacOSX_dvdioctl/DVDioctl.h"
#endif
#include "ioctl.h"
......
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