[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-client-cvs
Subject: [Client-cvs]
From: tburton () helixcommunity ! org
Date: 2010-01-29 0:47:37
Message-ID: 201001290050.o0T0o5wl015639 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/client/encodesvc/common/tokenreplacer
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv13032
Modified Files:
hxtjobtokenreplacer.cpp Umakefil hxtbagtokenreplacer.cpp
Log Message:
Description: Fixed Bug 256585: Producer treats output filenames containing
substitution vars as relative and prepends working dir
================================================
The problem here was that HXBuildInstanceAfterTransformFromBuffer was
returning HXR_FAIL if a file destination was invalid
(i.e. Filename=“%InputFilePath%/test.rm”). This result was then used to tell
the cli or activex that the job was invalid.
The solution was to do token substitution in deserializeJobFromBuffer and
deserializeJob.
- These two functions are called when HXBuildInstanceFromFile and
HXBuildInstanceFromBuffer are called.
- Each function has a CHXTElement (xml element)
- Add JobFile to the CHXTElement in deserializeJob (from file).
- Do token substitution on each CHXTElement with a new token replacer.
- Let the ReadEncodingJob create the encoding job from the CHXTElement
that has substitution.
Description: Fixed Bug 256913:
Remove job filename argument from StartEncoding function.
================================================
Job filename was provided to StartEncoding because the token replacer in
StartEncoding needed to know the job file path to do substitution. To provide
this, I was passing job filename to start encoding and then to the token
replacer. This was not a good fix because of bug 256585 preventing job creation
and StartEncoding was a common function that should not need job filename.
A new fix was to add the job filename to the encoding job.
This fix required the following:
1) Add JobFile to the job xsd
2) Remove the job filename from StartEncoding calls (remove old fix)
3) Insert the job filename into the encoding job
4) Have the gui insert JobFile into the job buffer (Dura did this)
5) Handle JobFile similar to JobName. This includes passing on it in
OnSetString calls.
Files Changed:
================================================
client/encodesvc/activex/ctrl/ProducerCtrl.cpp
producerapps/cmdproducer/session.cpp
client/encodesvc/common/util/hxccfhelper.cpp
client/encodesvc/include/ihxtconstants.h
client/encodesvc/include/ihxtencodingjob.h
client/encodesvc/engine/encsession/encodingjob.cpp
client/encodesvc/engine/encsession/encodingjob.h
client/encodesvc/engine/encsession/jobserial.cpp
client/encodesvc/engine/encsession/settingsadvisor.cpp
client/encodesvc/common/tokenreplacer/Umakefil
client/encodesvc/common/tokenreplacer/hxtbagtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/hxtjobtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/pub/hxtbagtokenreplacer.h
client/encodesvc/common/tokenreplacer/pub/hxtjobtokenreplacer.h
producerapps/installer/root/xmlschemas/job.3.0.xsd
Files Added:
================================================
client/encodesvc/common/tokenreplacer/hxtelementtokenreplacer.cpp
client/encodesvc/common/tokenreplacer/pub/hxtelementtokenreplacer.h
Branches:
================================================
13_0, HEAD
Index: hxtjobtokenreplacer.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/common/tokenreplacer/hxtjobtokenreplacer.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hxtjobtokenreplacer.cpp 21 Jan 2010 20:27:25 -0000 1.3
+++ hxtjobtokenreplacer.cpp 29 Jan 2010 00:47:34 -0000 1.4
@@ -43,20 +43,20 @@
-
-
-HXTJobTokenReplacer::HXTJobTokenReplacer(IHXTEncodingJobPtr spJob, IHXValues* \
pValues, IHXCommonClassFactory* pFactory): \
+HXTJobTokenReplacer::HXTJobTokenReplacer(IHXTEncodingJobPtr spJob, \
IHXCommonClassFactory* pFactory): m_spJob(spJob)
- ,m_pValues(pValues)
- ,m_spFactory(pFactory)
+ ,m_pFactory(pFactory)
{
- m_vEnvVars = m_pAdvisorUtils.GetEnvironmentVariables();
- m_mapTimeValues = m_pAdvisorUtils.GetLocalTimeMappings();
+ m_vEnvVars = m_AdvisorUtils.GetEnvironmentVariables();
+ m_mapTimeValues = m_AdvisorUtils.GetLocalTimeMappings();
+ m_pFactory->AddRef();
+ m_pFactory->CreateInstance(CLSID_IHXValues, (void**)&m_pValues);
}
HXTJobTokenReplacer::~HXTJobTokenReplacer()
{
-
+ HX_RELEASE(m_pValues);
+ HX_RELEASE(m_pFactory);
}
@@ -156,69 +156,60 @@
res = spDestination->SetString(kPropOutputPathname, (const \
char*)sAfterReplace);
// Here we will:
- // 1) Get the property enumerator for the destination
- // 2) Create a new property bag
- // 3) Get all (Key,Value) pairs from the destination and set them to the \
property bag
- // 4) Build a new instance of the destination through HXBuildInstance
- // 5) Remove the old destination from the job
- // 6) Add the new destination to the job
-
- // Get the property enumerator
- IHXTPropertyEnumeratorPtr spEnumProps;
- res = spDestination->GetPropertyEnumerator(spEnumProps.Adopt());
+ // 1) Serialize the Destination object to a buffer
+ // 2) Create a new destination and provide the above buffer for \
deserialization + // 3) Remove the old destination from the job
+ // 4) Add the new destination to the job
+
+ IHXTSerializeBufferPtr spSerialWrite;
+ if ( SUCCEEDED(res) )
+ {
+ res=spDestination->QueryInterface(IID_IHXTSerializeBuffer, \
(void**)spSerialWrite.Adopt()); + }
- if(SUCCEEDED(res))
- {
- IHXTPropertyBagPtr spDestinationBag = NULL;
- res = m_spFactory->CreateInstance(IID_IHXTPropertyBag, \
(void**)spDestinationBag.Adopt()); + IHXBuffer* pBuf = NULL; \
+ res = m_pFactory->CreateInstance(CLSID_IHXBuffer, \
(void**)&pBuf);
- // Get the first prop
- IHXTPropertyPtr spProp;
- HX_RESULT resEnum = spEnumProps->First(spProp.Adopt());
+ //Save the current destination to a buffer.
+ if ( SUCCEEDED(res) )
+ {
+ res = spSerialWrite->WriteToBuffer( pBuf);
+ }
- while(SUCCEEDED(resEnum) && resEnum != HXR_ELEMENT_NOT_FOUND && \
SUCCEEDED(res))
- {
- if(spProp->GetType() == eTypeCString)
- {
- const char* szValue = NULL;
- resEnum = spDestination->GetString(spProp->GetKey(), &szValue);
- if(SUCCEEDED(resEnum))
- {
- resEnum = spDestinationBag->SetString(spProp->GetKey(), szValue);
- HX_ASSERT("Failed to set destination bag property" && SUCCEEDED(resEnum));
- }
- }
- if(SUCCEEDED(resEnum))
- {
- resEnum = spEnumProps->Next(spProp.Adopt());
- }
- }
-
- // Create Destination from PropertyBag
- if(SUCCEEDED(resEnum))
- {
- IHXTDestinationPtr spNewDestination = NULL;
- res = HXBuildInstance(m_spFactory, IID_IHXTDestination, spDestinationBag, \
(IUnknown**)spNewDestination.Adopt(), TRUE);
- if(SUCCEEDED(res))
- {
- // Remove old destination from job
- res = spOutputProfile->RemoveDestination(j);
- HX_ASSERT("Failed to remove destination" && SUCCEEDED(res));
+ IHXTDestinationPtr spNewDestination = NULL;
+
+ res = m_pFactory->CreateInstance(IID_IHXTDestination, \
spNewDestination.AdoptVoid()); + IHXTSerializeBufferPtr \
spSerialRead; + if ( SUCCEEDED(res) )
+ {
+ \
res=spNewDestination->QueryInterface(IID_IHXTSerializeBuffer, \
(void**)spSerialRead.Adopt()); + }
- // Add new destination (with all replacements) to the job
- if(SUCCEEDED(res))
- {
- res = spOutputProfile->AddDestination(spNewDestination);
- HX_ASSERT("Failed to add replacement destination to job" && \
SUCCEEDED(res)); + if ( SUCCEEDED(res) )
+ {
+ res = spSerialRead->ReadFromBuffer( pBuf, true);
+ HX_RELEASE(pBuf);
+ }
- // We removed a destination from the front of the output.
- // We must now update the indexes of the next destination and the total \
original destinations left to look at.
- j--;
- uiDestinationCount--;
- }
- }
- }
- }
+ if(SUCCEEDED(res))
+ {
+ // Remove old destination from job
+ res = spOutputProfile->RemoveDestination(j);
+ HX_ASSERT("Failed to remove destination" && SUCCEEDED(res));
+
+ // Add new destination (with all replacements) to the job
+ if(SUCCEEDED(res))
+ {
+ res = spOutputProfile->AddDestination(spNewDestination);
+ HX_ASSERT("Failed to add replacement destination to job" \
&& SUCCEEDED(res)); +
+ // We removed a destination from the front of the \
output. + // We must now update the indexes of the next \
destination and the total original destinations left to look at. + \
j--; + uiDestinationCount--;
+ }
+
+ }
}
}
}
@@ -393,7 +384,6 @@
if(!sLeft.IsEmpty() && sLeft.Compare(sInputToken) == 0)
{
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
(const char*) sLeft, (const char*)sRight); sOutputToken = sRight;
return HXR_OK;
}
@@ -442,21 +432,17 @@
//------- Encoder IP address -------
if(sInputToken.Compare(kIPAddress) == 0)
{
- CHXString sIPAddress = m_pAdvisorUtils.GetIPAddress();
+ CHXString sIPAddress = m_AdvisorUtils.GetIPAddress();
if(!sIPAddress.IsEmpty())
{
sOutputToken = sIPAddress;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kIPAddress, (const char*)sIPAddress); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kIPAddress;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kIPAddress, (const char*)sOutputToken); }
-
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kIPAddress); return HXR_FAIL;
}
@@ -464,23 +450,23 @@
// kJobName
if(SUCCEEDED(res) && sInputToken.Compare(kJobName) == 0)
{
- // Get the full job
- const char* szJobName;
- IHXBuffer* bJobName;
- res = m_pValues->GetPropertyCString("JobPath", bJobName);
+ // Get the full job filename
+ const char* szJobFile;
+ if(SUCCEEDED(res))
+ {
+ res = m_spJob->GetString(kPropJobFile, &szJobFile);
+ }
// Remove path and extension information from full job
if(SUCCEEDED(res))
{
- szJobName = (const char*)bJobName->GetBuffer();
- CHXString sJobNoPath = szJobName;
+ CHXString sJobNoPath = szJobFile;
// If the set pValue for the job was ""
if(sJobNoPath.IsEmpty())
{
sOutputToken = "No";
sOutputToken += kJobName;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kJobName, (const char*)sOutputToken); return HXR_FAIL;
}
@@ -510,32 +496,29 @@
}
sOutputToken = sJobNoPath;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kJobName, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kJobName;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kJobName, (const char*)sOutputToken); }
-
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kJobName); return HXR_FAIL;
}
// kJobPath
else if(SUCCEEDED(res) && sInputToken.Compare(kJobFilePath) == 0)
{
- // Get the full job
- const char* szJobName;
- IHXBuffer* bJobName;
- res = m_pValues->GetPropertyCString("JobPath", bJobName);
+ // Get the full job filename
+ const char* szJobFile;
+ if(SUCCEEDED(res))
+ {
+ res = m_spJob->GetString(kPropJobFile, &szJobFile);
+ }
// Remove path and extension information from full job
if(SUCCEEDED(res))
{
- szJobName = (const char*)bJobName->GetBuffer();
- CHXString sJobPath = szJobName;
+ CHXString sJobPath = szJobFile;
INT32 iPathPosA = sJobPath.ReverseFind('/');
INT32 iPathPosB = sJobPath.ReverseFind('\\');
if(iPathPosA >= 0 && iPathPosB >= 0)
@@ -563,10 +546,8 @@
}
sOutputToken = sJobPath;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kJobFilePath, (const char*)sOutputToken); return HXR_OK;
}
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kJobFilePath); return HXR_FAIL;
}
@@ -634,17 +615,13 @@
HX_ASSERT(sFilenameNoPath.GetLength() > 0);
}
sOutputToken = sFilenameNoPath;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputFileName, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kInputFileName;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputFileName, (const char*)sOutputToken); }
-
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kInputFileName); return HXR_FAIL;
}
// kInputFilePath
@@ -687,10 +664,8 @@
sFilePath = "";
}
sOutputToken = sFilePath;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputFilePath, (const char*)sOutputToken); return HXR_OK;
}
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kInputFilePath); return HXR_FAIL;
}
// kInputADeviceNum
@@ -701,18 +676,15 @@
if(SUCCEEDED(res))
{
sOutputToken = sAudioDeviceID;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputADeviceNum, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kInputADeviceNum;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputADeviceNum, (const char*)sOutputToken); }
HX_ASSERT("No kPropAudioDeviceID for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kInputADeviceNum); return HXR_FAIL;
}
// kInputVDeviceNum
@@ -723,18 +695,15 @@
if(SUCCEEDED(res))
{
sOutputToken = sVideoDeviceID;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputVDeviceNum, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kInputVDeviceNum;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kInputVDeviceNum, (const char*)sOutputToken); }
HX_ASSERT("No kPropVideoDeviceID for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kInputVDeviceNum); return HXR_FAIL;
}
@@ -792,18 +761,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spOutputProfile->GetString(kPropName, \
&sOutputName))) {
sOutputToken = sOutputName;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kOutputName, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kOutputName;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kOutputName, (const char*)sOutputToken); }
HX_ASSERT("No kPropName for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kOutputName); return HXR_FAIL;
}
// kOutputType
@@ -813,18 +779,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spDestination->GetString(kPropOutputType, \
&sOutputType))) {
sOutputToken = sOutputType;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kOutputType, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kOutputType;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kOutputType, (const char*)sOutputToken); }
HX_ASSERT("No kPropOutputType for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kOutputType); return HXR_FAIL;
}
// kOutputTypeExt
@@ -837,20 +800,17 @@
if(strOutputType.Compare(kValueOutputTypeRealMedia) == 0)
{
sOutputToken = ".rm";
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kOutputTypeExt, (const char*)sOutputToken); return HXR_OK;
}
else if(strOutputType.Compare(kValueOutputTypeMP3) == 0)
{
sOutputToken = ".mp3";
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kOutputTypeExt, (const char*)sOutputToken); return HXR_OK;
}
else if(strOutputType.Compare(kValueOutputTypeRel5) == 0
|| strOutputType.Compare(kValueOutputTypeRel6) == 0)
{
sOutputToken = ".3gp";
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kOutputTypeExt, (const char*)sOutputToken); return HXR_OK;
}
else if(strOutputType.Compare(kValueOutputTypeMP4) == 0)
@@ -863,17 +823,13 @@
sOutputToken = "No";
sOutputToken += kOutputTypeExt;
HX_ASSERT("strOutputType did not match any known output types" && \
FALSE);
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kOutputTypeExt, (const char*)sOutputToken); }
}
else
{
sOutputToken = "No";
sOutputToken += kOutputTypeExt;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kOutputTypeExt, (const char*)sOutputToken); }
-
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kOutputTypeExt); return HXR_FAIL;
}
@@ -940,19 +896,15 @@
int tmp = SafeSprintf(buf, 12, "%g", uiBitrate / 1000.0);
HX_ASSERT(tmp < 12);
sOutputToken = buf;
-
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kBitrate, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kBitrate;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kBitrate, (const char*)sOutputToken); }
HX_ASSERT("No kPropCodecBitrate for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kBitrate); return HXR_FAIL;
}
// kNumRates
@@ -967,7 +919,6 @@
sOutputToken = "SR";
}
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \"%s\"", \
kNumRates, (const char*)sOutputToken); return HXR_OK;
}
// kACodec
@@ -977,18 +928,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spAStream->GetString(kPropCodecName, \
&sCodec))) {
sOutputToken = sCodec;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kACodec, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kACodec;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kACodec, (const char*)sOutputToken); }
HX_ASSERT("No kPropCodecName for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kACodec); return HXR_FAIL;
}
// kABitrate
@@ -1002,19 +950,15 @@
int tmp = SafeSprintf(buf, 12, "%g", uiABitrate / 1000.0);
HX_ASSERT(tmp < 12);
sOutputToken = buf;
-
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kABitrate, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kABitrate;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kABitrate, (const char*)sOutputToken); }
HX_ASSERT("No kPropCodecBitrate for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kABitrate); return HXR_FAIL;
}
// kAChannels
@@ -1024,18 +968,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spAStream->GetString(kPropCodecChannels, \
&sChannels))) {
sOutputToken = sChannels;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kAChannels, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kAChannels;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kAChannels, (const char*)sOutputToken); }
HX_ASSERT("No kPropCodecChannels for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kAChannels); return HXR_FAIL;
}
// kVCodec
@@ -1045,18 +986,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spVStream->GetString(kPropCodecName, \
&sCodec))) {
sOutputToken = sCodec;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVCodec, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVCodec;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVCodec, (const char*)sOutputToken); }
HX_ASSERT("No kPropCodecName for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVCodec); return HXR_FAIL;
}
// kVAvgBitrate
@@ -1070,19 +1008,15 @@
int tmp = SafeSprintf(buf, 12, "%g", uiVAvgBitrate / 1000.0);
HX_ASSERT(tmp < 12);
sOutputToken = buf;
-
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVAvgBitrate, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVAvgBitrate;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVAvgBitrate, (const char*)sOutputToken); }
HX_ASSERT("No kPropAvgBitrate for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVAvgBitrate); return HXR_FAIL;
}
// kVMaxBitrate
@@ -1096,19 +1030,15 @@
int tmp = SafeSprintf(buf, 12, "%g", uiVMaxBitrate / 1000.0);
HX_ASSERT(tmp < 12);
sOutputToken = buf;
-
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVMaxBitrate, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVMaxBitrate;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVMaxBitrate, (const char*)sOutputToken); }
HX_ASSERT("No kPropMaxBitrate for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVMaxBitrate); return HXR_FAIL;
}
// kVQuality
@@ -1120,18 +1050,15 @@
{
szQuality.AppendULONG((ULONG32)uiQuality);
sOutputToken = szQuality;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVQuality, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVQuality;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVQuality, (const char*)sOutputToken); }
HX_ASSERT("No kPropEncodingQuality for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVQuality); return HXR_FAIL;
}
// kVFPS
@@ -1197,18 +1124,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spVStream->GetString(kPropProfile, \
&szProfile))) {
sOutputToken = szProfile;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVProfile, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVProfile;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVProfile, (const char*)sOutputToken); }
HX_ASSERT("No kPropProfile for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVProfile); return HXR_FAIL;
}
// kVLevel
@@ -1218,18 +1142,15 @@
if(SUCCEEDED(res) && SUCCEEDED(spVStream->GetString(kPropLevel, \
&szLevel))) {
sOutputToken = szLevel;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVLevel, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVLevel;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVLevel, (const char*)sOutputToken); }
HX_ASSERT("No kPropLevel for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVLevel); return HXR_FAIL;
}
// kVComplexity
@@ -1239,18 +1160,15 @@
if(SUCCEEDED(res) && \
SUCCEEDED(spVStream->GetString(kPropEncodingComplexity, &szComplexity))) {
sOutputToken = szComplexity;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVComplexity, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVComplexity;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVComplexity, (const char*)sOutputToken); }
HX_ASSERT("No kPropEncodingComplexity for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVComplexity); return HXR_FAIL;
}
// kVBuffer
@@ -1262,18 +1180,15 @@
{
szBuffer.AppendULONG((ULONG32)dBuffer);
sOutputToken = szBuffer;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVBuffer, (const char*)sOutputToken); return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVBuffer;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVBuffer, (const char*)sOutputToken); }
HX_ASSERT("No kPropMaxStartupLatency for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVBuffer); return HXR_FAIL;
}
// kVKeyFrameInterval
@@ -1284,20 +1199,16 @@
if(SUCCEEDED(res) && \
SUCCEEDED(spVStream->GetDouble(kPropMaxTimeBetweenKeyFrames, &dKeyFrameInterval))) {
szKeyFrameInterval.AppendULONG((ULONG32)dKeyFrameInterval);
- sOutputToken = szKeyFrameInterval;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVKeyFrameInterval, (const char*)sOutputToken);
-
+ sOutputToken = szKeyFrameInterval;
return HXR_OK;
}
else
{
sOutputToken = "No";
sOutputToken += kVKeyFrameInterval;
- //HXTLOG(LC_APP_INFO, CMDLINE, "Substituting token \"%s\" for \
\"%s\"", kVKeyFrameInterval, (const char*)sOutputToken); }
HX_ASSERT("No kPropMaxTimeBetweenKeyFrames for substitution" && FALSE);
- //HXTLOG(LC_APP_WARN, CMDLINE, "Failed to find a substitution for token \
\"%s\".", kVKeyFrameInterval); return HXR_FAIL;
}
Index: hxtbagtokenreplacer.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/common/tokenreplacer/hxtbagtokenreplacer.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hxtbagtokenreplacer.cpp 21 Jan 2010 20:27:25 -0000 1.3
+++ hxtbagtokenreplacer.cpp 29 Jan 2010 00:47:34 -0000 1.4
@@ -45,17 +45,20 @@
-HXTBagTokenReplacer::HXTBagTokenReplacer(IHXTPropertyBag* pBag, IHXValues* pValues):
+HXTBagTokenReplacer::HXTBagTokenReplacer(IHXTPropertyBag* pBag, IHXValues* pValues, \
IHXCommonClassFactory* pFactory): m_pBag(pBag)
,m_pValues(pValues)
+ ,m_pFactory(pFactory)
{
- m_vEnvVars = m_pAdvisorUtils.GetEnvironmentVariables();
- m_mapTimeValues = m_pAdvisorUtils.GetLocalTimeMappings();
+ m_vEnvVars = m_AdvisorUtils.GetEnvironmentVariables();
+ m_pFactory->AddRef();
+ m_mapTimeValues = m_AdvisorUtils.GetLocalTimeMappings();
}
HXTBagTokenReplacer::~HXTBagTokenReplacer()
{
-
+ //HX_RELEASE(m_pValues);
+ HX_RELEASE(m_pFactory);
}
@@ -407,7 +410,7 @@
//------- Encoder IP address -------
if(sInputToken.Compare(kIPAddress) == 0)
{
- CHXString sIPAddress = m_pAdvisorUtils.GetIPAddress();
+ CHXString sIPAddress = m_AdvisorUtils.GetIPAddress();
if(!sIPAddress.IsEmpty())
{
sOutputToken = sIPAddress;
Index: Umakefil
===================================================================
RCS file: /cvsroot/client/encodesvc/common/tokenreplacer/Umakefil,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Umakefil 8 Jan 2010 11:01:51 -0000 1.1
+++ Umakefil 29 Jan 2010 00:47:34 -0000 1.2
@@ -62,6 +62,7 @@
"client/encodesvc/common/include",
"client/encodesvc/common/container/pub",
"client/encodesvc/common/util/pub",
+ "client/encodesvc/common/xmlparser/pub",
"client/encodesvc/common/tokenreplacer/pub"
)
@@ -80,7 +81,8 @@
project.AddSources("hxtjobtokenreplacer.cpp",
- "hxtbagtokenreplacer.cpp")
+ "hxtbagtokenreplacer.cpp",
+ "hxtelementtokenreplacer.cpp")
LibraryTarget("tokenreplacer")
_______________________________________________
Client-cvs mailing list
Client-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/client-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic