Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CButton MouseDown Pin
sdfdsfa18-Jul-03 5:58
sdfdsfa18-Jul-03 5:58 
QuestionHow to input Greek Pin
winncle16-Jul-03 20:29
winncle16-Jul-03 20:29 
GeneralProcess: Create and Destroy Pin
Imtiaz Murtaza16-Jul-03 20:28
Imtiaz Murtaza16-Jul-03 20:28 
GeneralRe: Process: Create and Destroy Pin
Ryan Binns16-Jul-03 21:21
Ryan Binns16-Jul-03 21:21 
GeneralRe: Process: Create and Destroy Pin
Mike Dimmick16-Jul-03 22:44
Mike Dimmick16-Jul-03 22:44 
GeneralRe: Process: Create and Destroy Pin
Ryan Binns16-Jul-03 22:58
Ryan Binns16-Jul-03 22:58 
Generalsize of the capture image Pin
Chen Jiadong16-Jul-03 19:20
Chen Jiadong16-Jul-03 19:20 
GeneralRe: size of the capture image Pin
Andrew Walker17-Jul-03 2:37
Andrew Walker17-Jul-03 2:37 
1/ Find the output pin of the source filter
2/ Query the pin for the IAMStreamConfig interface
3/ Use IAMStreamConfig::GetNumberOfCapabilities() to find the number of alternative output configurations
4/ Use IAMStreamConfig::GetStreamCaps() to evaluate all the possible AM_MEDIA_TYPE's
5/ Remember to delete the AM_MEDIA_TYPE's after you're finished with them.

You are probably going to have to specify a media subtype as well as the resolution. Typically MEDIASUBTYPE_RGB24 for most web cams

The following code is far from perfect... but it's what i'm using at the moment Smile | :)

CComPtr<IPin> findPin(CComPtr<IBaseFilter>& pFilter, PIN_DIRECTION dir)
{
    PIN_DIRECTION pinDir;  // Direction of the current pin
    CComPtr<IEnumPins> pPinEnum;
    pFilter->EnumPins(&pPinEnum); // Get an enumeration of the filters pins
    while(1)
    {
        CComPtr<IPin> pPin; // Destroy at end of loop iteration
        if( pPinEnum->Next(1,&pPin,0) == S_OK )	// If enumeration works
        {
            pPin->QueryDirection(&pinDir);
            if(pinDir == dir) // If the pin direction matches
            {
                return pPin;
            }
        }
        else
        {
            return CComPtr<IPin>(); // Wraps a return of null (see default c'tor)
        }
    }
}
void setFormat(int width, int height, const GUID& subtype)
{
    int size;
    int count;
    VIDEO_STREAM_CONFIG_CAPS vscc;
    
    CComPtr<IPin> pPin = findPin(pSrc_,PINDIR_OUTPUT);
    CComQIPtr<IAMStreamConfig> pConfig(pPin);

    pConfig->GetNumberOfCapabilities(&count, &size);
    for(int i = 0; i < count; i++)
    {
        AM_MEDIA_TYPE *pMt;
        pConfig->GetStreamCaps(i, &pMt, (BYTE*)&vscc);
        if( (vscc.InputSize.cx == width) &&
            (vscc.InputSize.cy == height) &&
            (pMt->subtype == subtype) )
        {
            pConfig->SetFormat(pMt);
            DeleteMediaType(pMt);
            return;
        }
        DeleteMediaType(pMt);
    }
}



If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

Generalwave/in problem with TAPI Pin
ewasta16-Jul-03 19:16
ewasta16-Jul-03 19:16 
GeneralMouse Hooking problem!!!!! Pin
xxhimanshu16-Jul-03 18:28
xxhimanshu16-Jul-03 18:28 
GeneralRe: Mouse Hooking problem!!!!! Pin
PJ Arends17-Jul-03 7:01
professionalPJ Arends17-Jul-03 7:01 
GeneralRe: Mouse Hooking problem!!!!! Pin
xxhimanshu18-Jul-03 18:53
xxhimanshu18-Jul-03 18:53 
Generalusing ADO Pin
Angel Kid16-Jul-03 16:42
Angel Kid16-Jul-03 16:42 
GeneralRe: using ADO Pin
Toni7816-Jul-03 18:58
Toni7816-Jul-03 18:58 
GeneralDetect Internet Connection Pin
Abhi@Work16-Jul-03 15:48
Abhi@Work16-Jul-03 15:48 
GeneralRe: Detect Internet Connection Pin
Toni7816-Jul-03 16:00
Toni7816-Jul-03 16:00 
GeneralRe: Detect Internet Connection Pin
Abhi@Work16-Jul-03 17:12
Abhi@Work16-Jul-03 17:12 
GeneralRe: Detect Internet Connection Pin
Ryan Binns16-Jul-03 17:37
Ryan Binns16-Jul-03 17:37 
General***Clickety police*** Pin
Toni7816-Jul-03 18:56
Toni7816-Jul-03 18:56 
GeneralRe: ***Clickety police*** Pin
Ryan Binns16-Jul-03 19:07
Ryan Binns16-Jul-03 19:07 
GeneralWrong tittle for the wrong message Pin
Toni7816-Jul-03 19:23
Toni7816-Jul-03 19:23 
GeneralRe: Wrong tittle for the wrong message Pin
Ryan Binns16-Jul-03 19:40
Ryan Binns16-Jul-03 19:40 
GeneralRe: Wrong tittle for the wrong message Pin
Toni7816-Jul-03 19:44
Toni7816-Jul-03 19:44 
GeneralRe: Wrong tittle for the wrong message Pin
Ryan Binns16-Jul-03 19:47
Ryan Binns16-Jul-03 19:47 
GeneralRe: Detect Internet Connection Pin
Toni7816-Jul-03 18:54
Toni7816-Jul-03 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.