|
That HRESULT value stays for E_FAIL which has no more specific details. Have a look at the documentation of ICaptureGraphBuilder2::RenderStream[^] on the MSDN; on the remarks section there are 2 sentences that could help you:
- If pSource is a filter, the method searches for an output pin on that filter. In that case, use the pCategory and pType parameters to narrow the search. For example, if a filter has separate pins for preview and capture, you can specify either PIN_CATEGORY_CAPTURE or PIN_CATEGORY_PREVIEW. If pSource is an output pin, set the pCategory and pType to NULL.
- File Sources. You can use this method to transcode or recompress a file. The following discussion assumes that the file has at most one video stream and one audio stream, or else a single interleaved stream. Otherwise, the method will not work correctly. A file source has one output pin, so set pCategory and pType to NULL. Call the method twice — once to render the video stream, and once to render the audio stream. The first call connects the source filter to a parser filter and renders one of the parser filter's output pins. The second call renders the parser's remaining output pin. If you are compressing one stream but not the other, make sure to specify the compressor filter in the first call. The method will automatically pick the correct stream based on the compression type.
|
|
|
|
|
I use intelligent connect. It should find all pins and connects them together automatically? How do I need to manage those pins manually?
IBaseFilter *pSrcFilter = NULL;
hr = m_pGraph->AddSourceFilter(fileName, L"Source Filter", &pSrcFilter);
if (FAILED(hr))
return -3;
IBaseFilter* pGrabberFilter = NULL;
hr = AddSampleGrabber(&pGrabberFilter);
if (FAILED(hr)) {
pSrcFilter->Release();
return -4;
}
IBaseFilter* pNullFilter = NULL;
hr = AddNullRenderer(&pNullFilter);
if (FAILED(hr)) {
pGrabberFilter->Release();
pSrcFilter->Release();
return -5;
}
hr = m_pCapture->RenderStream(NULL, NULL,
pSrcFilter, pGrabberFilter, pNullFilter);
Addition of the NULL renderer and sample grabber are typical from MSDN
IBaseFilter* pFilter;
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pFilter);
if (FAILED(hr))
return hr;
*ppNullFilter = pFilter;
hr = m_pGraph->AddFilter(pFilter, L"Null Renderer");
if (FAILED(hr)) {
pFilter->Release();
return hr;
}
(*ppNullFilter)->AddRef();
pFilter->Release();
Чесноков
|
|
|
|
|
Look at these pages from MSDN:
|
|
|
|
|
Why intelligent connect fails with .mpg files but works with others as .avi, .mp4?
Чесноков
|
|
|
|
|
If I set those parameters it returns 0x80070057
RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrcFilter, pGrabberFilter, pNullFilter);
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: If I set those parameters it returns 0x80070057
This code stays for E_INVALIDARG ; try to set both to NULL , or to set the second parameter to MEDIASUBTYPE_MPEG1Video
|
|
|
|
|
They are both set to NULL and it fails to play .mpg files.
When 1st param is NULL and 2nd is set it pruduces SEH
Чесноков
|
|
|
|
|
What I meant was:
RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIASUBTYPE_MPEG1Video, pSrcFilter, pGrabberFilter, pNullFilter);
|
|
|
|
|
That one along with MEDIATYPE_Video results in 0x80070057 on any video file.
If both are NULL only .mpg can not be rendered.
Codec icon appears in task bar as you connect to .mpg with both to NULL but then the error is returned as in the topic question and it disappears.
Чесноков
|
|
|
|
|
Hi,
As we know there are various compilers available for C language for windows.
If the performance is the only criteria, which one to choose?
I want to choose the compiler on which my application should give the best result.
(I don't need any libraries like MFC, ATL...) I just need to use some variables and arrays.
|
|
|
|
|
You can try the Intel C++ Compiler Professional Edition for Windows (start from here[^] to get informations and download a trial). It is able to do automatically a lot of optimizations that are difficult to find on other products, like loop-unrolling, auto-vectorization, auto-parallelization, etc.
The Microsoft C/C++ compiler that ships with Visual Studio is another very good optimizing compiler.
|
|
|
|
|
Thanks a lot for the reply.
I would love if i could create the best performing application on a free/open source C compiler.
|
|
|
|
|
Then the Intel C++ compiler could not be the right one: there exists a free version of it, but only for Linux and as long as you use it for not commercial purposes.
On Windows you can use the Visual C++ Express Edition: it's free for both commercial and not-commercial uses. The Express Edition doesn't ship with ATL nor MFC, but you said that you don't need them. I know for sure that the Express Edition doesn't support the OpenMP libraries; however it's a very good optimizing compiler, and the Visual Studio debugger is claimed to be one of the best available.
You can also try any of the GCC ports (MinGW and Cygwin); as I know they support both the C89 and C99 standards (the Visual C++ only supports the C89) and the OpenMP too. I heard that GCC has a variety of switches that affect the optimizations done and that exists an open-source project that analyze your application to find out the best switches configuration to use (but I don't remember its name).
Another option could be the Open Watcom: the Watcom C/C++ compilers are born in the 80s as commercial/closed source product and has been one of the best compilers until the end of the century; in the 2003 has been released to the open source community that continued its development since now.
|
|
|
|
|
Thanking you once again for reply.
What is your view about Borland/Turbo C++.
Mentioning you once again, performance is the only criteria.
My application will use only few variables and 1 or 2 arrays but a huge set of calculations.
|
|
|
|
|
I used Turbo C++ under MS-DOS (they was great days ), but I never used the Borland C/C++ under Windows. As far as I know Borland haven't had a great success with their C/C++ compilers on Windows and I think that they moved their efforts to Delphi. Anyway Borland gives for free only very old versions of their compilers.
|
|
|
|
|
Borland C+ is awful; it does almost no real optimizations for modern CPUs and the IDE is extremely flaky and dated. For general use, Visual Studio Express is hard to beat. It has a damn good compiler, second only to Intel's compiler in quality of code, but vastly superior in overall tool awesomeness (the Visual Studio debugger is fabulous.) gcc is third, but their tools reek. Nothing else is worth the time or effort.
|
|
|
|
|
The most sensible thing to do is try them and see which ones generates the best code for your problem on whatever system they have to run on. Most manufacturers (e.g. Intel and Microsoft) produce free compilers which will be good enough for evaluating how they perform.
Cheers,
Ash
|
|
|
|
|
By the way, are you looking for a C or for a C++ compiler? People are giving you advices regarding C++ compilers and you are persistently talking of a "C compiler". While each C++ compiler must be able to process C-code and generate C-code binaries, there might be specialized C-compilers for generating fast C-binaries...
|
|
|
|
|
paul_71 wrote: While each C++ compiler must be able to process C-code and
You are right paul. Actually, I am looking for fastest free C compiler only, but C++ is also acceptable as it can also compile C code.
As you mentioned, specialized C compiler for generating fast/best optimized binaries would be the best for me.
|
|
|
|
|
Hi all,
when i m trying to stop running thread ,than some time exception occur and point out on this location in call stack
> test.exe!CMapPtrToPtr::GetNextAssoc(__POSITION * & rNextPosition=0xfeeefeee, void * & rKey=0xfeeefeee, void * & rValue=0xfeeefeee) Line 294 C++
i dont understand whats going wrong please help me for this.
thanks in advance.
|
|
|
|
|
IIRC when you see an object with the bit pattern 0xfeeefeee in VC++ it means the object's been deleted. So my first guess would be you've got a map and and you're trying to delete it twice, or trying to use it for something after it's been deleted.
Cheers,
Ash
|
|
|
|
|
Are you trying to stop thread A from within itself, or from some other thread?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
i m doing like this.
class CTimerTh :: CWinThread
{
}
class CMy_Th::CTimerTh
{
}
//i create thread with AfxBeginThread and use here CMy_Th as run time class and and save its return pointer in std::map<int, CMy_Th*> ass
ass[0] = (CMy_Th*) AfxBeginThread( RUNTIME_CLASS(CMy_Th),THREAD_PRIORITY_NORMAL, NULL,CREATE_SUSPENDED,
NULL);
std::map<int, CMy_Th*>::iterator pos = ass.find(0);
if(pos != ass.end())
{
if(pos->second!=NULL)
{
CMy_Th* pThread = pos->second;
pThread->PostThreadMessage(WM_QUIT,NULL,NULL);
}
ass.erase(pos);
}
</pre>
please me to resolve the error.
thanks in advance.
|
|
|
|
|
Le@rner wrote: pThread->PostThreadMessage(WM_QUIT,NULL,NULL);
See here. I prefer to let threads kill themselves, and use events to signal between them.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi all,
i m working on SDI type application ,i want to set some minimum size of application.
please tell me how can i do this.
thanks in advance
|
|
|
|