Click here to Skip to main content
15,898,134 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: SetPixel() too slow? Pin
Matthew Butler18-Aug-08 12:35
Matthew Butler18-Aug-08 12:35 
GeneralRe: SetPixel() too slow? Pin
Naturality18-Aug-08 13:01
Naturality18-Aug-08 13:01 
GeneralRe: SetPixel() too slow? Pin
Mark Salsbery18-Aug-08 14:38
Mark Salsbery18-Aug-08 14:38 
GeneralRe: SetPixel() too slow? Pin
Naturality19-Aug-08 11:28
Naturality19-Aug-08 11:28 
Questioncan rotation be performed using translation itself? Pin
ashishsagarwal18-Aug-08 6:22
ashishsagarwal18-Aug-08 6:22 
QuestionXNA 3d model formats Pin
MikeMarq17-Aug-08 6:12
MikeMarq17-Aug-08 6:12 
QuestionDirectX9 novice help Pin
Dave_BHGF16-Aug-08 7:43
Dave_BHGF16-Aug-08 7:43 
QuestionProblem with CROSSBAR in DirectShow Pin
bhanu_850913-Aug-08 3:28
bhanu_850913-Aug-08 3:28 
Dear All,

I am developing an application to preview the video from a Capture device. I have developed the application and it is working fine, but the problem is that it is playing two times correctly but for the third time i got error while connecting with video renderer. Please help me. Code snippet is given below :
void DialogPlayer::OnBnClickedButton12()
{
    bool x= CreateVideoGraph();
}

BOOL DialogPlayer::CreateVideoGraph()//Creating the graph for video
{
	hr =  CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
	if(FAILED(hr))
	{
		return FALSE;
	}
	if (SUCCEEDED(hr))
	{
		//Create the Capture Graph Builder.
		hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL,CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2,(void **)&pBuilder);
		if(FAILED(hr))
		{
			return FALSE;
		}
		if (SUCCEEDED(hr))
		{
			hr=pBuilder->SetFiltergraph(pGraph);
			if(FAILED(hr))
			{
				return FALSE;
			}
		}
	}
	hr= pGraph->QueryInterface(IID_IMediaControl,(LPVOID *) &(pControl));
	hr=pGraph->QueryInterface(IID_IVideoWindow, (LPVOID *) &(VideoWindow));
	ICreateDevEnum *pSysDevEnum = NULL;
	hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
	if(FAILED(hr))
	{
		return FALSE;
	}
	IEnumMoniker *pEnumCat = NULL;
	hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnumCat, 0);
	if (hr == S_OK) 
	{
		 IMoniker *pMoniker = NULL;
		 ULONG cFetched;
		while(pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK)
		{
			IPropertyBag *pPropBag;
			hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
			if (SUCCEEDED(hr))
			{
				VARIANT varName;
				VariantInit(&varName);
				hr = pPropBag->Read(L"FriendlyName", &varName, 0);
				BSTR name2=varName.bstrVal;
				if((wcscmp(name2, "Video Capture AV")==0))
				{
					hr=pMoniker->BindToObject(0,0,IID_IBaseFilter, (void**)&(VideoSourceFilter));
					hr=pGraph->AddFilter(VideoSourceFilter,L"Video Source");
					check1=1;
				}
				if(check1==0)
				{
					return FALSE;
				}
           pPropBag->Release();
        }
		pMoniker->Release();
		}
		pEnumCat->Release();
    }
	else
	{
		return FALSE;
	}
	pSysDevEnum->Release();
	hr = CoCreateInstance(CLSID_VideoRenderer, 0, CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void**)(&VideoRenderer));
	IPin *outPin;
	IPin *inPin;
	hr = pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, VideoSourceFilter,IID_IAMCrossbar, (void **)(&CrossbarFilter));
	hr = pBuilder->FindPin(VideoSourceFilter,PINDIR_OUTPUT,NULL,NULL,FALSE,0,&outPin);
	hr = pGraph->Render(outPin); //here only i got error
	return TRUE;
}

AnswerRe: Problem with CROSSBAR in DirectShow Pin
Tim Craig13-Aug-08 9:27
Tim Craig13-Aug-08 9:27 
AnswerRe: Problem with CROSSBAR in DirectShow Pin
tanvon malik16-Aug-08 23:55
tanvon malik16-Aug-08 23:55 
GeneralRe: Problem with CROSSBAR in DirectShow Pin
bhanu_850922-Aug-08 3:35
bhanu_850922-Aug-08 3:35 
QuestionImage Control Pin
Dean Moe9-Aug-08 3:47
Dean Moe9-Aug-08 3:47 
AnswerRe: Image Control Pin
John_Adams22-Aug-08 9:10
John_Adams22-Aug-08 9:10 
QuestionIcon Creation Pin
The Only Nock7-Aug-08 14:31
The Only Nock7-Aug-08 14:31 
AnswerRe: Icon Creation Pin
Shog97-Aug-08 20:09
sitebuilderShog97-Aug-08 20:09 
GeneralRe: Icon Creation Pin
The Only Nock8-Aug-08 7:25
The Only Nock8-Aug-08 7:25 
GeneralRe: Icon Creation Pin
Shog98-Aug-08 7:28
sitebuilderShog98-Aug-08 7:28 
GeneralRe: Icon Creation Pin
The Only Nock8-Aug-08 8:15
The Only Nock8-Aug-08 8:15 
GeneralRe: Icon Creation Pin
Shog98-Aug-08 8:23
sitebuilderShog98-Aug-08 8:23 
GeneralRe: Icon Creation Pin
The Only Nock8-Aug-08 8:20
The Only Nock8-Aug-08 8:20 
GeneralRe: Icon Creation Pin
Shog98-Aug-08 8:24
sitebuilderShog98-Aug-08 8:24 
Questiondirectx in vs 2008 Pin
followait7-Aug-08 6:28
followait7-Aug-08 6:28 
AnswerRe: directx in vs 2008 Pin
Mark Salsbery7-Aug-08 7:43
Mark Salsbery7-Aug-08 7:43 
GeneralRe: directx in vs 2008 Pin
followait7-Aug-08 19:51
followait7-Aug-08 19:51 
QuestionAmcap SDK directshow. Pin
suefyzah6-Aug-08 20:03
suefyzah6-Aug-08 20:03 

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.