×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Setup Logitech WebCam DirectShow??

Setup Logitech WebCam DirectShow??

Setup Logitech WebCam DirectShow??

(OP)
Hello,I want to change the webcamformat from 352x288 to 640x480 on the Logitech messenger, but the source dont work? thanks for helping me.
ps: amcap.cpp from DX SDK works fine.
my source:
//----------------------------------------------------------------
// void CamFormat()
// desc : set size of video
//----------------------------------------------------------------
void CamFormat()
{
   HRESULT hr;

   CComPtr<ICaptureGraphBuilder2> graphBuilder2_;
   hr = graphBuilder2_.CoCreateInstance( CLSID_CaptureGraphBuilder2 );
 
   IAMStreamConfig *pSC;
  
  // Default Cap device
   IBaseFilter *pCap;
  GetDefaultCapDevice( &pCap );

  graphBuilder2_->FindInterface(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,pCap,
                                     IID_IAMStreamConfig,(void **)&pSC);

   ISpecifyPropertyPages *pSpec;
   CAUUID cauuid;

      hr = pSC->QueryInterface(IID_ISpecifyPropertyPages,(void **)&pSpec);

              if(hr == S_OK)
                {
                    
                    hr = pSpec->GetPages(&cauuid);
                    hr = OleCreatePropertyFrame(hDlg, 30, 30, NULL, 1,
                        (IUnknown **)&pSC, cauuid.cElems,
                        (GUID *)cauuid.pElems, 0, 0, NULL);

                       
           CoTaskMemFree(cauuid.pElems);
                    pSpec->Release();
                    
                }
    pSC->Release();

} // end CamFormat.

Compile no errors,
The error is in this part of the code:
==============================================================
hr = OleCreatePropertyFrame(hDlg, 30, 30, NULL, 1,
(IUnknown **)&pSC, cauuid.cElems,
(GUID *)cauuid.pElems, 0, 0, NULL);
==============================================================
error while debug
Unhandled exception at 0x583e7666 in Golem.exe: 0xC0000005: Access violation reading location 0x00000000.
=============================================================================
when I use // Default Cap device IBaseFilter *pCap; GetDefaultCapDevice( &pCap ); (IUnknown **)&pCap,in place of (IUnknown **)&pSC, i have the menu from the webcam but i cannot acces the values in the dialog box..I am ussing the source from Amcap.cpp from the DX 9.0 as example, work fine but not in my source. Thanks for helping me.

ps: source from DX 9.0 AmCap.cpp works good.
if(hr != NOERROR)
hr = gcap.pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, gcap.pVCap,
IID_IAMStreamConfig, (void **)&pSC);

ISpecifyPropertyPages *pSpec;
CAUUID cauuid;

hr = pSC->QueryInterface(IID_ISpecifyPropertyPages,
(void **)&pSpec);

if(hr == S_OK)
{
hr = pSpec->GetPages(&cauuid);
hr = OleCreatePropertyFrame(ghwndApp, 30, 30, NULL, 1,
(IUnknown **)&pSC, cauuid.cElems,
(GUID *)cauuid.pElems, 0, 0, NULL);

// !!! What if changing output formats couldn't reconnect
// and the graph is broken? Shouldn't be possible...

if(gcap.pVSC)
{
AM_MEDIA_TYPE *pmt;
// get format being used NOW
hr = gcap.pVSC->GetFormat(&pmt);

// DV capture does not use a VIDEOINFOHEADER
if(hr == NOERROR)
{
if(pmt->formattype == FORMAT_VideoInfo)
{
// resize our window to the new capture size
ResizeWindow(HEADER(pmt->pbFormat)->biWidth,
abs(HEADER(pmt->pbFormat)->biHeight));
}
DeleteMediaType(pmt);
}
}

CoTaskMemFree(cauuid.pElems);
pSpec->Release();
}

pSC->Release();


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close