Am 02.02.2012 10:03, schrieb Fabian Greffrath:
What I have at the moment is absolutely unrepresentable. It is based
on Marillat's package with some changes to patches and some
out-of-patch changes. Maybe I'll try to break out my own changes as a
separate patch once I got it to compile and post it here.

Well, I've got the libhb library to compile, but it fails when linking in the test phase with unresolved symbols in libdvdnav (and who knows where else). This missing additional API is patched into the downloaded copy! However, libdvdnav is only the first library in the linking chain which fails, but I expect others to follow and thus stop my work here.

Please find attached a patch with the steps I have so far taken to get it to compile and take the following as an inspiration about what is going on here:

$ find contrib/ -name \*.patch
contrib/a52dec/A00-dpl2.patch
contrib/libass/A00-configure.patch
contrib/fontconfig/A00-mingw-disableShared.patch
contrib/faac/P00-cygwin.patch
contrib/faac/A00-bitrates.patch
contrib/mp4v2/A00-nero-vobsub.patch
contrib/mp4v2/P00-mingw-dllimport.patch
contrib/pthreadw32/P00-mingw-w64.patch
contrib/x264/P01-solaris.patch
contrib/lame/P00-darwin-xmmintrin.patch
contrib/libmkv/P00-mingw-large-file.patch
contrib/libdvdread/A02-msc_ver-defs.patch
contrib/libdvdread/A03-m4-uid0.patch
contrib/libdvdread/P00-mingw-dlfcn.patch
contrib/libdvdread/P06-darwin.patch
contrib/libdvdread/A04-dup-lut-pgc.patch
contrib/libdvdread/P05-mingw-large-file.patch
contrib/libdvdread/A00-volume-name.patch
contrib/faad2/P00-solaris.patch
contrib/faad2/P00-mingw-types.patch
contrib/ffmpeg/A03-png-sequences.patch
contrib/ffmpeg/A05-avi-seek.patch
contrib/ffmpeg/A01-mpegleak.patch
contrib/ffmpeg/P02-darwin-pic.patch
contrib/ffmpeg/P03-mingw-gnu99.patch
contrib/ffmpeg/A02-audioconvert.patch
contrib/ffmpeg/P01-solaris.patch
contrib/ffmpeg/A06-kfreebsd.patch
contrib/libdvdnav/A01-program-info.patch
contrib/libdvdnav/A03-quiet.patch
contrib/libdvdnav/A02-mult-pgc.patch
contrib/libdvdnav/A06-reset-mutex.patch
contrib/libdvdnav/A04-m4-uid0.patch
contrib/libdvdnav/A05-forward-seek.patch
contrib/libdvdnav/A07-missing-menu.patch
contrib/libdvdnav/A00-log-stderr.patch
contrib/libdvdnav/P00-mingw-no-examples.patch
contrib/libdvdnav/A08-dvdnav-dup.patch
contrib/libdca/A00-general.patch
contrib/mpeg2dec/A00-tags.patch
contrib/mpeg2dec/A01-gcc4.6.patch
contrib/libvorbis/A00-disable-examples.patch
contrib/libvorbis/A01-docs.patch

 - Fabian
