Commit 848637d0 authored by Christophe Massiot's avatar Christophe Massiot

* MacOS X port :

- 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
parent eb1ec4a4
...@@ -456,7 +456,7 @@ package-macosx: ...@@ -456,7 +456,7 @@ package-macosx:
# Copy relevant files # Copy relevant files
cp -R vlc.app tmp/ 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 # Create disk image
./macosx-dmg 0 "vlc-${VERSION}" tmp/* ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
......
...@@ -213,11 +213,37 @@ ...@@ -213,11 +213,37 @@
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Viewer</string> <string>Viewer</string>
</dict> </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> </array>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>vlc</string> <string>vlc</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>VideoLan Client</string> <string>VideoLAN Client</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>vlc.icns</string> <string>vlc.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
...@@ -229,9 +255,11 @@ ...@@ -229,9 +255,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>vlc 0.2.90</string> <string>vlc 0.3.1</string>
<key>CFBundleSignature</key>
<string>VLC#</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.2.90</string> <string>0.3.1</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_macosx.c : CoreAudio output plugin * aout_macosx.c : CoreAudio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#include <CoreAudio/AudioHardware.h> #include <CoreAudio/AudioHardware.h>
#include <CoreAudio/HostTime.h>
#include <AudioToolbox/AudioConverter.h> #include <AudioToolbox/AudioConverter.h>
/***************************************************************************** /*****************************************************************************
...@@ -60,6 +61,7 @@ typedef struct aout_sys_s ...@@ -60,6 +61,7 @@ typedef struct aout_sys_s
boolean_t b_buffer_data; // available buffer data? boolean_t b_buffer_data; // available buffer data?
vlc_mutex_t mutex_lock; // pthread locks for sync of vlc_mutex_t mutex_lock; // pthread locks for sync of
vlc_cond_t cond_sync; // aout_Play and callback vlc_cond_t cond_sync; // aout_Play and callback
mtime_t clock_diff; // diff between system clock & audio
} aout_sys_t; } aout_sys_t;
/***************************************************************************** /*****************************************************************************
...@@ -145,6 +147,7 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -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 ); intf_ErrMsg( "aout error: failed to get device buffer size: %d", err );
return( -1 ); return( -1 );
} }
p_aout->i_latency = p_aout->p_sys->ui_buffer_size;
/* get a description of the data format used by the device */ /* get a description of the data format used by the device */
ui_param_size = sizeof( p_aout->p_sys->s_dst_stream_format ); ui_param_size = sizeof( p_aout->p_sys->s_dst_stream_format );
...@@ -322,7 +325,15 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice, ...@@ -322,7 +325,15 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice,
const AudioTimeStamp *inOutputTime, const AudioTimeStamp *inOutputTime,
void *threadGlobals ) 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 */ /* see aout_Play below */
vlc_mutex_lock( &p_sys->mutex_lock ); vlc_mutex_lock( &p_sys->mutex_lock );
...@@ -445,7 +456,7 @@ static int CABeginFormat( aout_thread_t *p_aout ) ...@@ -445,7 +456,7 @@ static int CABeginFormat( aout_thread_t *p_aout )
/* add callback */ /* add callback */
err = AudioDeviceAddIOProc( p_aout->p_sys->device, err = AudioDeviceAddIOProc( p_aout->p_sys->device,
(AudioDeviceIOProc)CAIOCallback, (AudioDeviceIOProc)CAIOCallback,
(void *)p_aout->p_sys ); (void *)p_aout );
if( err != noErr ) if( err != noErr )
{ {
...@@ -467,6 +478,10 @@ static int CABeginFormat( aout_thread_t *p_aout ) ...@@ -467,6 +478,10 @@ static int CABeginFormat( aout_thread_t *p_aout )
return( 1 ); 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; p_aout->p_sys->b_format = 1;
return( 0 ); return( 0 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* macosx.h: MacOS X plugin for vlc * macosx.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu> * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
...@@ -57,7 +57,6 @@ typedef struct vout_sys_s ...@@ -57,7 +57,6 @@ typedef struct vout_sys_s
CGrafPtr p_qdport; CGrafPtr p_qdport;
ImageSequence i_seq; ImageSequence i_seq;
MatrixRecordPtr p_matrix; MatrixRecordPtr p_matrix;
Rect display_rect;
DecompressorComponent img_dc; DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr; ImageDescriptionHandle h_img_descr;
} vout_sys_t; } vout_sys_t;
......
...@@ -513,8 +513,8 @@ static int CoToggleFullscreen( vout_thread_t *p_vout ) ...@@ -513,8 +513,8 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
static void QTScaleMatrix( vout_thread_t *p_vout ) static void QTScaleMatrix( vout_thread_t *p_vout )
{ {
Rect s_rect; Rect s_rect;
Fixed factor_x; Fixed factor_x, factor_y;
Fixed factor_y; Fixed offset_x, offset_y;
GetPortBounds( p_vout->p_sys->p_qdport, &s_rect ); GetPortBounds( p_vout->p_sys->p_qdport, &s_rect );
...@@ -526,13 +526,11 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -526,13 +526,11 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
Long2Fix( p_vout->output.i_width ) ); Long2Fix( p_vout->output.i_width ) );
factor_y = FixDiv( Long2Fix( s_rect.bottom - s_rect.top ), factor_y = FixDiv( Long2Fix( s_rect.bottom - s_rect.top ),
Long2Fix( p_vout->output.i_height ) ); Long2Fix( p_vout->output.i_height ) );
#if 0 offset_x = FixDiv( Long2Fix( s_rect.right - s_rect.left
p_vout->p_sys->display_rect.top = 0; - (s_rect.bottom - s_rect.top)
p_vout->p_sys->display_rect.bottom = s_rect.bottom - s_rect.top; * p_vout->output.i_aspect / VOUT_ASPECT_FACTOR ),
p_vout->p_sys->display_rect.left = 12; Long2Fix( 2 ) );
p_vout->p_sys->display_rect.right = 12 + (s_rect.bottom - s_rect.top) offset_y = Long2Fix( 0 );
* p_vout->output.i_aspect / VOUT_ASPECT_FACTOR;
#endif
} }
else else
{ {
...@@ -541,19 +539,18 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -541,19 +539,18 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
factor_y = FixDiv( Long2Fix( (s_rect.right - s_rect.left) factor_y = FixDiv( Long2Fix( (s_rect.right - s_rect.left)
* VOUT_ASPECT_FACTOR / p_vout->output.i_aspect ), * VOUT_ASPECT_FACTOR / p_vout->output.i_aspect ),
Long2Fix( p_vout->output.i_height ) ); Long2Fix( p_vout->output.i_height ) );
#if 0 offset_x = Long2Fix( 0 );
p_vout->p_sys->display_rect.top = 12; offset_y = FixDiv( Long2Fix( s_rect.bottom - s_rect.top
p_vout->p_sys->display_rect.bottom = 12 + (s_rect.right - s_rect.left) - (s_rect.right - s_rect.left)
* VOUT_ASPECT_FACTOR / p_vout->output.i_aspect; * VOUT_ASPECT_FACTOR / p_vout->output.i_aspect ),
p_vout->p_sys->display_rect.left = 0; Long2Fix( 2 ) );
p_vout->p_sys->display_rect.right = s_rect.right - s_rect.left;
#endif
} }
SetIdentityMatrix( p_vout->p_sys->p_matrix ); SetIdentityMatrix( p_vout->p_sys->p_matrix );
ScaleMatrix( p_vout->p_sys->p_matrix, ScaleMatrix( p_vout->p_sys->p_matrix,
factor_x, factor_y, factor_x, factor_y,
Long2Fix(0), Long2Fix(0) ); Long2Fix(0), Long2Fix(0) );
TranslateMatrix( p_vout->p_sys->p_matrix, offset_x, offset_y );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_qdview.c: MacOS X plugin for vlc * vout_qdview.c: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
{ {
[super drawRect: rect]; [super drawRect: rect];
[o_wrapper voutDidResize: p_vout]; [o_wrapper voutDidResize: p_vout];
[[NSColor blackColor] set];
NSRectFill(rect);
} }
@end @end
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