Changeset 763b6733737946e6527ce6bc4a803dccd04de834

Show
Ignore:
Timestamp:
06/14/08 10:09:05 (3 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1213430945 +0200
git-parent:

[30b36a445eb2607bb808b10c1e68d11489f3cec4]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1213083809 +0200
Message:

Remove VLCPlugin::getVLCObject() methond from ActiveX

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/activex/plugin.cpp

    r04e7bd8 r763b673  
    411411}; 
    412412 
    413 HRESULT VLCPlugin::getVLCObject(int* i_vlc) 
    414 { 
    415     libvlc_instance_t *p_libvlc; 
    416     HRESULT result = getVLC(&p_libvlc); 
    417     if( SUCCEEDED(result) ) 
    418     { 
    419         *i_vlc = libvlc_get_vlc_id(p_libvlc); 
    420     } 
    421     else 
    422     { 
    423         *i_vlc = 0; 
    424     } 
    425     return result; 
    426 } 
    427  
    428413HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc) 
    429414{ 
     
    486471        ppsz_argv[ppsz_argc++] = "--no-stats"; 
    487472        ppsz_argv[ppsz_argc++] = "--no-media-library"; 
     473        ppsz_argv[ppsz_argc++] = "--ignore-config"; 
    488474        ppsz_argv[ppsz_argc++] = "--intf=dummy"; 
    489475 
     
    492478            ppsz_argv[ppsz_argc++] = "--loop"; 
    493479 
    494         _p_libvlc = libvlc_new(ppsz_argc, ppsz_argv, NULL); 
    495         if( NULL == _p_libvlc ) 
     480        libvlc_exception_t ex; 
     481        libvlc_exception_init(&ex); 
     482 
     483        _p_libvlc = libvlc_new(ppsz_argc, ppsz_argv, &ex); 
     484        if( libvlc_exception_raised(&ex) ) 
    496485        { 
    497486            *pp_libvlc = NULL; 
     487            libvlc_exception_clear(&ex); 
    498488            return E_FAIL; 
    499489        } 
     
    669659        vlcDataObject->onClose(); 
    670660 
    671         libvlc_release(p_libvlc); 
     661        if( p_libvlc ) 
     662            libvlc_release(p_libvlc); 
    672663    } 
    673664    return S_OK; 
  • projects/activex/plugin.h

    r30b36a4 r763b673  
    2828 
    2929#include <vlc/vlc.h> 
    30 #include <vlc/libvlc.h> 
    3130 
    3231extern "C" const GUID CLSID_VLCPlugin; 
     
    195194 
    196195    inline BOOL isRunning(void) { return NULL != _p_libvlc; }; 
    197     HRESULT getVLCObject(int *i_vlc); 
    198196    HRESULT getVLC(libvlc_instance_t** p_vlc); 
    199197    void setErrorInfo(REFIID riid, const char *description); 
  • projects/activex/vlccontrol.cpp

    r449fd28 r763b673  
    124124STDMETHODIMP VLCControl::play(void) 
    125125{ 
    126     int i_vlc; 
    127     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     126    libvlc_instance_t *p_libvlc; 
     127    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    128128    if( SUCCEEDED(result) ) 
    129129    { 
     
    136136STDMETHODIMP VLCControl::pause(void) 
    137137{ 
    138     int i_vlc; 
    139     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     138    libvlc_instance_t *p_libvlc; 
     139    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    140140    if( SUCCEEDED(result) ) 
    141141    { 
     
    148148STDMETHODIMP VLCControl::stop(void) 
    149149{ 
    150     int i_vlc; 
    151     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     150    libvlc_instance_t *p_libvlc; 
     151    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    152152    if( SUCCEEDED(result) ) 
    153153    { 
     
    166166    if( _p_instance->isRunning() ) 
    167167    { 
    168         int i_vlc; 
    169         result = _p_instance->getVLCObject(&i_vlc); 
     168        libvlc_instance_t *p_libvlc; 
     169        result = _p_instance->getVLC(&p_libvlc); 
    170170        if( SUCCEEDED(result) ) 
    171171        { 
    172             *isPlaying = VLC_IsPlaying(i_vlc) ? VARIANT_TRUE : VARIANT_FALSE; 
     172            if( libvlc_playlist_isplaying(p_libvlc, NULL) ) 
     173                *isPlaying = VARIANT_TRUE; 
     174            else 
     175                *isPlaying = VARIANT_FALSE; 
    173176            return NOERROR; 
    174177        } 
     
    186189    if( _p_instance->isRunning() ) 
    187190    { 
    188         int i_vlc; 
    189         result = _p_instance->getVLCObject(&i_vlc); 
     191        libvlc_instance_t *p_libvlc; 
     192        result = _p_instance->getVLC(&p_libvlc); 
    190193        if( SUCCEEDED(result) ) 
    191194        { 
     
    203206    if( _p_instance->isRunning() ) 
    204207    { 
    205         int i_vlc; 
    206         result = _p_instance->getVLCObject(&i_vlc); 
     208        libvlc_instance_t *p_libvlc; 
     209        result = _p_instance->getVLC(&p_libvlc); 
    207210        if( SUCCEEDED(result) ) 
    208211        { 
     
    221224    if( _p_instance->isRunning() ) 
    222225    { 
    223         int i_vlc; 
    224         result = _p_instance->getVLCObject(&i_vlc); 
     226        libvlc_instance_t *p_libvlc; 
     227        result = _p_instance->getVLC(&p_libvlc); 
    225228        if( SUCCEEDED(result) ) 
    226229        { 
     
    246249    if( _p_instance->isRunning() ) 
    247250    { 
    248         int i_vlc; 
    249         result = _p_instance->getVLCObject(&i_vlc); 
     251        libvlc_instance_t *p_libvlc; 
     252        result = _p_instance->getVLC(&p_libvlc); 
    250253        if( SUCCEEDED(result) ) 
    251254        { 
     
    261264    if( _p_instance->isRunning() ) 
    262265    { 
    263         int i_vlc; 
    264         result = _p_instance->getVLCObject(&i_vlc); 
     266        libvlc_instance_t *p_libvlc; 
     267        result = _p_instance->getVLC(&p_libvlc); 
    265268        if( SUCCEEDED(result) ) 
    266269        { 
    267             VLC_FullScreen(i_vlc); 
     270            if( libvlc_playlist_isplaying(p_libvlc, NULL) ) 
     271            { 
     272                libvlc_media_player_t *p_md = 
     273                    libvlc_playlist_get_media_player(p_libvlc, NULL); 
     274                if( p_md ) 
     275                { 
     276                    libvlc_toggle_fullscreen(p_md, NULL); 
     277                    libvlc_media_player_release(p_md); 
     278                } 
     279            } 
    268280        } 
    269281    } 
     
    279291    if( _p_instance->isRunning() ) 
    280292    { 
    281         int i_vlc; 
    282         result = _p_instance->getVLCObject(&i_vlc); 
     293        libvlc_instance_t *p_libvlc; 
     294        result = _p_instance->getVLC(&p_libvlc); 
    283295        if( SUCCEEDED(result) ) 
    284296        { 
     
    296308    if( _p_instance->isRunning() ) 
    297309    { 
    298         int i_vlc; 
    299         result = _p_instance->getVLCObject(&i_vlc); 
     310        libvlc_instance_t *p_libvlc; 
     311        result = _p_instance->getVLC(&p_libvlc); 
    300312        if( SUCCEEDED(result) ) 
    301313        { 
     
    311323    if( _p_instance->isRunning() ) 
    312324    { 
    313         int i_vlc; 
    314         result = _p_instance->getVLCObject(&i_vlc); 
     325        libvlc_instance_t *p_libvlc; 
     326        result = _p_instance->getVLC(&p_libvlc); 
    315327        if( SUCCEEDED(result) ) 
    316328        { 
     
    338350STDMETHODIMP VLCControl::toggleMute(void) 
    339351{ 
    340     int i_vlc; 
    341     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     352    libvlc_instance_t *p_libvlc; 
     353    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    342354    if( SUCCEEDED(result) ) 
    343355    { 
     
    352364        return E_INVALIDARG; 
    353365 
    354     int i_vlc; 
    355     HRESULT hr = _p_instance->getVLCObject(&i_vlc); 
     366    libvlc_instance_t *p_libvlc; 
     367    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    356368    if( SUCCEEDED(hr) ) 
    357369    { 
     
    467479        return E_INVALIDARG; 
    468480 
    469     int i_vlc; 
    470     HRESULT hr = _p_instance->getVLCObject(&i_vlc); 
     481    libvlc_instance_t *p_libvlc; 
     482    HRESULT hr = _p_instance->getVLC(&p_libvlc); 
    471483    if( SUCCEEDED(hr) ) 
    472484    { 
     
    854866        return E_INVALIDARG; 
    855867 
    856     int i_vlc; 
    857     HRESULT hr = _p_instance->getVLCObject(&i_vlc); 
     868    libvlc_instance_t *p_libvlc; 
     869    HRESULT hr = _p_instance->getVLC(&p_libvlc); 
    858870    if( SUCCEEDED(hr) ) 
    859871    { 
     
    892904        return E_POINTER; 
    893905 
    894     int i_vlc; 
    895     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     906    libvlc_instance_t *p_libvlc; 
     907    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    896908    if( SUCCEEDED(result) ) 
    897909    { 
     
    905917STDMETHODIMP VLCControl::get_PlaylistCount(int *count) 
    906918{ 
    907     int i_vlc; 
    908     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     919    libvlc_instance_t *p_libvlc; 
     920    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    909921    if( SUCCEEDED(result) ) 
    910922    { 
     
    918930STDMETHODIMP VLCControl::playlistNext(void) 
    919931{ 
    920     int i_vlc; 
    921     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     932    libvlc_instance_t *p_libvlc; 
     933    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    922934    if( SUCCEEDED(result) ) 
    923935    { 
     
    930942STDMETHODIMP VLCControl::playlistPrev(void) 
    931943{ 
    932     int i_vlc; 
    933     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     944    libvlc_instance_t *p_libvlc; 
     945    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    934946    if( SUCCEEDED(result) ) 
    935947    { 
     
    942954STDMETHODIMP VLCControl::playlistClear(void) 
    943955{ 
    944     int i_vlc; 
    945     HRESULT result = _p_instance->getVLCObject(&i_vlc); 
     956    libvlc_instance_t *p_libvlc; 
     957    HRESULT result = _p_instance->getVLC(&p_libvlc); 
    946958    if( SUCCEEDED(result) ) 
    947959    { 
     
    957969        return E_POINTER; 
    958970 
    959     const char *versionStr = VLC_Version(); 
     971    const char *versionStr = libvlc_get_version(); 
    960972    if( NULL != versionStr ) 
    961973    { 
    962974        *version = BSTRFromCStr(CP_UTF8, versionStr); 
    963   
     975 
    964976        return NULL == *version ? E_OUTOFMEMORY : NOERROR; 
    965977    }