Commit 8ccd224c authored by Sam Hocevar's avatar Sam Hocevar

 * fixes for the Qt plugin compilation under Debian

 * heavy butchering in the CSS and DVD ioctl code to put all architecture-
   dependent code in dvd_ioctl.c

 * added almost fully-functional /dev/dvd driver for MacOS X in
   extras/DVDioctl; to build it:

    % cd extras/DVDioctl
    % pbxbuild
    % kextload build/DVDioctl.kext # note: kextload has to be run as root

   be aware that the license for the DVDioctl kernel extension is
   not GPL but APSL, because I borrowed some code from the Darwin kernel.
parent a53dd0f3
......@@ -16,13 +16,14 @@ Here is a shortcut to copy-paste for a complete build:
make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt && make
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo \
&& make
If you intend to debug stuff, you may want to disable optimizations:
make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt \
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo \
--disable-optimizatons && make
......
......@@ -70,7 +70,7 @@ endif
# C headers directories
#
INCLUDE += @INCLUDE@
INCLUDE += -Iinclude -I/usr/local/include
INCLUDE += -Iinclude -Iextras -I/usr/local/include
#
# Libraries
......@@ -636,7 +636,7 @@ $(PLUGIN_GLIDE): %.o: %.c
$(PLUGIN_QT): %.o: Makefile.dep
$(PLUGIN_QT): %.o: .dep/%.dpp
$(PLUGIN_QT): %.o: %.moc
$(CC) $(CFLAGS) $(PCFLAGS) -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
$(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
moc -i $< -o $@
......
This diff is collapsed.
/*****************************************************************************
* DVDioctl.h: Linux-like DVD driver for Darwin and MacOS X
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: DVDioctl.h,v 1.1 2001/04/02 23:30:41 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*****************************************************************************/
struct sum { int a, b, r; };
#define IODVD_READ_STRUCTURE _IOWR('B', 1, struct sum)
#define IODVD_SEND_KEY _IOWR('B', 2, struct sum)
#define IODVD_REPORT_KEY _IOWR('B', 3, struct sum)
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 32;
objects = {
06AA1264FFB2107B11CA28AA = {
buildActionMask = 2147483647;
files = (
);
generatedFileNames = (
);
isa = PBXShellScriptBuildPhase;
name = "Shell Script";
neededFileNames = (
);
shellPath = /bin/sh;
shellScript = "script=\"${SYSTEM_DEVELOPER_DIR}/ProjectBuilder Extras/Kernel Extension Support/KEXTPostprocess\";\nif [ -x \"$script\" ]; then\n . \"$script\"\nfi";
};
06AA1265FFB2107B11CA28AA = {
buildRules = (
);
buildSettings = {
COPY_PHASE_STRIP = NO;
};
isa = PBXBuildStyle;
name = Development;
};
06AA1266FFB2107B11CA28AA = {
buildRules = (
);
buildSettings = {
COPY_PHASE_STRIP = YES;
};
isa = PBXBuildStyle;
name = Deployment;
};
06AA1267FFB2110C11CA28AA = {
buildActionMask = 2147483647;
files = (
);
generatedFileNames = (
);
isa = PBXShellScriptBuildPhase;
name = "Shell Script";
neededFileNames = (
);
shellPath = /bin/sh;
shellScript = "script=\"${SYSTEM_DEVELOPER_DIR}/ProjectBuilder Extras/Kernel Extension Support/KEXTPreprocess\";\nif [ -x \"$script\" ]; then\n . \"$script\"\nfi";
};
089C1669FE841209C02AAC07 = {
buildStyles = (
06AA1265FFB2107B11CA28AA,
06AA1266FFB2107B11CA28AA,
);
isa = PBXProject;
mainGroup = 089C166AFE841209C02AAC07;
projectDirPath = .;
targets = (
089C1673FE841209C02AAC07,
);
};
089C166AFE841209C02AAC07 = {
children = (
247142CAFF3F8F9811CA285C,
089C167CFE841241C02AAC07,
19C28FB6FE9D52B211CA2CBB,
);
isa = PBXGroup;
name = DVDioctl;
refType = 4;
};
089C1673FE841209C02AAC07 = {
buildPhases = (
06AA1267FFB2110C11CA28AA,
089C1674FE841209C02AAC07,
089C1675FE841209C02AAC07,
089C1676FE841209C02AAC07,
089C1677FE841209C02AAC07,
089C1679FE841209C02AAC07,
06AA1264FFB2107B11CA28AA,
);
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = "";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions";
KERNEL_MODULE = YES;
LIBRARY_SEARCH_PATHS = "";
MODULE_IOKIT = YES;
MODULE_NAME = DVDioctl;
MODULE_VERSION = 1.0.0d1;
OPTIMIZATION_CFLAGS = "";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = DVDioctl;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
WRAPPER_EXTENSION = kext;
};
conditionalBuildSettings = {
};
dependencies = (
);
isa = PBXBundleTarget;
name = DVDioctl;
productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Extensions";
productName = DVDioctl;
productReference = 0B81C263FFB7832611CA28AA;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">
<plist version=\"0.9\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>DVDioctl</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>DVDioctl</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0d1</string>
<key>IOKitPersonalities</key>
<dict>
<key>DVDioctl</key>
<dict>
<key>CFBundleIdentifier</key>
<string>DVDioctl</string>
<key>IOClass</key>
<string>DVDioctl</string>
<key>IOKitDebug</key>
<integer>65535</integer>
<key>IOMatchCategory</key>
<string>DVDioctl</string>
<key>IOProviderClass</key>
<string>IOResources</string>
<key>IOResourceMatch</key>
<string>IOKit</string>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict/>
</dict>
</plist>
";
shouldUseHeadermap = 1;
};
089C1674FE841209C02AAC07 = {
buildActionMask = 2147483647;
files = (
1A224C40FF42367911CA2CB7,
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
089C1675FE841209C02AAC07 = {
buildActionMask = 2147483647;
files = (
089C1680FE841241C02AAC07,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
089C1676FE841209C02AAC07 = {
buildActionMask = 2147483647;
files = (
1A224C41FF42367911CA2CB7,
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
089C1677FE841209C02AAC07 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
089C1679FE841209C02AAC07 = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
089C167CFE841241C02AAC07 = {
children = (
089C167DFE841241C02AAC07,
);
isa = PBXGroup;
name = Resources;
refType = 4;
};
089C167DFE841241C02AAC07 = {
children = (
089C167EFE841241C02AAC07,
);
isa = PBXVariantGroup;
name = InfoPlist.strings;
refType = 4;
};
089C167EFE841241C02AAC07 = {
fileEncoding = 10;
isa = PBXFileReference;
name = English;
path = English.lproj/InfoPlist.strings;
refType = 4;
};
089C1680FE841241C02AAC07 = {
fileRef = 089C167DFE841241C02AAC07;
isa = PBXBuildFile;
settings = {
};
};
0B81C263FFB7832611CA28AA = {
isa = PBXBundleReference;
path = DVDioctl.kext;
refType = 3;
};
19C28FB6FE9D52B211CA2CBB = {
children = (
0B81C263FFB7832611CA28AA,
);
isa = PBXGroup;
name = Products;
refType = 4;
};
1A224C3EFF42367911CA2CB7 = {
isa = PBXFileReference;
path = DVDioctl.h;
refType = 4;
};
1A224C3FFF42367911CA2CB7 = {
isa = PBXFileReference;
path = DVDioctl.cpp;
refType = 4;
};
1A224C40FF42367911CA2CB7 = {
fileRef = 1A224C3EFF42367911CA2CB7;
isa = PBXBuildFile;
settings = {
};
};
1A224C41FF42367911CA2CB7 = {
fileRef = 1A224C3FFF42367911CA2CB7;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
);
};
};
247142CAFF3F8F9811CA285C = {
children = (
1A224C3EFF42367911CA2CB7,
1A224C3FFF42367911CA2CB7,
);
isa = PBXGroup;
name = Source;
path = "";
refType = 4;
};
};
rootObject = 089C1669FE841209C02AAC07;
}
B/* Localized versions of Info.plist keys */
......@@ -78,7 +78,7 @@
* in the Makefile */
/* Modules specific debugging - this will produce a lot of output, but can be
* usefull to track a bug */
* useful to track a bug */
//#define DEBUG_INTF
//#define DEBUG_INPUT
//#define DEBUG_AUDIO
......@@ -445,9 +445,9 @@
#define INTF_WARNING_VAR "warning_level"
#define INTF_WARNING_DEFAULT 12
/* Define to enable messages queues - disabling messages queue can be usefull
* when debugging, since it allows messages which would not otherwise be printed,
* due to a crash, to be printed anyway */
/* Define to enable messages queues - disabling messages queue can be useful
* when debugging, since it allows messages which would not be printed
* due to a crash to be printed anyway */
#ifndef DEBUG
#define INTF_MSG_QUEUE
#endif
......
......@@ -52,6 +52,9 @@
/* Define if you have the vasprintf function. */
#undef HAVE_VASPRINTF
/* Define if you have the <CoreAudio/AudioHardware.h> header file. */
#undef HAVE_COREAUDIO_AUDIOHARDWARE_H
/* Define if you have the <SDL/SDL.h> header file. */
#undef HAVE_SDL_SDL_H
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* dvd_css.h: Structures for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.h,v 1.5 2001/03/03 07:07:01 stef Exp $
* $Id: dvd_css.h,v 1.6 2001/04/02 23:30:41 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -55,3 +55,4 @@ typedef struct css_s
off_t i_title_pos;
dvd_key_t pi_title_key;
} css_t;
This diff is collapsed.
......@@ -2,7 +2,7 @@
* dvd_ioctl.h: DVD ioctl replacement function
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ioctl.h,v 1.3 2001/03/06 10:21:59 massiot Exp $
* $Id: dvd_ioctl.h,v 1.4 2001/04/02 23:30:41 sam Exp $
*
* Authors: David Giller <rafetmad@oxy.edu>
* Eberhard Moenkeberg <emoenke@gwdg.de>
......@@ -25,6 +25,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
int dvd_ReadCopyright ( int i_fd, int i_layer, int *pi_copyright );
int dvd_ReadKey ( css_t *p_css, u8 *p_key );
int dvd_LUSendAgid ( css_t *p_css );
int dvd_LUSendChallenge ( css_t *p_css, u8 *p_challenge );
int dvd_LUSendKey1 ( css_t *p_css, u8 *p_key );
int dvd_LUSendASF ( css_t *p_css, int *pi_asf );
int dvd_InvalidateAgid ( css_t *p_css );
int dvd_HostSendChallenge ( css_t *p_css, u8 *p_challenge );
int dvd_HostSendKey2 ( css_t *p_css, u8 *p_key );
int dvd_ioctl( int i_fd, unsigned long i_op, void *p_arg );
/*****************************************************************************
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.35 2001/04/01 07:31:38 stef Exp $
* $Id: input_dvd.c,v 1.36 2001/04/02 23:30:41 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -243,7 +243,6 @@ lang_tbl[] =
* Local prototypes
*****************************************************************************/
static int DVDProbe ( probedata_t *p_data );
static int DVDCheckCSS ( struct input_thread_s * );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
......@@ -340,15 +339,6 @@ static int DVDProbe( probedata_t *p_data )
return( i_score );
}
/*****************************************************************************
* DVDCheckCSS: check the stream
*****************************************************************************/
static int DVDCheckCSS( input_thread_t * p_input )
{
return CSSTest( p_input->i_handle );
}
/*****************************************************************************
* DVDFindCell: adjust the title cell index with the program cell
*****************************************************************************/
......@@ -744,7 +734,8 @@ static void DVDInit( input_thread_t * p_input )
int i_chapter;
int i;
if( (p_dvd = malloc( sizeof(thread_dvd_data_t) )) == NULL )
p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
{
intf_ErrMsg( "Out of memory" );
p_input->b_error = 1;
......@@ -759,7 +750,17 @@ static void DVDInit( input_thread_t * p_input )
p_dvd->i_block_once = 32;
p_input->i_read_once = 128;
p_dvd->b_encrypted = DVDCheckCSS( p_input );
i = CSSTest( p_input->i_handle );
if( i < 0 )
{
intf_ErrMsg( "css error: could not get copyright bit" );
free( p_dvd );
p_input->b_error = 1;
return;
}
p_dvd->b_encrypted = i;
lseek( p_input->i_handle, 0, SEEK_SET );
......@@ -771,20 +772,31 @@ static void DVDInit( input_thread_t * p_input )
/* Ifo initialisation */
if( IfoInit( &p_dvd->p_ifo, p_input->i_handle ) < 0 )
{
intf_ErrMsg( "ifo error: fatal failure" );
free( p_dvd );
p_input->b_error = 1;
return;
intf_ErrMsg( "ifo error: fatal failure" );
free( p_dvd );
p_input->b_error = 1;
return;
}
/* CSS initialisation */
if( p_dvd->b_encrypted )
{
p_dvd->p_css = CSSInit( p_input->i_handle );
p_dvd->p_css = malloc( sizeof(css_t) );
if( p_dvd->p_css == NULL )
{
intf_ErrMsg( "css error: couldn't create CSS structure" );
free( p_dvd );
p_input->b_error = 1;
return;
}
p_dvd->p_css->i_fd = p_input->i_handle;
p_dvd->p_css->i_agid = 0;
if( CSSInit( p_dvd->p_css ) )
{
intf_ErrMsg( "css error: fatal failure" );
free( p_dvd->p_css );
free( p_dvd );
p_input->b_error = 1;
return;
......@@ -865,6 +877,7 @@ static void DVDEnd( input_thread_t * p_input )
if( p_dvd->b_encrypted )
{
CSSEnd( p_dvd->p_css );
free( p_dvd->p_css );
}
IfoEnd( p_dvd->p_ifo );
......
......@@ -2,7 +2,7 @@
* input_dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dvd.h,v 1.14 2001/04/01 07:31:38 stef Exp $
* $Id: input_dvd.h,v 1.15 2001/04/02 23:30:41 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -74,9 +74,9 @@ void IfoEnd ( struct ifo_s * );
/*****************************************************************************
* Prototypes in dvd_css.c
*****************************************************************************/
int CSSTest ( int );
struct css_s * CSSInit ( int );
void CSSEnd ( struct css_s * );
int CSSGetKey ( struct css_s * );
int CSSDescrambleSector ( u8 * , u8 * );
int CSSTest ( int );
int CSSInit ( struct css_s * );
void CSSEnd ( struct css_s * );
int CSSGetKey ( struct css_s * );
int CSSDescrambleSector ( u8 * , u8 * );
......@@ -2,7 +2,7 @@
* lpcm_decoder_thread.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.c,v 1.11 2001/03/21 13:42:34 sam Exp $
* $Id: lpcm_decoder_thread.c,v 1.12 2001/04/02 23:30:41 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -46,7 +46,7 @@
#include "lpcm_decoder.h"
#include "lpcm_decoder_thread.h"
#define LPCMDEC_FRAME_SIZE (2*1536) /* May not be usefull */
#define LPCMDEC_FRAME_SIZE (2*1536) /* May be useless */
/*****************************************************************************
* Local prototypes
......
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