OSDN Git Service

HandBrake 0.5.2
authorroot <root@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 14 Jan 2006 13:11:35 +0000 (13:11 +0000)
committerroot <root@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 14 Jan 2006 13:11:35 +0000 (13:11 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@9 b64f7644-9d1e-0410-96f1-a4d463321fa5

15 files changed:
Jamfile
TODO
core/AviMux.c
core/HandBrake.c
core/Mpeg2Dec.c
core/Thread.c
core/Utils.c
macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/InfoPlist.strings
macosx/English.lproj/MainMenu.nib/classes.nib
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/objects.nib
macosx/HandBrake.pbproj/project.pbxproj
test/test.c

diff --git a/Jamfile b/Jamfile
index b04cd66..a96bf59 100644 (file)
--- a/Jamfile
+++ b/Jamfile
@@ -1,10 +1,10 @@
-# $Id: Jamfile,v 1.8 2003/11/09 22:11:06 titer Exp $
+# $Id: Jamfile,v 1.10 2003/11/13 02:09:14 titer Exp $
 #
 # This file is part of the HandBrake source code.
 # Homepage: <http://handbrake.m0k.org/>.
 # It may be used under the terms of the GNU General Public License.
 
-HB_VERSION = 0.5.1 ;
+HB_VERSION = 0.5.2 ;
 
 # Compilers
 CC   = gcc ;
diff --git a/TODO b/TODO
index 19d9acf..9708490 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,20 +2,20 @@
   + Should be able to boost the audio volume
   + Allow the intf to preview the latest encoded picture
   + Finish and test the MPEG audio decoder
-  + More encoding options: B-frames, type of estimation,
-    type of scaling, etc
+  + More encoding options: B-frames, type of estimation etc etc
   + Subtitle support
-  + Finish xvid encoding support (2-pass, more tests)
   + Allow the user to split the file in x parts
+  + AC3 pass-through
   + AAC & vorbis encoding support
   + mp4 & mkv muxing support
   + manual aspect ratio
+  + rotate the movie
+  + rip only a few chapters
+  + network shared processing (using RendezVous)
 
 - All interfaces
   + Use the DVD name in popup and for the name of the created file
+  + nice 'About...' box with link to homepage & faq
 
 - BeOS interface
   + Redo the picture panel
-
-- OS X interface
-  + Make the 'destination' field editable
index bd05512..ca34d3c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: AviMux.c,v 1.5 2003/11/06 18:35:53 titer Exp $
+/* $Id: AviMux.c,v 1.6 2003/11/13 01:18:52 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -605,7 +605,7 @@ static void IndexAddInt32( HBBuffer * b, uint32_t val )
     {
         HBLog( "HBAviMux: reallocing index (%d MB)",
                1 + b->alloc / 1024 / 1024 );
-        HBBufferReAlloc( b, b->alloc + 1024 + 1024 );
+        HBBufferReAlloc( b, b->alloc + 1024 * 1024 );
     }
 
     b->data[b->size++] = val & 0xFF;
index b7670ba..c76a27b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: HandBrake.c,v 1.16 2003/11/09 21:26:52 titer Exp $
+/* $Id: HandBrake.c,v 1.18 2003/11/13 01:17:33 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -117,6 +117,7 @@ HBHandle * HBInit( int debug, int cpuCount )
     h->lock        = HBLockInit();
     h->modeChanged = 1;
     h->status.mode = HB_MODE_NEED_DEVICE;
+    h->status.titleList = NULL;
     h->curTitle    = NULL;
     h->curAudio    = NULL;
     h->curOptAudio = NULL;
@@ -191,16 +192,16 @@ void HBStartRip( HBHandle * h, HBTitle * t,
     FixPictureSettings( t );
 
     /* Create fifos */
-    t->mpeg2Fifo  = HBFifoInit( 512 );
+    t->mpeg2Fifo  = HBFifoInit( 1024 );
     t->rawFifo    = HBFifoInit( 1 );
     t->scaledFifo = HBFifoInit( 1 );
     t->mpeg4Fifo  = HBFifoInit( 1 );
-    a1->ac3Fifo   = HBFifoInit( 512 );
+    a1->ac3Fifo   = HBFifoInit( 1024 );
     a1->rawFifo   = HBFifoInit( 1 );
     a1->mp3Fifo   = HBFifoInit( 1 );
     if( a2 )
     {
-        a2->ac3Fifo = HBFifoInit( 512 );
+        a2->ac3Fifo = HBFifoInit( 1024 );
         a2->rawFifo = HBFifoInit( 1 );
         a2->mp3Fifo = HBFifoInit( 1 );
     }
index d6ce22b..fb81f80 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Mpeg2Dec.c,v 1.3 2003/11/06 12:33:11 titer Exp $
+/* $Id: Mpeg2Dec.c,v 1.4 2003/11/12 21:46:59 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -169,7 +169,6 @@ static int Mpeg2DecWork( HBWork * w )
                     tmpBuffer           = HBBufferInit( rawBuffer->size );
                     tmpBuffer->position = rawBuffer->position;
                     tmpBuffer->pass     = rawBuffer->pass;
-                    tmpBuffer->last     = rawBuffer->last;
                     memcpy( tmpBuffer->data, rawBuffer->data,
                             tmpBuffer->size );
                     HBListAdd( m->rawBufferList, tmpBuffer );
index 77caa0e..f0d8e62 100644 (file)
@@ -1,10 +1,13 @@
-/* $Id: Thread.c,v 1.4 2003/11/06 15:51:36 titer Exp $
+/* $Id: Thread.c,v 1.5 2003/11/12 16:09:34 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
    It may be used under the terms of the GNU General Public License. */
 
 #include "Thread.h"
+#ifdef SYS_CYGWIN
+#  include <windows.h>
+#endif
 
 struct HBThread
 {
@@ -18,14 +21,11 @@ struct HBThread
 #elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
     pthread_t thread;
 #elif defined( SYS_CYGWIN )
-    /* TODO */
-    int       thread;
+    HANDLE    thread;
 #endif
 };
 
-#ifndef SYS_CYGWIN
 static void ThreadFunc( void * t );
-#endif
 
 HBThread * HBThreadInit( char * name, void (* function)(void *),
                          void * arg, int priority )
@@ -50,8 +50,8 @@ HBThread * HBThreadInit( char * name, void (* function)(void *),
     pthread_create( &t->thread, NULL,
                     (void * (*)( void * )) ThreadFunc, t );
 #elif defined( SYS_CYGWIN )
-    /* TODO */
-    t->thread = 0;
+    t->thread = CreateThread( NULL, 0,
+        (LPTHREAD_START_ROUTINE) ThreadFunc, t, 0, NULL );
 #endif
 
     HBLog( "HBThreadInit: thread %d started (\"%s\")",
@@ -60,7 +60,6 @@ HBThread * HBThreadInit( char * name, void (* function)(void *),
     return t;
 }
 
-#ifndef SYS_CYGWIN
 static void ThreadFunc( void * _t )
 {
     HBThread * t = (HBThread*) _t;
@@ -77,7 +76,6 @@ static void ThreadFunc( void * _t )
 
     t->function( t->arg );
 }
-#endif
 
 void HBThreadClose( HBThread ** _t )
 {
@@ -89,7 +87,7 @@ void HBThreadClose( HBThread ** _t )
 #elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
     pthread_join( t->thread, NULL );
 #elif defined( SYS_CYGWIN )
-    /* TODO */
+    WaitForSingleObject( t->thread, INFINITE );
 #endif
 
     HBLog( "HBThreadClose: thread %d stopped (\"%s\")",
index 94b3b1e..5669799 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Utils.c,v 1.7 2003/11/09 14:27:56 titer Exp $
+/* $Id: Utils.c,v 1.8 2003/11/12 16:09:34 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -7,6 +7,9 @@
 #include <stdarg.h>
 #include <time.h>
 #include <sys/time.h>
+#ifdef SYS_CYGWIN
+#  include <windows.h>
+#endif
 
 #include "Utils.h"
 #include "Fifo.h"
@@ -25,7 +28,7 @@ void HBSnooze( int time )
 #elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
     usleep( time );
 #elif defined( SYS_CYGWIN )
-    /* TODO */
+    Sleep( time / 1000 );
 #endif
 }
 
@@ -68,7 +71,7 @@ uint64_t HBGetDate()
     gettimeofday( &tv, NULL );
     return( (uint64_t) tv.tv_sec * 1000000 + (uint64_t) tv.tv_usec );
 #else
-    return 0;
+    return( 1000 * GetTickCount() );
 #endif
 }
 
index afa2fb7..435e221 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Controller.h,v 1.5 2003/11/09 19:43:06 titer Exp $
+/* $Id: Controller.h,v 1.6 2003/11/13 01:40:44 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -56,7 +56,7 @@
     IBOutlet NSTextField         * fRipStatusField;
     IBOutlet NSTextField         * fRipInfoField;
     IBOutlet NSProgressIndicator * fRipProgress;
-    IBOutlet NSButton            * fSuspendButton;
+    IBOutlet NSButton            * fPauseButton;
     IBOutlet NSButton            * fRipButton;
 
     /* "Done" alert panel */
     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
 - (void)     _Rip;
 - (IBAction) Cancel: (id) sender;
-- (IBAction) Suspend: (id) sender;
+- (void)     _Cancel: (NSWindow *) sheet returnCode: (int) returnCode
+    contextInfo: (void *) contextInfo;
+- (IBAction) Pause: (id) sender;
 - (IBAction) Resume: (id) sender;
 
 - (IBAction) PreviousPicture: (id) sender;
index 0b452bf..ea5a2c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Controller.mm,v 1.9 2003/11/09 22:06:15 titer Exp $
+/* $Id: Controller.mm,v 1.10 2003/11/13 01:40:44 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
 
 - (IBAction) Cancel: (id) sender
 {
-    HBStopRip( fHandle );
+    NSBeginCriticalAlertSheet( @"Cancel - Are you sure?",
+        @"Nooo, keep going!", @"Yep, stop it", nil, fWindow, self,
+        @selector( _Cancel:returnCode:contextInfo: ),
+        nil, nil, @"Encoding won't be recoverable." );
 }
 
-- (IBAction) Suspend: (id) sender
+- (void) _Cancel: (NSWindow *) sheet
+    returnCode: (int) returnCode contextInfo: (void *) contextInfo
+{
+    if( returnCode == NSAlertAlternateReturn )
+    {
+        HBStopRip( fHandle );
+    }
+}
+
+- (IBAction) Pause: (id) sender
 {
-    if( [[fSuspendButton title] compare: @"Resume" ] == NSOrderedSame )
+    if( [[fPauseButton title] compare: @"Resume" ] == NSOrderedSame )
     {
         [self Resume: self];
         return;
 
             /* Show the new GUI */
             [fWindow setContentView: fRipView ];
-            [fSuspendButton setEnabled: NO];
+            [fPauseButton setEnabled: NO];
             
             [fTitlePopUp removeAllItems];
             HBTitle * title;
                 [fFileFormatPopUp        setEnabled: NO];
                 [fFileField              setEnabled: NO];
                 [fFileBrowseButton       setEnabled: NO];
-                [fSuspendButton          setEnabled: YES];
-                [fSuspendButton          setTitle: @"Suspend"];
+                [fPauseButton            setEnabled: YES];
+                [fPauseButton            setTitle: @"Pause"];
                 [fRipButton              setTitle: @"Cancel"];
             }
         
             
             [fRipProgress setDoubleValue: 100 * status.position];
 
-            [fSuspendButton setTitle: @"Resume"];
+            [fPauseButton setTitle: @"Resume"];
             break;
         }
 
             [fFileFormatPopUp        setEnabled: YES];
             [fFileField              setEnabled: YES];
             [fFileBrowseButton       setEnabled: YES];
-            [fSuspendButton          setEnabled: NO];
-            [fSuspendButton          setTitle: @"Suspend"];
+            [fPauseButton            setEnabled: NO];
+            [fPauseButton            setTitle: @"Pause"];
             [fRipButton              setTitle: @"Rip"];
 
             [self VideoMatrixChanged: self];
index cc4cb2e..ce3b28a 100644 (file)
Binary files a/macosx/English.lproj/InfoPlist.strings and b/macosx/English.lproj/InfoPlist.strings differ
index 8c468d4..161d510 100644 (file)
@@ -9,13 +9,13 @@
                 Cancel = id; 
                 ClosePanel = id; 
                 NextPicture = id; 
+                Pause = id; 
                 PreviousPicture = id; 
                 Resume = id; 
                 Rip = id; 
                 Scan = id; 
                 ScanMatrixChanged = id; 
                 ShowPicturePanel = id; 
-                Suspend = id; 
                 TitlePopUpChanged = id; 
                 UpdatePicture = id; 
                 VideoMatrixChanged = id; 
@@ -42,6 +42,7 @@
                 fLeftStepper = NSStepper; 
                 fNextButton = NSButton; 
                 fOpenGLCheck = NSButton; 
+                fPauseButton = NSButton; 
                 fPictureGLView = HBPictureGLView; 
                 fPicturePanel = NSPanel; 
                 fPreviousButton = NSButton; 
@@ -59,7 +60,6 @@
                 fScanStatusField = NSTextField; 
                 fScanView = NSView; 
                 fSecondaryLanguagePopUp = NSPopUpButton; 
-                fSuspendButton = NSButton; 
                 fTargetSizeField = HBTargetSizeField; 
                 fTempView = NSView; 
                 fTitlePopUp = NSPopUpButton; 
index fddfb6a..a4c078c 100644 (file)
        <string>349.0</string>
        <key>IBOpenObjects</key>
        <array>
-               <integer>583</integer>
+               <integer>556</integer>
+               <integer>589</integer>
                <integer>365</integer>
                <integer>434</integer>
                <integer>29</integer>
-               <integer>556</integer>
+               <integer>583</integer>
                <integer>21</integer>
-               <integer>589</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>7B85</string>
+       <string>7C107</string>
 </dict>
 </plist>
index c02905a..956897b 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/objects.nib and b/macosx/English.lproj/MainMenu.nib/objects.nib differ
index b3b522b..c47e017 100644 (file)
        <key>CFBundleExecutable</key>
        <string>HandBrake</string>
        <key>CFBundleGetInfoString</key>
-       <string>HandBrake 0.5.1 - By Eric Petit &lt;titer@m0k.org&gt;</string>
+       <string>HandBrake 0.5.2 - By Eric Petit &lt;titer@m0k.org&gt;</string>
        <key>CFBundleIconFile</key>
        <string>HandBrake.icns</string>
        <key>CFBundleIdentifier</key>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>0.5.1</string>
+       <string>0.5.2</string>
        <key>CFBundleSignature</key>
        <string>HB##</string>
        <key>CFBundleVersion</key>
-       <string>0.5.1</string>
+       <string>0.5.2</string>
        <key>NSMainNibFile</key>
        <string>MainMenu</string>
        <key>NSPrincipalClass</key>
index ec576cb..d59e7ee 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: test.c,v 1.5 2003/11/06 13:28:07 titer Exp $
+/* $Id: test.c,v 1.7 2003/11/13 01:18:52 titer Exp $
 
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.m0k.org/>.
@@ -45,8 +45,11 @@ int main( int argc, char ** argv )
     /* Exit ASAP on Ctrl-C */
     signal( SIGINT,  SigHandler );
 
+    fprintf( stderr, "Welcome to HandBrake " VERSION "\n" );
+
     /* Parse command line */
-    while( ( c = getopt( argc, argv, "qd:o:t:a:b:piw:j:k:l:m:c:e:f:x" ) ) != -1 )
+    while( ( c = getopt( argc, argv,
+                         "qd:o:t:a:b:piw:j:k:l:m:c:e:f:x" ) ) != -1 )
     {
         switch( c )
         {
@@ -127,27 +130,27 @@ int main( int argc, char ** argv )
     if( !device || !file )
     {
         fprintf( stderr,
-                 "Syntax: HBTest [options] -d <device> -o <file>\n"
-                 "Possible options are :\n"
-                 "    -q           quiet output\n"
-                 "    -t <value>   select a title (default is 1)\n"
-                 "    -a <value>   primary audio channel (default is 1)\n"
-                 "    -b <value>   secondary audio channel (default is none)\n"
-                 "    -p           2-pass encoding\n"
-                 "    -i           deinterlace picture\n"
-                 "    -w           output width\n"
-                 "    -j <value>   top cropping\n"
-                 "    -k <value>   bottom cropping\n"
-                 "    -l <value>   left cropping\n"
-                 "    -m <value>   right cropping\n"
-                 "    -c <value>   CPU count (default: autodetected)\n"
-                 "    -e <value>   Video bitrate (default is 1024)\n"
-                 "    -f <value>   Audio bitrate (default is 128)\n"
-                 "    -x           Use XviD instead of Ffmpeg\n" );
+            "Syntax: HBTest [options] -d <device> -o <file>\n"
+            "Possible options are :\n"
+            "    -q           quiet output\n"
+            "    -t <value>   select a title (default is 1)\n"
+            "    -a <value>   primary audio channel (default is 1)\n"
+            "    -b <value>   secondary audio channel (default is none)\n"
+            "    -p           2-pass encoding\n"
+            "    -i           deinterlace picture\n"
+            "    -w           output width\n"
+            "    -j <value>   top cropping\n"
+            "    -k <value>   bottom cropping\n"
+            "    -l <value>   left cropping\n"
+            "    -m <value>   right cropping\n"
+            "    -c <value>   CPU count (default: autodetected)\n"
+            "    -e <value>   Video bitrate (default is 1024)\n"
+            "    -f <value>   Audio bitrate (default is 128)\n"
+            "    -x           Use XviD instead of Ffmpeg\n" );
         return 1;
     }
 
-    /* Create the manager thread */
+    /* Create the lihb thread & init things */
     h = HBInit( debug, cpuCount );
 
     while( !die )