PDA

View Full Version : Codec::getAvailableCodecs



jamesslootweg
February 20, 2008, 15:26:49
When i call the function Codec::getAvailableCodecs it returns empty. But when I run the ImageandAVICapture demo, the function works and returns a list of available codecs. What am I doing wrong.

Stefan Geissler
February 20, 2008, 15:51:28
James,

did you try something like that:


m_CodecListPtr = Codec::getAvailableCodecs();
unsigned int i = 0;
for( i = 0; i < m_CodecListPtr->size();i++ )
{
m_ComboCodecs.AddString( m_CodecListPtr->at(i)->getName().c_str());
...

jamesslootweg
February 20, 2008, 16:41:59
m_CodecListPtr = Codec::getAvailableCodecs();
unsigned int i = 0;
if(m_CodecListPtr->size() == 0)
{
AfxMessageBox("No codecs found\n");
return;
}

The code above is what I am using, m_CodecListPtr is declared in the .h file. The size of m_CodecListPtr after the getAvailableCodecs is always 0. Where as the sample code you gave me in your last post (which is the same as in the ImageandAVICapture demo) works in the ImageandAVICapture demo. Does something need to be included to get the codecs.

Stefan Geissler
February 20, 2008, 16:45:45
James,

Thank you. I guess, all the other stuff, like Initlibrary() etc.is also in your program? (Please do not post any license keys, if you post your code... :-) )

jamesslootweg
February 20, 2008, 16:57:07
Yeah all that stuff is there. I can get the live view from the selected device to work. Its just this line that is failing, this causes MediaStreamSink::create to fail.

Stefan Geissler
February 20, 2008, 16:58:44
James,

Thank you. If you sent your project as zip file to support@imagingcontrol.com, I can have a look on it tomorrow (its 6 pm here now).

jamesslootweg
February 20, 2008, 17:02:21
OK will do. I'll put the email subject as the same as this thread

Stefan Geissler
February 22, 2008, 15:15:16
James,

I got your email and answered. You used the IC Imaging Control VC 71 DLLs in a VC8 project. This must create an error. I fixed your project and sent it back to you.

In order to avoid these kind of library conflicts, you can add following line in the stdafx.h file:


// Define the pass to the libraries. The compiler will automatically link the correct
// IC Imaging Control libs to the project. It is not necessary to specify VC7.1 or VC 8 any more.
#define UDSHL_LIB_BASEDIR "c:/program files/The Imaging Source Europe GmbH/IC Imaging Control 3.0/classlib/"

Remove the references of the IC libraries files in the Linker section of your project settings.

If you change your Visual Studio version, you do not have to take care about the needed library versions.

As soon as IC Imaging Control will support Visual Studio 2008 you could change to VS 2008 without changing anything in your project, if you used the define above. (At least may be the version changes from 3.0 to 3.1, but this would be the only change for this define.)