Elecard
May 22, 2013, 06:03:26 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: IModuleConfig (MPEG-4 Encoder)  (Read 6078 times)
DavidSchumaker
Newbie
*
Posts: 3


View Profile
« on: March 06, 2006, 08:59:43 am »

I am having difficulties using the IModuleConfig interface with the mpeg-4 encoder.
I can create the interface (see code below) and all calls return without error.  However, when I commit the changes and atempt to write them to the registry, the expected values are not written.  Instead, default values are written.  This does not happen with all of the avalable parameters.  For example I can set "EM4VE_OutFps", but I cannot set "EM4VE_ChangeFps".  

Any thoughts?

//--------
IModuleConfig * pConfig = NULL;
hr = m_pElecardEncoder->QueryInterface(IID_IModuleConfig, (void**)&pConfig));   
CComBSTR  bx(_T("Software\\test"));
hr = pConfig->LoadFromRegistry(0x80000002, bx, TRUE);
var.ChangeType(VT_INT);      
var = 0;      
hr = pConfig->SetValue(&EM4VE_Profile ,&var);

var = 4;
hr = pConfig->SetValue(&EM4VE_Level ,&var);

var.iVal = 1;
hr = pConfig->SetValue(&EM4VE_RateControlMode ,&var);

var = m_dwCaptureRate;
hr = pConfig->SetValue(&EMC_GOP_LENGTH ,&var);

var.ChangeType(VT_BOOL);
var.boolVal = 1;
hr = pConfig->SetValue(&EM4VE_ChangeFps ,&var);

var.ChangeType(VT_BSTR);
hr = pConfig->CommitChanges(&var);

hr = pConfig->SaveToRegistry(0x80000002, bx,TRUE);
Logged
Ivan Naletov
Newbie
*
Posts: 1


View Profile
« Reply #1 on: March 13, 2006, 06:07:05 am »

Hi, David,

First of all, sorry for replying you so late.

The code is perfect, excepting some inaccuracies and the filter error.

As for EM4VE_ChangeFps parameter:  The encoder input pin may be disconnected and when  you are trying to change the output frame rate, the filter can not support it. Please check it.
The highest value of the parameter “Level” with Simple Profile is 3. The filter adjust this value when calling CommitChanges() method.
The error occurs when SetValue() is called using the identifier  with EM4VE_ prefix as the parameter if there is similar parameter but with EMC_ refix. You can fix it using identifiers with EMC_prefix.

You are welcome to contact me and I will be glad to supply you with the new fixed encoder version, though you can choose to wait for the release of this software.

Best Regards,
Ivan Naletov.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!