OSDN Git Service

Add build option --enable-ff-mpeg2 to use ffmpeg for mpeg2 decoding
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 23 Oct 2010 17:21:56 +0000 (17:21 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 23 Oct 2010 17:21:56 +0000 (17:21 +0000)
instead of mpeg2dec. disabled by default.

git-svn-id: svn://localhost/HandBrake/trunk@3610 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/module.defs
libhb/scan.c
libhb/work.c
make/configure.py

index 4759a92..6518bcc 100644 (file)
@@ -34,6 +34,9 @@ LIBHB.out += $(LIBHB.a)
 
 ###############################################################################
 
+ifeq (1,$(FEATURE.ff.mpeg2))
+LIBHB.GCC.D += USE_FF_MPEG2
+endif
 LIBHB.GCC.D += __LIBHB__ USE_PTHREAD
 LIBHB.GCC.I += $(LIBHB.build/) $(CONTRIB.build/)include
 
index 445314b..901551f 100644 (file)
@@ -5,6 +5,7 @@
    It may be used under the terms of the GNU General Public License. */
 
 #include "hb.h"
+#include "hbffmpeg.h"
 #include "a52dec/a52.h"
 #include "dca.h"
 
@@ -526,6 +527,13 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title )
         hb_deep_log( 2, "scan: preview %d", i + 1 );
 
         int vcodec = title->video_codec? title->video_codec : WORK_DECMPEG2;
+#if defined(USE_FF_MPEG2)
+        if (vcodec == WORK_DECMPEG2)
+        {
+            vcodec = WORK_DECAVCODECV;
+            title->video_codec_param = CODEC_ID_MPEG2VIDEO;
+        }
+#endif
         hb_work_object_t *vid_decoder = hb_get_work( vcodec );
         vid_decoder->codec_param = title->video_codec_param;
         vid_decoder->title = title;
index 7caa069..c9d32de 100644 (file)
@@ -637,6 +637,13 @@ static void do_job( hb_job_t * job, int cpu_count )
 
     /* Video decoder */
     int vcodec = title->video_codec? title->video_codec : WORK_DECMPEG2;
+#if defined(USE_FF_MPEG2)
+    if (vcodec == WORK_DECMPEG2)
+    {
+        vcodec = WORK_DECAVCODECV;
+        title->video_codec_param = CODEC_ID_MPEG2VIDEO;
+    }
+#endif
     hb_list_add( job->list_work, ( w = hb_get_work( vcodec ) ) );
     w->codec_param = title->video_codec_param;
     w->fifo_in  = job->fifo_mpeg2;
index 6702ee2..c069fc3 100644 (file)
@@ -1059,6 +1059,8 @@ def createCLI():
     grp.add_option( '--disable-gtk-update-checks', default=False, action='store_true', help=h )
     h = IfHost( 'enable GTK GUI (mingw)', '*-*-mingw*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-gtk-mingw', default=False, action='store_true', help=h )
+    h = IfHost( 'enable use of ffmpeg mpeg2 decoding', '*-*-*', none=optparse.SUPPRESS_HELP ).value
+    grp.add_option( '--enable-ff-mpeg2', default=False, action='store_true', help=h )
 
     h = IfHost( 'disable Xcode', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--disable-xcode', default=False, action='store_true', help=h )
@@ -1455,6 +1457,7 @@ int main ()
     doc.add( 'FEATURE.gtk',   int( not options.disable_gtk ))
     doc.add( 'FEATURE.gtk.update.checks',   int( not options.disable_gtk_update_checks ))
     doc.add( 'FEATURE.gtk.mingw',   int( options.enable_gtk_mingw ))
+    doc.add( 'FEATURE.ff.mpeg2',   int( options.enable_ff_mpeg2 ))
     doc.add( 'FEATURE.xcode', int( not (Tools.xcodebuild.fail or options.disable_xcode or options.cross) ))
 
     if not Tools.xcodebuild.fail and not options.disable_xcode: