none
USB Camera in WEC7 can't show Video Render RRS feed

  • Question

  • Dear Experts,
    OS: WinEC7 , Platform: arm/freescale i.mx53 custom board, 512MB RAM

    I am trying to use USB Camera driver in WEC7.
    Here is the reference link which tell us how to use WCE6 USB camera driver in WEC7:
    http://www.e-consystems.com/blog/windowsce/?p=777

    My usb camera works well in OMAP WinCE 6 platform.
    But in WEC7, this usb camera only can work if I unselected VideoRenderer.
    When I remove (unselected) Video Renderer in CameraDshowApp, I can capture still image and record video.
    If I selected VideoRender in CameraDshowApp, it will show a still image on screen and suddenly turn off CameraDshowApp.

    (CameraDshowApp is the default camera app that provided by MS, same app can work well in WCE6)
    CameraDshowApp - unselected VideoRender

    https://www.dropbox.com/s/53g6hrha8q4emtx/DSC_0737.JPG

    Belows is the log message when I execute CameraDshowApp with selected VideoRenderer.
    Could anyone tell me how to resolve this issue ?!! thx ~

    ===== log message when I execute CameraDshowApp with selected VideoRenderer ====   

    Exception 'Data Abort' (0x4): Thread-Id=06a9007e(pth=c
    082ed90), Proc-Id=06700072(pprc=c08ab000) 'CameraDshowApp_Default.exe', VM-activ
    e=06700072(pprc=c08ab000) 'CameraDshowApp_Default.exe'
    PID:06700072 TID:06A9007E PC=42fa234c(quartz.dll+0x0010234c) RA=00000068(???+0x0
    0000068) SP=00f9fcb8, BVA=004cd000

    !KITLRegisterDfltClient called before KitlInit. KITLGlobalState=00000080
    PID:00400002 TID:066C0072 Ran for 23 seconds [ 0 minute(s) ]
    PID:00400002 TID:066C0072 Frames  per second  = 0
    PID:00400002 TID:066C0072 Dropped per second  = 24
    PID:00400002 TID:066C0072 Ran for 634 seconds [ 10 minute(s) ]
    PID:00400002 TID:066C0072 Frames  per second  = 0
    PID:00400002 TID:066C0072 Dropped per second  = 0

    HB

    Tuesday, July 3, 2012 4:05 PM

Answers

  • That is great.So finally found the reason for exclusion of VMR registry.
     
    In the FSL MM registry they are removing the VMR registry and adding their own Video Renderer registry.
     
    You can try to add both the renderer and try the camera application as well as the media player.Remove the following two line in FSL_MM registry file.But not sure why they removed VMR so it may not work also.
     
    [-HKEY_CLASSES_ROOT\Filter\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
     
    [-HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
     
     
    My application will work only if the VMR is registered in the OS.So if you want that to use any available renderer in OS just comment out the following section
     
    CHK( pVideoRenderer.CoCreateInstance( CLSID_VideoMixingRenderer ));
           NotifyMessage( MESSAGE_INFO, (L"Builing the CLSID_VideoMixingRenderer completed hr=0x%x\r\n" ),hr);   
        //Add the Video Renderer to the Filter Graph
        CHK( pFilterGraph->AddFilter( pVideoRenderer, L"VideoMixingRenderer" ));
     
    and change the RenderStream statement to automatically select and use the available renderer.But this statement may also fail in case default renderer doesn’t support the available format from the USB camera.
    CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL));
     
     
     
    • Marked as answer by kama168us Monday, July 9, 2012 8:06 AM
    Monday, July 9, 2012 7:33 AM

