[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-cvs
Subject: [Datatype-cvs] tools/dtdriver/engine cencsrchdlr.cpp,1.46,1.47
From: stanb () helixcommunity ! org
Date: 2009-12-29 18:47:43
Message-ID: 200912291847.nBTIlZF1026307 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/datatype/tools/dtdriver/engine
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv30041
Modified Files:
cencsrchdlr.cpp
Log Message:
Synopsis: These changes allow using DTDR and Direct Producer Input for thumbnail generation
of file types that Producer SDK handles better then actual Helix file format / renderer plugins.
To achieve this goal 2 fixes are implemented:
- allow producer input to ignore audio (in the same way it can ignore video already);
- passing Start Time property down to Producer input plugin.
Index: cencsrchdlr.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/cencsrchdlr.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- cencsrchdlr.cpp 30 Jul 2009 01:45:34 -0000 1.46
+++ cencsrchdlr.cpp 29 Dec 2009 18:47:41 -0000 1.47
@@ -433,6 +433,7 @@
, m_bHaveAudio(FALSE)
, m_bHaveVideo(FALSE)
, m_bDisableVideo(FALSE)
+ , m_bDisableAudio(FALSE)
, m_bEnableProducerSDKLogging(FALSE)
, m_bDisableResizePadding(FALSE)
, m_bEnablePacketLogging(FALSE)
@@ -783,13 +784,20 @@
}
}
- IHXBuffer* pVideoFormat = NULL;
- m_pOptions->GetPropertyCString(ENCODEVIDEO_OPTION_NAME, pVideoFormat);
- if(!pVideoFormat || strlen((const char*)pVideoFormat->GetBuffer()) == 0)
+ IHXBuffer* pFormat = NULL;
+ m_pOptions->GetPropertyCString(ENCODEVIDEO_OPTION_NAME, pFormat);
+ if(!pFormat || strlen((const char*)pFormat->GetBuffer()) == 0)
{
m_bDisableVideo = TRUE;
}
- HX_RELEASE(pVideoFormat);
+ HX_RELEASE(pFormat);
+
+ m_pOptions->GetPropertyCString(ENCODEAUDIO_OPTION_NAME, pFormat);
+ if(!pFormat || strlen((const char*)pFormat->GetBuffer()) == 0)
+ {
+ m_bDisableAudio = TRUE;
+ }
+ HX_RELEASE(pFormat);
// Instruct decoder to produce at least 16bit samples
ULONG32 ulMinOutputBitsPerSample = 0;
@@ -1219,6 +1227,40 @@
}
}
+ if (SUCCEEDED(retVal))
+ {
+ UINT32 nStartTime = 0;
+ retVal = m_pOptions->GetPropertyULONG32(kPropStartTime, nStartTime);
+ if (SUCCEEDED(retVal))
+ {
+ IUnknown* pUnkTime = NULL;
+ retVal = CreateInstanceCCF(CLSID_IHXTTime, (void**) &pUnkTime, m_pContext);
+ if (SUCCEEDED(retVal))
+ {
+ // QI for IHXTTime
+ IHXTTime* pTime = NULL;
+ retVal = pUnkTime->QueryInterface(IID_IHXTTime, (void**) &pTime);
+ if (SUCCEEDED(retVal))
+ {
+ // Set the duration
+ retVal = pTime->SetTime(nStartTime);
+ if (SUCCEEDED(retVal))
+ {
+ // Add duration to the input property bag
+ retVal = pInitParams->SetUnknown(kPropStartTime, pUnkTime);
+ }
+ }
+ HX_RELEASE(pTime);
+ }
+ HX_RELEASE(pUnkTime);
+ }
+ else
+ {
+ // Not an error if this option is not set.
+ retVal = HXR_OK;
+ }
+ }
+
if (SUCCEEDED(retVal))
{
// Build an input instance
@@ -1591,12 +1633,19 @@
// Do we have any audio streams?
if (m_bHaveAudio)
{
- // Assume we are encoding music
- retVal = pOutputProfile->SetString(kPropAudioMode, kValueAudioModeMusic);
- // Other audio-related media profile properties could
- // be set here. They include:
- // kPropDisableAudio
- // kPropAudioResamplingQuality
+ if(m_bDisableAudio)
+ {
+ retVal = pOutputProfile->SetBool(kPropDisableAudio, TRUE);
+ }
+ else
+ {
+ // Assume we are encoding music
+ retVal = pOutputProfile->SetString(kPropAudioMode, kValueAudioModeMusic);
+ // Other audio-related media profile properties could
+ // be set here. They include:
+ // kPropDisableAudio
+ // kPropAudioResamplingQuality
+ }
}
// Do we have any video streams?
if (m_bHaveVideo && SUCCEEDED(retVal))
@@ -1680,7 +1729,7 @@
{
if(m_bEncodeFromURL)
{
- if( m_bHaveAudio )
+ if( m_bHaveAudio && !m_bDisableAudio )
{
retVal = SetupAudioConfig(pAudience, &m_pStreamState[0]);
}
@@ -1696,7 +1745,7 @@
UINT32 i = 0;
for (i = 0; i < m_ulStreamCount && SUCCEEDED(retVal); i++)
{
- if (m_pStreamState[i].m_bIsAudioStream)
+ if (m_pStreamState[i].m_bIsAudioStream && !m_bDisableAudio)
{
retVal = SetupAudioConfig(pAudience, &m_pStreamState[i]);
}
_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic