]> git.sesse.net Git - vlc/commitdiff
* MacOS X port :
authorChristophe Massiot <massiot@videolan.org>
Thu, 25 Apr 2002 23:07:23 +0000 (23:07 +0000)
committerChristophe Massiot <massiot@videolan.org>
Thu, 25 Apr 2002 23:07:23 +0000 (23:07 +0000)
- New creator ID : VLC#
- Borders in fullscreen mode are now black and the movie is centered
  (jlj P0\/\/3r)
- A/V sync should be much more precise

Makefile
extras/MacOSX/vlc.pbproj/project.pbxproj
plugins/macosx/aout_macosx.c
plugins/macosx/macosx.h
plugins/macosx/vout_macosx.c
plugins/macosx/vout_qdview.c

index 9b9492a0638cfbee4372b1caca5c4e0172aa9ac4..0b9a23355dc5e72585bb07a128ee5ebfd3945b41 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -456,7 +456,7 @@ package-macosx:
 
        # Copy relevant files 
        cp -R vlc.app tmp/
-       cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/
+       cp AUTHORS COPYING ChangeLog README README\ -\ Mac\ OS\ X.rtf FAQ TODO tmp/
 
        # Create disk image 
        ./macosx-dmg 0 "vlc-${VERSION}" tmp/* 
index 3cd768fe7722c9407fd70c468b1704ecd72e7ecf..86d74ce954aa3d8870a30ee14f4194081ce2af40 100644 (file)
                        <key>CFBundleTypeRole</key>
                        <string>Viewer</string>
                </dict>
+               <dict>
+                       <key>CFBundleTypeExtensions</key>
+                       <array>
+                               <string>mpg</string>
+                               <string>mpeg</string>
+                       </array>
+                       <key>CFBundleTypeIconFile</key>
+                       <string>vlc.icns</string>
+                       <key>CFBundleTypeName</key>
+                       <string>MPEG file</string>
+                       <key>CFBundleTypeRole</key>
+                       <string>Viewer</string>
+               </dict>
+               <dict>
+                       <key>CFBundleTypeExtensions</key>
+                       <array>
+                               <string>avi</string>
+                               <string>asf</string>
+                       </array>
+                       <key>CFBundleTypeIconFile</key>
+                       <string>vlc.icns</string>
+                       <key>CFBundleTypeName</key>
+                       <string>DivX</string>
+                       <key>CFBundleTypeRole</key>
+                       <string>Viewer</string>
+               </dict>
        </array>
        <key>CFBundleExecutable</key>
        <string>vlc</string>
        <key>CFBundleGetInfoString</key>
-       <string>VideoLan Client</string>
+       <string>VideoLAN Client</string>
        <key>CFBundleIconFile</key>
        <string>vlc.icns</string>
        <key>CFBundleIdentifier</key>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>vlc 0.2.90</string>
+       <string>vlc 0.3.1</string>
+       <key>CFBundleSignature</key>
+       <string>VLC#</string>
        <key>CFBundleVersion</key>
-       <string>0.2.90</string>
+       <string>0.3.1</string>
        <key>NSMainNibFile</key>
        <string>MainMenu</string>
        <key>NSPrincipalClass</key>
index ece80443dd43f899c9492963f54865664ce23ed8..0a8c179b601c4f477d698d19373b4120f09c0072 100644 (file)
@@ -2,7 +2,7 @@
  * aout_macosx.c : CoreAudio output plugin
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: aout_macosx.c,v 1.17 2002/03/27 22:15:40 massiot Exp $
+ * $Id: aout_macosx.c,v 1.18 2002/04/25 23:07:23 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -38,6 +38,7 @@
 
 #include <Carbon/Carbon.h>
 #include <CoreAudio/AudioHardware.h>
+#include <CoreAudio/HostTime.h>
 #include <AudioToolbox/AudioConverter.h>
 
 /*****************************************************************************
@@ -60,6 +61,7 @@ typedef struct aout_sys_s
     boolean_t           b_buffer_data;  // available buffer data?
     vlc_mutex_t         mutex_lock;     // pthread locks for sync of
     vlc_cond_t          cond_sync;      // aout_Play and callback
+    mtime_t             clock_diff;     // diff between system clock & audio
 } aout_sys_t;
 
 /*****************************************************************************
@@ -145,6 +147,7 @@ static int aout_Open( aout_thread_t *p_aout )
         intf_ErrMsg( "aout error: failed to get device buffer size: %d", err );
         return( -1 );
     }
+    p_aout->i_latency = p_aout->p_sys->ui_buffer_size;
 
     /* get a description of the data format used by the device */
     ui_param_size = sizeof( p_aout->p_sys->s_dst_stream_format ); 
