windows + qt + dshow(COM threading model)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I want to pay your attention on this part of code:

static pj_status_t dshow_factory_init(pjmedia_vid_dev_factory *f)
{
     HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
     if (hr == RPC_E_CHANGED_MODE) {
         PJ_LOG(4,(THIS_FILE, "Failed initializing DShow: "
                              "COM library already initialized with "
                              "incompatible concurrency model"));
         return PJMEDIA_EVID_INIT;
     }

     return dshow_factory_refresh(f);
}

If you'll develop application with qt on windows you'll always have 
RPC_E_CHANGED_MODE if you put
this initializing before QApplication instance, because QApplication 
already was initialized with COINIT_APARTMENTTHREADED.

It'll be nice if you'll use the same technique as in wmme_dev;

static void get_dev_names(pjmedia_aud_dev_factory *f)
{
     ....
     coinit = CoInitializeEx(NULL, COINIT_MULTITHREADED);
     if (coinit == RPC_E_CHANGED_MODE)
     coinit = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     if (FAILED(coinit))
     goto on_error;
     ......
}

-- 
Regards,
R. Savchenko.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130829/6ba7d788/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux