Click to See Complete Forum and Search --> : Problem using ISmartRenderEngine


sh_roohani
December 10th, 2005, 08:56 AM
Hello,
I'm using DirectX 8.1, actually the DirectShow portion, in Visual C++ 6.0. Among its VB samples, there is a Trimmer sample which uses ISmartRenderEngine as follows:
Dim objSmartRenderEngine As New SmartRenderEngine
I try to imitate the same thing in C++:
hr = CoCreateInstance(CLSID_SmartRenderEngine, NULL, CLSCTX_INPROC_SERVER, IID_ISmartRenderEngine, (void**)&m_pRenderer);
and m_pRenderer is declared as follows:
ISmartRenderEngine *m_pRenderer;
So far, it compiles fine. But as soon as I try to imitate this statement:
objSmartRenderEngine.SetTimelineObject objTimeline
as:
hr = m_pRenderer->SetTimelineObject(m_pTimeline);
it does not compile. The Error message is:

error C2039: 'SetTimelineObject' : is not a member of 'ISmartRenderEngine'

Isn't the VB version using the same function of the same interface, that is, ISmartRenderEngine::SetTimelineObject?
The same problem happens to ConnectFrontEnd, GetFilterGraph, GetGroupOutputPin, and ScrapIt.
In fact, these functions are not really exposed by ISmartRenderEngine, but by IRenderEngine. But I'm wondering how ISmartRenderEngine::SetTimelineObject is used in the VB sample and compiles fine, but it doesn't compile in VC++ 6.0!
Shouldn't COM objects work the same way in all environments which support COM?

Regards,
Shahram

sh_roohani
December 12th, 2005, 09:51 AM
Hi,

I was wrong. The interface which VB sample uses, is Basic Render Engine, not Smart Render Engine, because:
1. Smart compression is not currently supported in VB, according to DirectX documentation,
2. VB Object Browser shows that this is only a name change, and smart render engine interface has the same structure as basic render engine in VB.

Now, I want to recompress a portion of an AVI file with a new codec or its current codec, into a new AVI file. I checked DirectShow recompression tutorial, but it recompresses a file totally, while I want to do it partially, for example from frame f1 to frame f2. Seeking is not possible on that filter graph. So, I need to use Timeline and because I want to reduce rendering time when both input and output codecs are the same, I should use Smart Render Engine. I can get a compressor object through IMoniker::BindToObject, but I don't know how to use it with Smart Render Engine.
Could anyone please give me a clue on how to use Smart Render Engine, and how to apply compression to the output? DirectShow documentation is a little bit ambiguous in this field (smart compression).

Thanks