Changeset 4951


Ignore:
Timestamp:
Oct 17, 2014 3:47:40 AM (5 years ago)
Author:
riza
Message:

Misc (re #1782): Fixed initialize Dshow failed when the COM library already initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/dshow_dev.c

    r4922 r4951  
    215215{ 
    216216    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); 
    217     if (hr == RPC_E_CHANGED_MODE) { 
    218         PJ_LOG(4,(THIS_FILE, "Failed initializing DShow: " 
    219                              "COM library already initialized with " 
    220                              "incompatible concurrency model")); 
    221         return PJMEDIA_EVID_INIT; 
     217    if (hr == RPC_E_CHANGED_MODE) {      
     218        /* When using apartment mode, Dshow object would not be accessible from  
     219         * other thread. Take this into consideration when implementing native 
     220         * renderer using Dshow.  
     221         */ 
     222        hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); 
     223        if (FAILED(hr)) { 
     224            PJ_LOG(4,(THIS_FILE, "Failed initializing DShow: " 
     225                                 "COM library already initialized with " 
     226                                 "incompatible concurrency model")); 
     227            return PJMEDIA_EVID_INIT; 
     228        } 
    222229    } 
    223230 
Note: See TracChangeset for help on using the changeset viewer.