All replies

  • Hi,
     
    Check out one of other post on the changes required in the renderer of WEC7.Make sure to change the CLSID from Video Renderer to Video Mixing Renderer(VMR).
     
    There is a change in the video renderer between WinCE 6 and WEC7.Check out this blog post for the change.

    http://www.e-consystems.com/blog/windowsce/?p=697
     
     
    Wednesday, July 4, 2012 5:45 AM
  • Dear Prabu,

    Sorry, in my understanding, is there only application coding problem ?

    Should I configure any items to support this change ?

    Because I execute your DDrawTest.exe in my arm7/freescale i.mx53 WEC7 platform, it can't show anything.

    HB


    === log message ==

    PID:00E900EA TID:069F0072 RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:00E900EA TID:069F0072 Runing the capture graph failed

    • Edited by kama168us Wednesday, July 4, 2012 8:40 AM
    Wednesday, July 4, 2012 8:31 AM
  • Hi,
     
    Did you get the following message?
     
    “Builing the graph completed”
     
    Wednesday, July 4, 2012 12:08 PM
  • Dear Prabu,

    I just use the debug version DDrawTest.exe directly, which is inside your source example.

    I didn't re-compile your sample app.

    This message is output when execute DDrawTest.exe ? If yes, I didn't get any “Builing the graph completed” meesage.

    HB


    • Edited by kama168us Thursday, July 5, 2012 2:50 AM
    Wednesday, July 4, 2012 4:16 PM
  • I have a working camera video render-er for WinEC7 

    The below reference code could be helpful to you :-

    /***********************************************************************/

    //****************************************************************************************
    //
    //RunCaptureGraph:This function is to used to start or Run  the graph
    //
    //****************************************************************************************
    HRESULT
    BuildCaptureGraph(HWND m_hwnd)
    {
        HRESULT       hr = S_OK;
        CComVariant   varCamName;
        CPropertyBag  PropBag;
        WCHAR          wzDeviceName[ MAX_PATH + 1 ];

        CComPtr<IMediaEvent>            pMediaEvent;
        CComPtr<IGraphBuilder>          pFilterGraph;
        CComPtr<IPersistPropertyBag>    pPropertyBag;
        CComPtr<IDMOWrapperFilter>      pWrapperFilter;
        CComPtr<IBaseFilter>            pImageSinkFilter;
        CComPtr<IBaseFilter>            pVideoRenderer;
        CComPtr<IAMStreamConfig>        m_pCaptureStreamConfig;
        RECT                            m_rcLocation;

        // misbah
        CComPtr<IBaseFilter>            pColorConversion;

        //*********************************************************************************
        // 1. Create the capture graph builder and register the filtergraph manager.
        //*********************************************************************************
        CHK( m_pCaptureGraphBuilder.CoCreateInstance( CLSID_CaptureGraphBuilder ));
        CHK( pFilterGraph.CoCreateInstance( CLSID_FilterGraph ));
        CHK( m_pCaptureGraphBuilder->SetFiltergraph( pFilterGraph ));

        //*********************************************************************************
        // 2. Create and initialize the video capture filter
        //*********************************************************************************
        CHK( m_pVideoCaptureFilter.CoCreateInstance( CLSID_VideoCapture ));
        CHK( m_pVideoCaptureFilter.QueryInterface( &pPropertyBag ));

        // Added by misbah ...
        // We are loading the driver CAM1 in the video capture filter.
        CHK( GetFirstCameraDriver( wzDeviceName ));
        varCamName = wzDeviceName;
        if( varCamName.vt != VT_BSTR )
        {
            ERR( E_OUTOFMEMORY );
        }

        CHK( PropBag.Write( L"VCapName", &varCamName ));   
        CHK( pPropertyBag->Load( &PropBag, NULL ));

        //*********************************************************************************
        // Ext. Create and initialize color conversion filter
        //*********************************************************************************
        CHK( pColorConversion.CoCreateInstance( CLSID_Colour ));
        NotifyMessage( MESSAGE_INFO, (L"Builing the CLSID_Colour completed hr=0x%x\r\n" ),hr);
        //Add the Video Renderer to the Filter Graph
        CHK( pFilterGraph->AddFilter( pColorConversion, L"VideoColorConversion" ));

    #if 0
        // We are loading the driver CAM1 in the video capture filter.
        CHK( GetFirstCameraDriver( wzDeviceName ));
        varCamName = wzDeviceName;
        if( varCamName.vt != VT_BSTR )
        {
            ERR( E_OUTOFMEMORY );
        }

        CHK( PropBag.Write( L"VCapName", &varCamName ));   
        CHK( pPropertyBag->Load( &PropBag, NULL ));

    #endif

        // Everything succeeded, now adding the video capture filter to the filtergraph
        CHK( pFilterGraph->AddFilter( m_pVideoCaptureFilter, L"Video Capture Filter Source" ));
        
        //*********************************************************************************
        //3. Create and initialize the Video Renderer Filter
        //*********************************************************************************
        CHK( pVideoRenderer.CoCreateInstance( CLSID_VideoMixingRenderer ));
           NotifyMessage( MESSAGE_INFO, (L"Builing the CLSID_VideoMixingRenderer completed hr=0x%x\r\n" ),hr);    
        //Add the Video Renderer to the Filter Graph
        CHK( pFilterGraph->AddFilter( pVideoRenderer, L"VideoMixingRenderer" ));

        //*********************************************************************************
        //4. Now render the Graph with Video Capture and Video renderer Filter.
        //*********************************************************************************
        CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, pVideoRenderer ));

        //*********************************************************************************
        //5. Query the VideoWindow interface to set the preview rendering window size.
        //*********************************************************************************
        CHK( pFilterGraph->QueryInterface( &m_pVideoWindow ));
        if(m_pVideoWindow)
        {
            // if the user gave a valid owner window, then set it.  otherwise don't.
            if(m_hwnd)
            {
                // configure the video window
                hr = m_pVideoWindow->put_Owner((OAHWND) m_hwnd);
                if(FAILED(hr))
                {
                    NKDbgPrintfW(TEXT("BuildCaptureGraph: Setting the owner window failed.\r\n"));
                }
            }        
            m_rcLocation.left = ((GetSystemMetrics(SM_CXSCREEN)/2)-40) - (CAMERA_PREVIEW_WIDTH/2);
            m_rcLocation.right = m_rcLocation.left + CAMERA_PREVIEW_WIDTH;
            m_rcLocation.top = (GetSystemMetrics(SM_CYSCREEN)/2) - (CAMERA_PREVIEW_HEIGHT/2) - 26;
            m_rcLocation.bottom = m_rcLocation.top  + CAMERA_PREVIEW_HEIGHT;

            //RETAILMSG(1,(L"\r\nBefore Setting Right=%d,left=%d,top=%d,bottom=%d\r\n",m_rcLocation.right,m_rcLocation.left,m_rcLocation.top,m_rcLocation.bottom));
            // if the user gave a valid location rectangle to set, then set it, otherwise don't set it and we'll just use the default.
            if(m_rcLocation.left > 0 || m_rcLocation.top > 0 || m_rcLocation.right > 0 || m_rcLocation.bottom > 0)
            {
                hr = m_pVideoWindow->SetWindowPosition(m_rcLocation.left, m_rcLocation.top, m_rcLocation.right - m_rcLocation.left, m_rcLocation.bottom - m_rcLocation.top);
                if(FAILED(hr))
                {
                    NKDbgPrintfW(TEXT("BuildCaptureGraph: Setting the window position failed.\r\n"));
                }
            }
            // update our internal location rectangle to reflect what is set in the system.
            // the position set may be different if the position requested isn't possible.
            hr = m_pVideoWindow->GetWindowPosition(&m_rcLocation.left, &m_rcLocation.top, &m_rcLocation.right, &m_rcLocation.bottom);
            if(FAILED(hr))
            {
                NKDbgPrintfW(TEXT("BuildCaptureGraph: Setting the window position failed.\r\n"));
            }
            //RETAILMSG(1,(L"\r\nWidth=%d,left=%d,top=%d,Height=%d\r\n",m_rcLocation.right,m_rcLocation.left,m_rcLocation.top,m_rcLocation.bottom));       
        }  
        
        //CHK( pFilterGraph->QueryInterface( &m_pVideoRenderMode ));
           //NotifyMessage( MESSAGE_INFO, (L"Builing the m_pVideoRenderMode completed hr=0x%x\r\n" ),hr);    
        //Setting the Renderer to use DDRAW renderer(To Use Hardware Layer).
        //CHK(m_pVideoRenderMode->SetMode(AM_VIDEO_RENDERER_MODE_DDRAW));
        
        // Get the media control interface for controlling the connected graph
        CHK( pFilterGraph->QueryInterface( &m_pMediaControl ));
        NotifyMessage( MESSAGE_INFO, (L"pFilterGraph->QueryInterface( &m_pMediaControl ) completed hr=0x%x\r\n" ),hr);

           NotifyMessage( MESSAGE_INFO, (L"Builing the graph completed\r\n" ));

    Cleanup:
        if( FAILED( hr ))
        {
            NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x\r\n" ),hr);
        }
        return hr;
    }

    /****************************************************************************************/

    Hope this will help !

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Thursday, July 5, 2012 5:06 AM
  • Dear Misbah and Prabu,

    First, I re-build Prabu's example (http://www.e-consystems.com/blog/windowsce/?p=697) (Download Sample Source),

    but after executing this application, it can't show anything.

    (note: I must add #pragma comment(lib,"ddraw.lib") and #pragma comment(lib,"dxguid.lib") to avoid compile error)

    Then, I merge Misbah's suggestion to Prabu's example and re-build it, it still can't show anything.

    Here is the result: https://www.dropbox.com/s/blrwjlfawk9qmcj/DSC_0750.JPG

    The log message seems to tell me that I miss some core components for Run Capture Graph.

    Do you know what's wrong about this ~

    thx ~


    ==== here is log message when execute DDrawTest_.exe===

    PID:07E600B2 TID:076A009E Builing the CLSID_Colour completed hr=0x2fa7c
    PID:07E600B2 TID:076A009E Builing the graph failed hr=0x1
    PID:07E600B2 TID:076A009E RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:07E600B2 TID:076A009E Runing the capture graph failed

    HB


    • Edited by kama168us Thursday, July 5, 2012 7:22 AM
    Thursday, July 5, 2012 6:57 AM
  • Dear Misban,

    I saw this topic "USB Camera and WEC7" that you post before:

    http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/1d084ecc-9082-492c-923f-787b98c11c2d

    Now I got same problem with u ~

    Did I miss any components ? Plz help ~thx ~

    HB


    • Edited by kama168us Thursday, July 5, 2012 7:11 AM
    Thursday, July 5, 2012 7:08 AM
  •  
    Hi,
     
    It looks like it is failing to build the filter graph.
     
    I didn’t see the “Builing the CLSID_VideoMixingRenderer completed “ message on your log,so mostly it is failing to get the handle of VMR.
     
    Make sure to add “SYSGEN_DSHOW_VMR” component to your OS image.
    Thursday, July 5, 2012 7:30 AM
  • Dear Prabu,

    I had selected this component.

    Can I check whether my image include this component ?

    https://www.dropbox.com/s/r62qd2zdf3rlzbp/VMR_Check.jpg

    HB

    Thursday, July 5, 2012 7:49 AM
  • It looks like VMR is added to the build.So could you add the GetLastError() in the error Following error message and post the result.
     
     
    NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x,ErrorCode = 0x%x \r\n" ),hr,GetLastError());
     
     
    Thursday, July 5, 2012 8:54 AM
  • Dear Prabu,

    I add this notify in CaptureGraph.cpp

    RunCaptureGraph()

    {

        ...

    Cleanup:
        if( FAILED( hr ))
        {
            NotifyMessage( MESSAGE_ERROR, (L"Runing the capture graph failed\r\n" ));
            NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x,ErrorCode = 0x%x \r\n" ),hr,GetLastError());
        }

    }

    == log message ===

    PID:00E9000E TID:00EB000E Builing the CLSID_Colour completed hr=0x2fa7c
    PID:00E9000E TID:00EB000E Builing the graph failed hr=0x1
    PID:00E9000E TID:00EB000E RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:00E9000E TID:00EB000E Runing the capture graph failed
    PID:00E9000E TID:00EB000E Builing the graph failed hr=0xcca7fe5c,ErrorCode = 0x0

    HB


    • Edited by kama168us Thursday, July 5, 2012 9:31 AM
    Thursday, July 5, 2012 9:30 AM
  • Don’t add it in the RunCaptureGraph(),add it in the cleanup code of the BuildCaptureGraph() function.The failure is mainly in the BuildCaptureGraph() function.
     
    Thursday, July 5, 2012 9:44 AM
  • Dear Prabu,

    == log message ===

    Cleanup:
        if( FAILED( hr ))
        {
            NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x\r\n" ),hr);
            NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x,ErrorCode = 0x%x \r\n" ),hr,GetLastError());
        }
        return hr;

    PID:077F00AE TID:06D90056 Builing the CLSID_Colour completed hr=0x2fa7c
    PID:077F00AE TID:06D90056 Builing the graph failed hr=0x1
    PID:077F00AE TID:06D90056 Builing the graph failed hr=0xd2e2fe5c,ErrorCode = 0x0
    PID:077F00AE TID:06D90056 RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:077F00AE TID:06D90056 Runing the capture graph failed

    ====Another Notify msg ====

    Cleanup:
        if( FAILED( hr ))
        {
            //NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x\r\n" ),hr);
            NotifyMessage( MESSAGE_ERROR, (L"Builing the graph failed hr=0x%x,ErrorCode = 0x%x \r\n" ),hr,GetLastError());
        }
        return hr;

    PID:060C00BE TID:068B00D6 Builing the CLSID_Colour completed hr=0x2fa7c
    PID:060C00BE TID:068B00D6 Builing the graph failed hr=0x1,ErrorCode = 0x2fab0
    PID:060C00BE TID:068B00D6 RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:060C00BE TID:068B00D6 Runing the capture graph failed

    HB


    • Edited by kama168us Thursday, July 5, 2012 9:58 AM
    Thursday, July 5, 2012 9:54 AM
  • Errorcode displayed are not valid.
     
    It looks like there is syntax error in the debug messages statement.Modify like the following(Check the braces change)
    NotifyMessage( MESSAGE_ERROR, (L"Building the graph failed hr=0x%x,ErrorCode = 0x%x \r\n",hr,GetLastError()));
     
    Thursday, July 5, 2012 10:54 AM
  • Hello Kama,

    I had this issue and as far as i remember the issue was with Dshow components.

    Make sure you have selected all the required Dshow components. Follow prabu's advise as he mentioned above.

    Post the result here.

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Thursday, July 5, 2012 2:54 PM
  • Dear Prabu,

    Change to NotifyMessage( MESSAGE_ERROR, (L"Building the graph failed hr=0x%x,ErrorCode = 0x%x \r\n",hr,GetLastError()));

    == log message ==

    PID:075B0036 TID:075A0036 Builing the CLSID_Colour completed hr=0x2fa7c
    PID:075B0036 TID:075A0036 Building the graph failed hr=0x80040154,ErrorCode = 0x0
    PID:075B0036 TID:075A0036 RunCaptureGraph: Core components needed for RunCapture
    Graph unavailable.
    PID:075B0036 TID:075A0036 Runing the capture graph failed

    HB

    Friday, July 6, 2012 12:27 AM
  • Dear Misbah,

    Could u plz help check which component that I missed in below catalog items ~

    https://www.dropbox.com/s/lx81k6r0egvta44/os_component.jpg

    thx ~

    HB

    Friday, July 6, 2012 12:35 AM
  • Hi,
     
    Errorcode state that “Class not registered “,so it looks like VMR is not registered in your OSBinary.
    Did you given “Clean Sysgen” after selecting the VMR from the catalog items?
     
    Also search for “VMR” in your reginit.ini file on the release directory of your OSdesign,and check whether registry related to VMR are present in that.
    Friday, July 6, 2012 5:27 AM
  • Dear Prabu,

    I will re-do "Clean Sysgen" again ~

    There is only one VMR present in my reginit.ini file.

    Did I miss any other registry ?

    =====

    ; We disable ColorKey usage on smartfons (RenderingPrefs = 8) since the compositor doesn't know how to deal with color keyed overlays
    [HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\VMR]
    "RenderingPrefs"=dword:0
    "UseScanLine"=dword:0
    "MaxBackBuffers"=dword:1
    "KeyColor"=hex:09,09,09,00
    =====

    thx ~

    HB

    Friday, July 6, 2012 6:41 AM
  • It should contain the following registry setting to register a VMR class.
     
    ; @CESYSGEN IF QUARTZ_VMRRENDERER
    ; Video Mixing Renderer Filter
     
    [HKEY_CLASSES_ROOT\Filter\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
    @="VideoMixingRenderer"
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
    @="VideoMixingRenderer"
    "Merit"=dword:00800000
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\InprocServer32\Pins\Input]
    ;"Direction"=dword:00000000
    ;"IsRendered"=dword:00000001
    ;"AllowedZero"=dword:00000000
    ;"AllowedMany"=dword:00000001
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\Pins\Input\Types\{73646976-0000-0010-8000-00AA00389B71}\{00000000-0000-0000-0000-000000000000}]
     
    ; ImageSynchronization component
     
    [HKEY_CLASSES_ROOT\CLSID\{7D8AA343-6E63-4663-BE90-6B80F66540A3}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{7D8AA343-6E63-4663-BE90-6B80F66540A3}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; AllocatorPresenter component
     
    [HKEY_CLASSES_ROOT\CLSID\{99d54f63-1a69-41ae-aa4d-c976eb3f0713}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{99d54f63-1a69-41ae-aa4d-c976eb3f0713}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; VideoMixer component
     
    [HKEY_CLASSES_ROOT\CLSID\{06b32aee-77da-484b-973b-5d64f47201b0}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{06b32aee-77da-484b-973b-5d64f47201b0}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; We disable ColorKey usage on smartfons (RenderingPrefs = 8) since the compositor doesn't know how to deal with color keyed overlays
    [HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\VMR]
    IF _TGTPROJ=smartfon
    "RenderingPrefs"=dword:8
    ELSE
    "RenderingPrefs"=dword:0
    ENDIF _TGTPROJ=smartfon
    "UseScanLine"=dword:0
    "MaxBackBuffers"=dword:1
    "KeyColor"=hex:09,09,09,00
     
    ; @CESYSGEN ENDIF
     
    Friday, July 6, 2012 7:01 AM
  • Dear Prabu,

    Yes, I got all of these registry in my reginit.ini ~

    I will check these registry in run-time os again ~!

    HB


    • Edited by kama168us Friday, July 6, 2012 7:28 AM
    Friday, July 6, 2012 7:24 AM
  • Dear Prabu,

    I had done "Clean Sysgen" ~

    Below Bold parts registry that I can't find in my run-time os, but I can find Italic parts registry.

    All of these registry that I can find in my reginit.ini file.

    Do you know what's wrong about this ?

    https://www.dropbox.com/s/ksl1jigz3nk3khr/1.reg ==> this is the registry which exported from my run-time platform.

    https://www.dropbox.com/s/693ywovr9e0w6xo/reginit.ini ==> this is my reginit.ini file

    in my build.log SYSGEN_DSHOW_VMR=1.

    ============================

    ; @CESYSGEN IF QUARTZ_VMRRENDERER
    ; Video Mixing Renderer Filter
     
    [HKEY_CLASSES_ROOT\Filter\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
    @="VideoMixingRenderer"
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
    @="VideoMixingRenderer"
    "Merit"=dword:00800000
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\InprocServer32\Pins\Input]
    ;"Direction"=dword:00000000
    ;"IsRendered"=dword:00000001
    ;"AllowedZero"=dword:00000000
    ;"AllowedMany"=dword:00000001
     
    [HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}\Pins\Input\Types\{73646976-0000-0010-8000-00AA00389B71}\{00000000-0000-0000-0000-000000000000}]
     
    ; ImageSynchronization component
     
    [HKEY_CLASSES_ROOT\CLSID\{7D8AA343-6E63-4663-BE90-6B80F66540A3}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{7D8AA343-6E63-4663-BE90-6B80F66540A3}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; AllocatorPresenter component
     
    [HKEY_CLASSES_ROOT\CLSID\{99d54f63-1a69-41ae-aa4d-c976eb3f0713}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{99d54f63-1a69-41ae-aa4d-c976eb3f0713}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; VideoMixer component
     
    [HKEY_CLASSES_ROOT\CLSID\{06b32aee-77da-484b-973b-5d64f47201b0}]
    @="ImageSynchronization"
    "Merit"=dword:00000000
     
    [HKEY_CLASSES_ROOT\CLSID\{06b32aee-77da-484b-973b-5d64f47201b0}\InprocServer32]
    @="quartz.dll"
    "ThreadingModel"="Both"
     
    ; We disable ColorKey usage on smartfons (RenderingPrefs = 8) since the compositor doesn't know how to deal with color keyed overlays
    [HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\VMR]
    IF _TGTPROJ=smartfon
    "RenderingPrefs"=dword:8
    ELSE
    "RenderingPrefs"=dword:0
    ENDIF _TGTPROJ=smartfon
    "UseScanLine"=dword:0
    "MaxBackBuffers"=dword:1
    "KeyColor"=hex:09,09,09,00
     
    ; @CESYSGEN ENDIF


    • Edited by kama168us Friday, July 6, 2012 8:49 AM
    Friday, July 6, 2012 8:43 AM
  •  
    The registry in Bold is responsible for registering the particular IClass in the OS.
    Friday, July 6, 2012 11:17 AM
  • Dear Prabu,

    But I had selected VMR catalog items, and I can see these parts in my reginit.ini file.

    Do you know why I can't include bold parts in my run-time os registry ?

    Thx~

    HB

    Sunday, July 8, 2012 6:01 AM
  • Dear Prabu,

    I got some interesting experimental result:

    1) VideoRender catalog might be re-write if I use Freescale Multimedia framework.

    2) When I remove FSL_VIDEO_RENDER parts in freescale MM SDK, usb camera can work, but I use another camera app, not the sample code that you provided.

    Here is the sample code: https://www.dropbox.com/s/iddr53hgfvnw3dl/Camera_ap.rar

    Only preview is ok now.I though this issue might be caused by Freescale multimedia video render driver ~!!??

    And different app in different system might have different result...

    3) However, if I remove FSL_VIDEO_RENDER, I can't play video anymore. Thus, still a question.....I might ask adeneo who provide freescale wec7 bsp.

    HB


    • Edited by kama168us Monday, July 9, 2012 6:12 AM
    Monday, July 9, 2012 6:11 AM
  • That is great.So finally found the reason for exclusion of VMR registry.
     
    In the FSL MM registry they are removing the VMR registry and adding their own Video Renderer registry.
     
    You can try to add both the renderer and try the camera application as well as the media player.Remove the following two line in FSL_MM registry file.But not sure why they removed VMR so it may not work also.
     
    [-HKEY_CLASSES_ROOT\Filter\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
     
    [-HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
     
     
    My application will work only if the VMR is registered in the OS.So if you want that to use any available renderer in OS just comment out the following section
     
    CHK( pVideoRenderer.CoCreateInstance( CLSID_VideoMixingRenderer ));
           NotifyMessage( MESSAGE_INFO, (L"Builing the CLSID_VideoMixingRenderer completed hr=0x%x\r\n" ),hr);   
        //Add the Video Renderer to the Filter Graph
        CHK( pFilterGraph->AddFilter( pVideoRenderer, L"VideoMixingRenderer" ));
     
    and change the RenderStream statement to automatically select and use the available renderer.But this statement may also fail in case default renderer doesn’t support the available format from the USB camera.
    CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL));
     
     
     
    • Marked as answer by kama168us Monday, July 9, 2012 8:06 AM
    Monday, July 9, 2012 7:33 AM
  • Dear Prabu,

    After remove

    [-HKEY_CLASSES_ROOT\Filter\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]
     

    [-HKEY_CLASSES_ROOT\CLSID\{B87BEB7B-8D29-423f-AE4D-6582C10175AC}]

    Vidoe player and Camera preivew can work together, shown as below image:

    https://www.dropbox.com/s/50xwricuv4x5iul/DSC_0764.JPG

    But your application still can't work on my platform after adopting your suggestion:

    https://www.dropbox.com/s/riiyx1t66utn994/DSC_0762.JPG

    (seems resolution error...)

    CameraDshowApp which provided by MS also can't work.

    =====================================================================

    comment out the following section

    CHK( pVideoRenderer.CoCreateInstance( CLSID_VideoMixingRenderer ));

           NotifyMessage( MESSAGE_INFO, (L"Builing the CLSID_VideoMixingRenderer completed hr=0x%x\r\n" ),hr);   
        //Add the Video Renderer to the Filter Graph
        CHK( pFilterGraph->AddFilter( pVideoRenderer, L"VideoMixingRenderer" ));

    change the RenderStream statement to automatically select and use the available renderer.But this statement may also fail in case default renderer doesn’t support the available format from the USB camera.

    CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL));

    =====================================================================

    thx ~

    HB



    • Edited by kama168us Monday, July 9, 2012 8:13 AM
    Monday, July 9, 2012 8:11 AM
  • Ok.After removing the registry and trying with my application without any change and see what happens? Is it again fail in getting the handle for VMR?
     
    To get the Microsoft default application to work,you need to modify the cameraframework code to use the new VMR.
     
    Monday, July 9, 2012 9:41 AM
  • Dear Prabu,

    Same situation, but log message shows "Builing the graph completed" ~

    === log message ====

    Builing the CLSID_VideoMixingRenderer completed hr=0x2fa80
    PID:07C5006A TID:0618007A Builing the graph completed
    PID:07C5006A TID:0618007A The Graph is running

    =================

    Here is my code (and execution file) which is almost same with yours:

    https://www.dropbox.com/s/ly747nb5n5qk9ph/DDrawTest_HB_20120709.rar

    Modifications:

    1) DDrawtest.cpp

    #pragma comment(lib,"ddraw.lib")
    #pragma comment(lib,"dxguid.lib") 2) DDrawTest.vcproj

    2) DDrawTest.vcproj

    Platform Name="ROM-1210-0 (ARMv4I)" ....

    HB


    • Edited by kama168us Monday, July 9, 2012 10:03 AM
    Monday, July 9, 2012 10:02 AM
  • Ok. In this pass case what you are seeing on the screen?
     
     
    Also what are the configuration selected in the USBCam.reg file.
     
    "PreferredWidth"=dword:B0
    "PreferredHeight"=dword:90
    "UncompressedSupport"=dword:1
    "MJPEGSupport"=dword:0
     
    Monday, July 9, 2012 10:41 AM
  • Dear Prabu,

    1) screen capture

    https://www.dropbox.com/s/8y20w6on6gfglyu/DSC_0766.JPG

    2) I didn't change USBCAM.reg file, below is default value:

    [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Video_Class]
        "Prefix"="CAM"
        "Dll"="usbcam.dll"
        "IClass"="{CB998A05-122C-4166-846A-933E4D7E3C86}"
    ; Default to Uncompressed QCIF if app doesn't specify
        "PreferredWidth"=dword:B0
        "PreferredHeight"=dword:90
        "UncompressedSupport"=dword:1
        "MJPEGSupport"=dword:0

    HB

    Tuesday, July 10, 2012 1:10 AM