Changeset 2dad070c9fadba304775b44b6e41edbf67c16784

Show
Ignore:
Timestamp:
06/01/02 16:31:32 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1022941892 +0000
git-parent:

[23379347d1a9b87795f717c9ffaee06d0b42e938]

git-author:
Sam Hocevar <sam@videolan.org> 1022941892 +0000
Message:
  • ./src/misc/beos_specific.cpp: BeOS fixes, removed a static variable.
  • ./include/main.h: replaced p_sys with explicit variables because it's
    really much simpler this way. Gildas, will you ever forgive me ? :-)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/main.h

    r9e3ab28 r2dad070  
    44 ***************************************************************************** 
    55 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 
    6  * $Id: main.h,v 1.36 2002/06/01 12:31:57 sam Exp $ 
     6 * $Id: main.h,v 1.37 2002/06/01 14:31:32 sam Exp $ 
    77 * 
    88 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    7979 
    8080    /* Private data */ 
    81     main_sys_t*            p_sys;          /* for system specific properties */ 
     81#if defined( SYS_BEOS ) 
     82    vlc_object_t           p_appthread; 
     83#elif defined( WIN32 ) 
     84    SIGNALOBJECTANDWAIT    SignalObjectAndWait; 
     85    vlc_bool_t             b_fast_pthread; 
     86#endif 
    8287}; 
    8388 
  • include/vlc_common.h

    r9e3ab28 r2dad070  
    44 ***************************************************************************** 
    55 * Copyright (C) 1998, 1999, 2000 VideoLAN 
    6  * $Id: vlc_common.h,v 1.1 2002/06/01 12:31:58 sam Exp $ 
     6 * $Id: vlc_common.h,v 1.2 2002/06/01 14:31:32 sam Exp $ 
    77 * 
    88 * Authors: Samuel Hocevar <sam@via.ecp.fr> 
     
    114114 *****************************************************************************/ 
    115115 
    116 /* System */ 
    117 VLC_DECLARE_STRUCT(main_sys) 
    118  
    119116/* Messages */ 
    120117VLC_DECLARE_STRUCT(msg_bank) 
     
    187184 * OS-specific headers and thread types 
    188185 *****************************************************************************/ 
    189 #include "os_specific.h" 
     186#if defined( WIN32 ) 
     187#   define WIN32_LEAN_AND_MEAN 
     188#   include <windows.h> 
     189    typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT)( HANDLE, HANDLE, DWORD, BOOL ); 
     190#endif 
     191 
    190192#include "vlc_threads.h" 
    191193 
  • include/win32_specific.h

    r9e3ab28 r2dad070  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: win32_specific.h,v 1.3 2002/06/01 12:31:58 sam Exp $ 
     5 * $Id: win32_specific.h,v 1.4 2002/06/01 14:31:32 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    2323 *****************************************************************************/ 
    2424 
    25 #define WIN32_LEAN_AND_MEAN 
    26 #include <windows.h> 
    27  
    28 typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT)( HANDLE, HANDLE, DWORD, BOOL ); 
    29  
    30 /***************************************************************************** 
    31  * main_sys_t: system specific descriptor 
    32  ***************************************************************************** 
    33  * This structure is a system specific descriptor. It describes the Win32 
    34  * properties of the program. 
    35  *****************************************************************************/ 
    36 struct main_sys_s 
    37 { 
    38     SIGNALOBJECTANDWAIT SignalObjectAndWait; 
    39     vlc_bool_t b_fast_pthread; 
    40 }; 
    41  
  • src/libvlc.c

    r9e3ab28 r2dad070  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2001 VideoLAN 
    7  * $Id: libvlc.c,v 1.1 2002/06/01 12:32:01 sam Exp $ 
     7 * $Id: libvlc.c,v 1.2 2002/06/01 14:31:32 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    6666 
    6767#include "vlc_cpu.h"                                        /* CPU detection */ 
     68#include "os_specific.h" 
    6869 
    6970#include "netutils.h"                                 /* network_ChannelJoin */ 
  • src/misc/beos_specific.cpp

    r2337934 r2dad070  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: beos_specific.cpp,v 1.20 2002/06/01 13:52:24 sam Exp $ 
     5 * $Id: beos_specific.cpp,v 1.21 2002/06/01 14:31:32 sam Exp $ 
    66 * 
    77 * Authors: Jean-Marc Dressler <polux@via.ecp.fr> 
     
    4040{ 
    4141public: 
    42     vlc_object_t *p_object
     42    vlc_object_t *p_this
    4343 
    4444    VlcApplication(char* ); 
     
    5353 *****************************************************************************/ 
    5454static char *         psz_program_path; 
    55 static vlc_object_t * p_appthread; 
    5655 
    5756extern "C" 
     
    6867void system_Init( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[] ) 
    6968{ 
    70     p_appthread = vlc_object_create( p_this, sizeof(vlc_object_t) ); 
     69    p_this->p_vlc->p_appthread = 
     70            (vlc_object_t *)vlc_object_create( p_this, sizeof(vlc_object_t) ); 
    7171 
    7272    /* Create the BApplication thread and wait for initialization */ 
    73     vlc_thread_create( p_appthread, "app thread", AppThread, 1 ); 
    74  
    75     vlc_object_attach( p_appthread, p_this->p_vlc ); 
     73    vlc_thread_create( p_this->p_vlc->p_appthread, "app thread", AppThread, 1 ); 
    7674} 
    7775 
     
    8987void system_End( vlc_object_t *p_this ) 
    9088{ 
    91     vlc_object_unlink_all( p_appthread ); 
    92  
    9389    /* Tell the BApplication to die */ 
    9490    be_app->PostMessage( B_QUIT_REQUESTED ); 
    95     vlc_thread_join( p_appthread ); 
    9691 
    97     vlc_object_destroy( p_appthread ); 
     92    vlc_thread_join( p_this->p_vlc->p_appthread ); 
     93    vlc_object_destroy( p_this->p_vlc->p_appthread ); 
    9894 
    9995    free( psz_program_path ); 
     
    111107 
    112108/***************************************************************************** 
    113  * system_AppThread: the BApplication thread. 
     109 * AppThread: the BApplication thread. 
    114110 *****************************************************************************/ 
    115 static void system_AppThread( void * args ) 
     111static void AppThread( vlc_object_t * p_this ) 
    116112{ 
    117113    VlcApplication *BeApp = new VlcApplication("application/x-vnd.Ink-vlc"); 
     114    vlc_object_attach( p_this, p_this->p_vlc ); 
     115    BeApp->p_this = p_this; 
    118116    BeApp->Run(); 
     117    vlc_object_unlink_all( p_this ); 
    119118    delete BeApp; 
    120119} 
     
    167166 
    168167    /* Tell the main thread we are finished initializing the BApplication */ 
    169     vlc_thread_ready( p_appthread ); 
     168    vlc_thread_ready( p_this ); 
    170169} 
    171170 
  • src/misc/threads.c

    r9e3ab28 r2dad070  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 
    5  * $Id: threads.c,v 1.1 2002/06/01 12:32:01 sam Exp $ 
     5 * $Id: threads.c,v 1.2 2002/06/01 14:31:32 sam Exp $ 
    66 * 
    77 * Authors: Jean-Marc Dressler <polux@via.ecp.fr> 
     
    174174     * As this function is not available on Win9x, we can use the faster 
    175175     * CriticalSections */ 
    176     if( (GetVersion() < 0x80000000) && !p_this->p_vlc->p_sys->b_fast_pthread ) 
     176    if( (GetVersion() < 0x80000000) && !p_this->p_vlc->b_fast_pthread ) 
    177177    { 
    178178        /* We are running on NT/2K/XP, we can use SignalObjectAndWait */ 
    179179        p_mutex->mutex = CreateMutex( 0, FALSE, 0 ); 
    180         p_mutex->SignalObjectAndWait = 
    181                             p_this->p_vlc->p_sys->SignalObjectAndWait; 
     180        p_mutex->SignalObjectAndWait = p_this->p_vlc->SignalObjectAndWait; 
    182181        return ( p_mutex->mutex ? 0 : 1 ); 
    183182    } 
  • src/misc/win32_specific.c

    r9e3ab28 r2dad070  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: win32_specific.c,v 1.8 2002/06/01 12:32:02 sam Exp $ 
     5 * $Id: win32_specific.c,v 1.9 2002/06/01 14:31:32 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    4040    HINSTANCE hInstLib; 
    4141 
    42     /* Allocate structure */ 
    43     p_this->p_vlc->p_sys = malloc( sizeof( main_sys_t ) ); 
    44     if( p_this->p_vlc->p_sys == NULL ) 
    45     { 
    46         fprintf( stderr, "error: out of memory\n" ); 
    47         exit(-1); 
    48     } 
    49  
    5042    /* dynamically get the address of SignalObjectAndWait */ 
    5143    hInstLib = LoadLibrary( "kernel32" ); 
    52     p_this->p_vlc->p_sys->SignalObjectAndWait = 
     44    p_this->p_vlc->SignalObjectAndWait = 
    5345        (SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib, "SignalObjectAndWait" ); 
    5446 
     
    6961void system_Configure( vlc_object_t *p_this ) 
    7062{ 
    71     p_this->p_vlc->p_sys->b_fast_pthread = config_GetInt( p_this, 
    72                                                   "fast_pthread" ); 
     63    p_this->p_vlc->b_fast_pthread = config_GetInt( p_this, "fast_pthread" ); 
    7364} 
    7465