--- handbrake-0.9.5.orig/libhb/stream.c
+++ handbrake-0.9.5/libhb/stream.c
@@ -2956,7 +2956,7 @@
         int i;
         for (i = 0; i < ic->nb_streams; ++i )
         {
-            if ( ic->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO )
+            if ( ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO )
             {
                 break;
             }
@@ -3285,7 +3285,7 @@
     int i;
     for (i = 0; i < ic->nb_streams; ++i )
     {
-        if ( ic->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO &&
+        if ( ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
              avcodec_find_decoder( ic->streams[i]->codec->codec_id ) &&
              title->video_codec == 0 )
         {
@@ -3306,16 +3306,16 @@
             title->video_codec = WORK_DECAVCODECVI;
             title->video_codec_param = ffmpeg_codec_param( stream, i );
         }
-        else if ( ic->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO &&
+        else if ( ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
                   avcodec_find_decoder( ic->streams[i]->codec->codec_id ) )
         {
             add_ffmpeg_audio( title, stream, i );
         }
-        else if ( ic->streams[i]->codec->codec_type == CODEC_TYPE_SUBTITLE )
+        else if ( ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE )
         {
             add_ffmpeg_subtitle( title, stream, i );
         }
-        else if ( ic->streams[i]->codec->codec_type == CODEC_TYPE_ATTACHMENT )
+        else if ( ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_ATTACHMENT )
         {
             add_ffmpeg_attachment( title, stream, i );
         }
@@ -3423,7 +3423,7 @@
         default:
             break;
     }
-    return ( stream->ffmpeg_pkt->flags & PKT_FLAG_KEY );
+    return ( stream->ffmpeg_pkt->flags & AV_PKT_FLAG_KEY );
 }
 
 static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf )
@@ -3441,7 +3441,7 @@
         // XXX the following conditional is to handle avi files that
         // use M$ 'packed b-frames' and occasionally have negative
         // sizes for the null frames these require.
-        if ( err != AVERROR_NOMEM || stream->ffmpeg_pkt->size >= 0 )
+        if ( err != AVERROR(ENOMEM) || stream->ffmpeg_pkt->size >= 0 )
             // eof
             return 0;
     }
--- handbrake-0.9.5.orig/libhb/decdca.c
+++ handbrake-0.9.5/libhb/decdca.c
@@ -6,6 +6,7 @@
 
 #include "hb.h"
 #include "dca.h"