@@ -322,7 +325,15 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice,
                               const AudioTimeStamp *inOutputTime, 
                               void *threadGlobals )
 {
-    aout_sys_t *p_sys = (aout_sys_t *)threadGlobals;
+    aout_thread_t *p_aout = (aout_thread_t *)threadGlobals;
+    aout_sys_t *p_sys = p_aout->p_sys;
+#if 0
+    AudioTimeStamp host_time;
+
+    host_time.mFlags = kAudioTimeStampHostTimeValid;
+    AudioDeviceTranslateTime( inDevice, inOutputTime, &host_time );
+    intf_Msg( "%lld", AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000 + p_aout->p_sys->clock_diff - p_aout->date );
+#endif
 
     /* see aout_Play below */
     vlc_mutex_lock( &p_sys->mutex_lock );
@@ -445,7 +456,7 @@ static int CABeginFormat( aout_thread_t *p_aout )
     /* add callback */
     err = AudioDeviceAddIOProc( p_aout->p_sys->device, 
                                 (AudioDeviceIOProc)CAIOCallback, 
-                                (void *)p_aout->p_sys );
+                                (void *)p_aout );
 
     if( err != noErr )
     {
@@ -467,6 +478,10 @@ static int CABeginFormat( aout_thread_t *p_aout )
         return( 1 );
     }
 
+    /* Let's pray for the following operation to be atomic... */
+    p_aout->p_sys->clock_diff = mdate()
+         - AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()) / 1000;
+
     p_aout->p_sys->b_format = 1;
 
     return( 0 );
index 266775729dcf40921a5caf03157bf816a54f2d9f..17a60a5733f0adad29f4dd1167efac026473dc33 100644 (file)
@@ -2,7 +2,7 @@
  * macosx.h: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: macosx.h,v 1.6 2002/04/17 23:03:35 massiot Exp $
+ * $Id: macosx.h,v 1.7 2002/04/25 23:07:23 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
@@ -57,7 +57,6 @@ typedef struct vout_sys_s
     CGrafPtr p_qdport;
     ImageSequence i_seq;
     MatrixRecordPtr p_matrix;
-    Rect display_rect;
     DecompressorComponent img_dc;
     ImageDescriptionHandle h_img_descr;
 } vout_sys_t;
index a79a0c7a3d7a668a5cfe8dce383655bc7aeebf66..fd573063d6a304919f88a8c388fd54251038085e 100644 (file)
@@ -513,8 +513,8 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
 static void QTScaleMatrix( vout_thread_t *p_vout )
 {
     Rect s_rect;
-    Fixed factor_x;
-    Fixed factor_y;
+    Fixed factor_x, factor_y;
+    Fixed offset_x, offset_y;
 
     GetPortBounds( p_vout->p_sys->p_qdport, &s_rect );
 
@@ -526,13 +526,11 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
                            Long2Fix( p_vout->output.i_width ) );
         factor_y = FixDiv( Long2Fix( s_rect.bottom - s_rect.top ),
                            Long2Fix( p_vout->output.i_height ) );
-#if 0
-        p_vout->p_sys->display_rect.top = 0;
-        p_vout->p_sys->display_rect.bottom = s_rect.bottom - s_rect.top;
-        p_vout->p_sys->display_rect.left = 12;
-        p_vout->p_sys->display_rect.right = 12 + (s_rect.bottom - s_rect.top)
-                            * p_vout->output.i_aspect / VOUT_ASPECT_FACTOR;
-#endif
+        offset_x = FixDiv( Long2Fix( s_rect.right - s_rect.left
+                            - (s_rect.bottom - s_rect.top)
+                            * p_vout->output.i_aspect / VOUT_ASPECT_FACTOR ),
+                           Long2Fix( 2 ) );
+        offset_y = Long2Fix( 0 );
     }
     else
     {
@@ -541,19 +539,18 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
         factor_y = FixDiv( Long2Fix( (s_rect.right - s_rect.left)
                             * VOUT_ASPECT_FACTOR / p_vout->output.i_aspect ),
                            Long2Fix( p_vout->output.i_height ) );
-#if 0
-        p_vout->p_sys->display_rect.top = 12;
-        p_vout->p_sys->display_rect.bottom = 12 + (s_rect.right - s_rect.left)
-                            * VOUT_ASPECT_FACTOR / p_vout->output.i_aspect;
-        p_vout->p_sys->display_rect.left = 0;
-        p_vout->p_sys->display_rect.right = s_rect.right - s_rect.left;
-#endif
+        offset_x = Long2Fix( 0 );
+        offset_y = FixDiv( Long2Fix( s_rect.bottom - s_rect.top
+                            - (s_rect.right - s_rect.left)
+                            * VOUT_ASPECT_FACTOR / p_vout->output.i_aspect ),
+                           Long2Fix( 2 ) );
     }
 
     SetIdentityMatrix( p_vout->p_sys->p_matrix );
     ScaleMatrix( p_vout->p_sys->p_matrix,
                  factor_x, factor_y,
                  Long2Fix(0), Long2Fix(0) );            
+    TranslateMatrix( p_vout->p_sys->p_matrix, offset_x, offset_y );
 }
 
 /*****************************************************************************
index af8acfe2594ed0d6ead7fcef0e1148a51cf06b71..60f738c9298977a192ea1ef10a50c3970398af8a 100644 (file)
@@ -2,7 +2,7 @@
  * vout_qdview.c: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vout_qdview.c,v 1.2 2002/03/19 03:33:52 jlj Exp $
+ * $Id: vout_qdview.c,v 1.3 2002/04/25 23:07:23 massiot Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -49,6 +49,8 @@
 {
     [super drawRect: rect];
     [o_wrapper voutDidResize: p_vout];
+    [[NSColor blackColor] set];
+    NSRectFill(rect);
 }
 
 @end