Bug in dshow_factory_create_stream in dshow_dev.c in Windows (exception)

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

 



Hi ,

By default DShow will try to initialise in multithreaded mode, and
should it fail, use the apartment threaded mode. One of the limitation
of this is noted in r4951 (in dshow_dev.c,
http://trac.pjsip.org/repos/changeset/4951):

"When using apartment mode, Dshow object would not be accessible from
other thread.
       hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
"
So, app needs to do the initialisation in the same thread.

Regards,
Ming

On Wed, Nov 12, 2014 at 11:26 PM, ????? ???????? <rota2000.1 at gmail.com> wrote:
> I tried to make video call (with auto show and transmit) and have an
> exception of read adress 0x00000000 in dshow_factory_create_stream function
> on
>     dshow_stream_destroy((pjmedia_vid_dev_stream *)strm);
> line.
>
> I started to debug and found out that in function create_filter_graph in
> line
>     hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC,
> &IID_IFilterGraph, (LPVOID *)&graph->filter_graph);
> we have hr = 0x800401F0 (need to run CoInitialize). So I add the followinf
> after it
>     if (hr == 0x800401F0)
>     {
>         // retry
>         CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
>         hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC,
> &IID_IFilterGraph, (LPVOID *)&graph->filter_graph);
>     }
>
>  And it started to work fine.
> So I think that function dshow_factory_create_stream is called from other
> thread, where was not CoInialized run.
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[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