+typedef sample_t dca_sample_t;
 
 struct hb_work_private_s
 {
--- handbrake-0.9.5.orig/libhb/muxmp4.c
+++ handbrake-0.9.5/libhb/muxmp4.c
@@ -9,6 +9,8 @@
 
 #include "hb.h"
 
+#define 	MP4_DETAILS_ERROR   0x00000001
+
 struct hb_mux_object_s
 {
     HB_MUX_COMMON;
@@ -93,13 +95,13 @@
     if (job->largeFileSize)
     /* Use 64-bit MP4 file */
     {
-        m->file = MP4Create( job->file, MP4_DETAILS_ERROR, MP4_CREATE_64BIT_DATA );
+        m->file = MP4Create( job->file, MP4_DETAILS_ERROR );
         hb_deep_log( 2, "muxmp4: using 64-bit MP4 formatting.");
     }
     else
     /* Limit MP4s to less than 4 GB */
     {
-        m->file = MP4Create( job->file, MP4_DETAILS_ERROR, 0 );
+        m->file = MP4Create( job->file, MP4_DETAILS_ERROR );
     }
 
     if (m->file == MP4_INVALID_FILE_HANDLE)
@@ -1277,14 +1279,14 @@
         MP4TagsFree( tags );
     }
 
-    MP4Close( m->file );
+    MP4Close( m->file, 0 );
 
     if ( job->mp4_optimize )
     {
         hb_log( "muxmp4: optimizing file" );
         char filename[1024]; memset( filename, 0, 1024 );
         snprintf( filename, 1024, "%s.tmp", job->file );
-        MP4Optimize( job->file, filename, MP4_DETAILS_ERROR );
+        MP4Optimize( job->file, filename );
         remove( job->file );
         rename( filename, job->file );
     }
--- handbrake-0.9.5.orig/libhb/hbffmpeg.h
+++ handbrake-0.9.5/libhb/hbffmpeg.h
@@ -6,6 +6,8 @@
 #include "libavformat/avformat.h"
 #include "libswscale/swscale.h"
 
+#define MAX_STREAMS 100
+
 void hb_avcodec_init(void);
 int hb_avcodec_open( AVCodecContext *, struct AVCodec * );
 int hb_avcodec_close( AVCodecContext * );
--- handbrake-0.9.5.orig/libhb/work.c
+++ handbrake-0.9.5/libhb/work.c
@@ -7,7 +7,7 @@
 #include "hb.h"
 #include "a52dec/a52.h"
 #include "dca.h"
-#include "libavformat/avformat.h"
+#include "hbffmpeg.h"
 
 typedef struct
 {
--- handbrake-0.9.5.orig/libhb/decavcodec.c
+++ handbrake-0.9.5/libhb/decavcodec.c
@@ -62,7 +62,9 @@
 #include "hb.h"
 #include "hbffmpeg.h"
 #include "downmix.h"
-#include "libavcodec/audioconvert.h"
+//#include "libavcodec/audioconvert.h"
+struct AVAudioConvert;
+typedef struct AVAudioConvert AVAudioConvert;
 
 static int  decavcodecInit( hb_work_object_t *, hb_job_t * );
 static int  decavcodecWork( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** );
@@ -906,7 +908,7 @@
 
     int codec_id = w->codec_param;
     pv->parser = av_parser_init( codec_id );
-    pv->context = avcodec_alloc_context2( CODEC_TYPE_VIDEO );
+    pv->context = avcodec_alloc_context2( AVMEDIA_TYPE_VIDEO );
 
     /* we have to wrap ffmpeg's get_buffer to be able to set the pts (?!) */
     pv->context->opaque = pv;
--- handbrake-0.9.5.orig/libhb/bd.c
+++ handbrake-0.9.5/libhb/bd.c
@@ -48,7 +48,7 @@
         goto fail;
     }
 
-    d->title_count = bd_get_titles( d->bd, TITLES_RELEVANT );
+    d->title_count = bd_get_titles( d->bd, TITLES_RELEVANT, 0 );
     if ( d->title_count == 0 )
     {
         hb_log( "bd: not a bd - trying as a stream/file instead" );
@@ -105,7 +105,7 @@
     title->vts = 0;
     title->ttn = 0;
 
-    ti = bd_get_title_info( d->bd, tt - 1 );
+    ti = bd_get_title_info( d->bd, tt - 1, 0 );
     if ( ti == NULL )
     {
         hb_log( "bd: invalid title" );
@@ -365,7 +365,7 @@
     for ( ii = 0; ii < hb_list_count( list_title ); ii++ )
     {
         hb_title_t * title = hb_list_item( list_title, ii );
-        ti = bd_get_title_info( d->bd, title->index - 1 );
+        ti = bd_get_title_info( d->bd, title->index - 1, 0 );
         if ( ti ) 
         {
             BLURAY_STREAM_INFO * bdvideo = &ti->clips[0].video_streams[0];
--- handbrake-0.9.5.orig/libhb/module.defs
+++ handbrake-0.9.5/libhb/module.defs
@@ -13,7 +13,7 @@
 LIBHB.m4.in  = $(wildcard $(LIBHB.src/)*.m4)
 LIBHB.m4.out = $(patsubst $(LIBHB.src/)%.m4,$(LIBHB.build/)%,$(LIBHB.m4.in))
 
-LIBHB.c   = $(wildcard $(LIBHB.src/)*.c)
+LIBHB.c   = $(filter-out $(LIBHB.src/)encfaac.c,$(wildcard $(LIBHB.src/)*.c))
 LIBHB.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%.o,$(LIBHB.c))
 LIBHB.d   = $(LIBHB.m4.out) $(LIBHB.h.out) \
     $(foreach n,$(LIBHB.prerequisites),$($n.INSTALL.target) )
@@ -94,7 +94,7 @@
 LIBHB.dll.libs = $(foreach n, \
         a52 ass avcore avcodec avformat avutil dca dvdnav dvdread faac faad fontconfig freetype mkv mpeg2 mp3lame mp4v2 \
         ogg samplerate swscale theora vorbis vorbisenc x264 xml2 bluray, \
-        $(CONTRIB.build/)lib/lib$(n).a )
+        -l$(n) )
 
 ifneq ($(HAS.iconv),1)
 LIBHB.dll.libs += $(CONTRIB.build/)lib/libiconv.a
--- handbrake-0.9.5.orig/libhb/decmetadata.c
+++ handbrake-0.9.5/libhb/decmetadata.c
@@ -13,7 +13,7 @@
     MP4FileHandle input_file;
     hb_deep_log( 2, "Got an MP4 input, read the metadata");
 
-    input_file = MP4Read( title->path, 0 );
+    input_file = MP4Read( title->path );
 
     if( input_file != MP4_INVALID_FILE_HANDLE )
     { 
@@ -92,7 +92,7 @@
             }
         }
 
-        MP4Close( input_file );
+        MP4Close( input_file, 0 );
     }
 }
 

_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to