[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-client-cvs
Subject:    [Client-cvs] encodesvc/engine/encpipeline basepipeline.cpp, 1.4,
From:       gwright () helixcommunity ! org
Date:       2009-04-27 19:57:58
Message-ID: 200904272101.n3RL1kZh014845 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/client/encodesvc/engine/encpipeline
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv14441

Modified Files:
	basepipeline.cpp basepipeline.h outputpipeline.cpp 
	pipelinecon.cpp pipelinemgr.cpp 
Log Message:
Adding support for auto-sample rates.


Index: pipelinecon.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encpipeline/pipelinecon.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pipelinecon.cpp	13 Sep 2007 16:39:48 -0000	1.2
+++ pipelinecon.cpp	27 Apr 2009 19:57:55 -0000	1.3
@@ -67,7 +67,7 @@
 // For heap checking
 #include "hxheap.h"
 #ifdef _DEBUG
-#undef HX_THIS_FILE		
+#undef HX_THIS_FILE             
 static char HX_THIS_FILE[] = __FILE__;
 #endif
 
@@ -76,14 +76,14 @@
 static const EHXTVideoColorFormat kaePrefColorFormats[] = 
 {
     HXT_VIDEO_FORMAT_I420
-	,HXT_VIDEO_FORMAT_YV12
-	,HXT_VIDEO_FORMAT_YUY2
-	,HXT_VIDEO_FORMAT_UYVY
-	,HXT_VIDEO_FORMAT_YVU9
-	,HXT_VIDEO_FORMAT_BGR24_INVERTED
-	,HXT_VIDEO_FORMAT_BGR24_NONINVERTED
-	,HXT_VIDEO_FORMAT_BGRA32_INVERTED
-	,HXT_VIDEO_FORMAT_BGRA32_NONINVERTED
+        ,HXT_VIDEO_FORMAT_YV12
+        ,HXT_VIDEO_FORMAT_YUY2
+        ,HXT_VIDEO_FORMAT_UYVY
+        ,HXT_VIDEO_FORMAT_YVU9
+        ,HXT_VIDEO_FORMAT_BGR24_INVERTED
+        ,HXT_VIDEO_FORMAT_BGR24_NONINVERTED
+        ,HXT_VIDEO_FORMAT_BGRA32_INVERTED
+        ,HXT_VIDEO_FORMAT_BGRA32_NONINVERTED
 };
 
 static const UINT32 kulNumPrefColorFormats = \
sizeof(kaePrefColorFormats)/sizeof(EHXTVideoColorFormat); @@ -91,9 +91,9 @@
 
 //////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::CHXTPipelineConnector
+//      CHXTPipelineConnector::CHXTPipelineConnector
 // Purpose:
-//	Constructor.  
+//      Constructor.  
 CHXTPipelineConnector::CHXTPipelineConnector( IHXCommonClassFactory *pFactory )
 : CHXTPropertyBasedStrategy( pFactory )
 {}
@@ -101,9 +101,9 @@
 
 //////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::~CHXTPipelineConnector
+//      CHXTPipelineConnector::~CHXTPipelineConnector
 // Purpose:
-//	Destructor
+//      Destructor
 CHXTPipelineConnector::~CHXTPipelineConnector()
 {
 }
@@ -111,17 +111,17 @@
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::Negotiate
+//      CHXTPipelineConnector::Negotiate
 // Purpose:
-//	Connects two filters using the standard CHXTPropertyBasedStrategy::Negotiate
-//	and breaks complex ties in the event of a successful negotiation
+//      Connects two filters using the standard CHXTPropertyBasedStrategy::Negotiate
+//      and breaks complex ties in the event of a successful negotiation
 STDMETHODIMP CHXTPipelineConnector::Negotiate( IHXTPropertyBag *pOutput, 
-					      IHXTPropertyBag *pInput,
-					      IHXTPropertyBag *pPreferredFormat,
-					      IHXTPropertyBag **ppResult,
-					      IHXTPropertyBag **ppErrors )
+                                              IHXTPropertyBag *pInput,
+                                              IHXTPropertyBag *pPreferredFormat,
+                                              IHXTPropertyBag **ppResult,
+                                              IHXTPropertyBag **ppErrors )
 {
-    HX_RESULT res = HXR_OK;	
+    HX_RESULT res = HXR_OK;     
     
     IHXTPropertyBagPtr spResultBag;
     IHXTPropertyBagPtr spErrorBag;
@@ -132,142 +132,145 @@
     // If negotiation was successful, detect complex ties and break them
     if (SUCCEEDED(res))
     {
-	// Create error bag, if necessary
-	if (!spErrorBag)
-	    spErrorBag = NewPropertyBag();
-	
-	// Sanity check that there is a result bag
-	HX_RESULT resDetect = HXR_OK;		
-	if (!spResultBag)
-	{
-	    HX_ASSERT(FALSE);
-	    resDetect = HXR_FAIL;
-	}
-	
-	// Get the negotiated media format
-	const char* szMediaFormat = NULL;
-	if (SUCCEEDED(resDetect))
-	    resDetect = spResultBag->GetString(kPropMediaFormat, &szMediaFormat);
-	
-	// XXXLY - Add back in when codecs/asm mux support kValueMediaFormatPacketized
-	//HX_ASSERT(SUCCEEDED(resDetect));
-	
-	// Break ties differently depending on the media format
-	if (SUCCEEDED(resDetect))
-	{
-	    // Handle uncomp audio
-	    if (strcmp(szMediaFormat, kValueMediaFormatUncompAudio) == 0)
-	    {
-		res = tiebreakUncompAudioConnection(spResultBag, spErrorBag);
-	    }
-	    
-	    // Handle uncomp video
-	    else if (strcmp(szMediaFormat, kValueMediaFormatUncompVideo) == 0)
-	    {
-		res = tiebreakUncompVideoConnection(spResultBag, spErrorBag);
-	    }
-	    
-	    else
-	    {
-		//HX_ASSERT(strcmp(szMediaFormat, kValueMediaFormatAsmPacketized) == 0);
-	    }
-	}
+        // Create error bag, if necessary
+        if (!spErrorBag)
+            spErrorBag = NewPropertyBag();
+        
+        // Sanity check that there is a result bag
+        HX_RESULT resDetect = HXR_OK;           
+        if (!spResultBag)
+        {
+            HX_ASSERT(FALSE);
+            resDetect = HXR_FAIL;
+        }
+        
+        // Get the negotiated media format
+        const char* szMediaFormat = NULL;
+        if (SUCCEEDED(resDetect))
+            resDetect = spResultBag->GetString(kPropMediaFormat, &szMediaFormat);
+        
+        // XXXLY - Add back in when codecs/asm mux support \
kValueMediaFormatPacketized +        //HX_ASSERT(SUCCEEDED(resDetect));
+        
+        // Break ties differently depending on the media format
+        if (SUCCEEDED(resDetect))
+        {
+            // Handle uncomp audio
+            if (strcmp(szMediaFormat, kValueMediaFormatUncompAudio) == 0)
+            {
+                res = tiebreakUncompAudioConnection(spResultBag, spErrorBag);
+            }
+            
+            // Handle uncomp video
+            else if (strcmp(szMediaFormat, kValueMediaFormatUncompVideo) == 0)
+            {
+                res = tiebreakUncompVideoConnection(spResultBag, spErrorBag);
+            }
+            
+            else
+            {
+                //HX_ASSERT(strcmp(szMediaFormat, kValueMediaFormatAsmPacketized) == \
0); +            }
+        }
     }
     
     // Copy result/error bags
     if (ppResult && spResultBag)
     {
-	*ppResult = spResultBag;
-	(*ppResult)->AddRef();
+        *ppResult = spResultBag;
+        (*ppResult)->AddRef();
     }
     
     if (ppErrors && spErrorBag && FAILED(res))
     {
-	*ppErrors = spErrorBag;
-	(*ppErrors)->AddRef();
+        *ppErrors = spErrorBag;
+        (*ppErrors)->AddRef();
     }
     
-    return res;	
+    return res; 
 }
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::tiebreakUncompAudioConnection
+//      CHXTPipelineConnector::tiebreakUncompAudioConnection
 // Purpose:
-//	Break ties by replacing complex properties (lists/ranges) with simple
-//	properties using pre-determined rules.
+//      Break ties by replacing complex properties (lists/ranges) with simple
+//      properties using pre-determined rules.
 // Notes:
-//	If an unknown property is encountered, that property will be 
-//	ignored and remain in the result bag, and tiebreaking will proceed
-//	However, a known property with an unknown type is an error conditon
+//      If an unknown property is encountered, that property will be 
+//      ignored and remain in the result bag, and tiebreaking will proceed
+//      However, a known property with an unknown type is an error conditon
 HX_RESULT CHXTPipelineConnector::tiebreakUncompAudioConnection(IHXTPropertyBag* \
pResultBag, IHXTPropertyBag* pErrorBag)  {
     HX_RESULT res = HXR_OK;
     
     // Use preferred audio properties as first tiebreaker
     if (m_spPreferredAudioProps)
-	res = mergeCommonProperties(pResultBag, m_spPreferredAudioProps);
+        res = mergeCommonProperties(pResultBag, m_spPreferredAudioProps);
     
     // Get the property enumerator
     IHXTPropertyEnumeratorPtr spEnum;
     if (SUCCEEDED(res))
-	res = pResultBag->GetPropertyEnumerator(spEnum.Adopt());
+        res = pResultBag->GetPropertyEnumerator(spEnum.Adopt());
     
     IHXTPropertyPtr spProp;
     HX_RESULT resEnum = HXR_OK;
     
-    if (SUCCEEDED(res))			
-	resEnum = spEnum->First(spProp.Adopt());
+    if (SUCCEEDED(res))                 
+        resEnum = spEnum->First(spProp.Adopt());
     
     // Check each property of the result bag for complex results and break any ties
     while (SUCCEEDED(resEnum) && resEnum != HXR_ELEMENT_NOT_FOUND && SUCCEEDED(res))
     {
-	const char* szPropName = spProp->GetKey();
-	
-	// Handle bits per sample, num channels, sample rate -- select max
-	// Note: kPropAudioSampleFormat is split up into bitfields -- the most significant \
                bitfield
-	// happens to be bits per sample, so taking the max value just happens to work \
                properly (greater number
-	// of bits per sample is preferred over lesser number of bits per sample)
-	if (strcmp(szPropName, kPropAudioSampleFormat) == 0 
-	    || strcmp(szPropName, kPropAudioChannelFormat) == 0
-	    || strcmp(szPropName, kPropAudioSampleRate) == 0
-	    || strcmp(szPropName, kPropPreviewFormat) == 0)
-	{
-	    // Determine the max value
-	    UINT32 ulMaxValue = 0;
-	    if (strcmp(szPropName, kPropAudioChannelFormat) == 0)
-		res = CHXTPropUtils::SelectMaxNumChannelsFromProperty(spProp, ulMaxValue);
-	    else
-		res = CHXTPropUtils::SelectMaxUintFromProperty(spProp, pResultBag, ulMaxValue);
-	    
-	    if (SUCCEEDED(res))
-	    {
-		res = pResultBag->SetUint(szPropName, ulMaxValue);
-	    }
-	    else
-	    {
-		
-		HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompAudioConnection doesn't know how to tiebreak \
                prop: %s", szPropName);
-		HX_ASSERT(FALSE);
-		
-		pResultBag->Remove(szPropName);
-		pErrorBag->SetProperty(spProp);
-		res = HXR_FAIL;				
-	    }			
-	}
-	
-	else
-	{
-	    // Ignore unknown properties (but log a warning)
-	    if (strcmp(szPropName, kPropMediaFormat) != 0)
-	    {
-		HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompAudioConnection encounted unexpected prop: %s", \
                szPropName);
-		HX_ASSERT(FALSE);
-	    }
-	}
-	
-	if (SUCCEEDED(res))
-	    resEnum = spEnum->Next(spProp.Adopt());
+        const char* szPropName = spProp->GetKey();
+        
+        // Handle bits per sample, num channels, sample rate -- select max
+        // Note: kPropAudioSampleFormat is split up into bitfields -- the most \
significant bitfield +        // happens to be bits per sample, so taking the max \
value just happens to work properly (greater number +        // of bits per sample is \
preferred over lesser number of bits per sample) +        if (strcmp(szPropName, \
kPropAudioSampleFormat) == 0  +            || strcmp(szPropName, \
kPropAudioChannelFormat) == 0 +            || strcmp(szPropName, \
kPropAudioSampleRate) == 0 +            || strcmp(szPropName, kPropPreviewFormat) == \
0) +        {
+            // Determine the max value
+            UINT32 ulMaxValue = 0;
+            if (strcmp(szPropName, kPropAudioChannelFormat) == 0)
+                res = CHXTPropUtils::SelectMaxNumChannelsFromProperty(spProp, \
ulMaxValue); +            else
+                res = CHXTPropUtils::SelectMaxUintFromProperty(spProp, pResultBag, \
ulMaxValue); +            
+            if (SUCCEEDED(res))
+            {
+                res = pResultBag->SetUint(szPropName, ulMaxValue);
+            }
+            else
+            {
+                
+                HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompAudioConnection doesn't know how to tiebreak \
prop: %s", szPropName); +                HX_ASSERT(FALSE);
+                
+                pResultBag->Remove(szPropName);
+                pErrorBag->SetProperty(spProp);
+                res = HXR_FAIL;                         
+            }                   
+        }
+        
+        else
+        {
+            // Ignore unknown properties (but log a warning)
+            if( strcmp(szPropName, kPropMediaFormat) != 0)
+            {
+                HXTLOG(LC_DEV_WARN,
+                       FA_SDK_ENCODE,
+                       "CHXTPipelineConnector::tiebreakUncompAudioConnection \
encounted unexpected prop: %s", +                       szPropName);
+                HX_ASSERT(FALSE);
+            }
+        }
+        
+        if (SUCCEEDED(res))
+            resEnum = spEnum->Next(spProp.Adopt());
     }
     
     return res;
@@ -276,195 +279,195 @@
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::tiebreakUncompVideoConnection
+//      CHXTPipelineConnector::tiebreakUncompVideoConnection
 // Purpose:
-//	Break ties by replacing complex properties (lists/ranges) with simple
-//	properties using pre-determined rules.
+//      Break ties by replacing complex properties (lists/ranges) with simple
+//      properties using pre-determined rules.
 // Notes:
-//	If an unknown property is encountered, that property will be 
-//	ignored and remain in the result bag, and tiebreaking will proceed.
-//	However, a known property with an unknown type is an error conditon.
+//      If an unknown property is encountered, that property will be 
+//      ignored and remain in the result bag, and tiebreaking will proceed.
+//      However, a known property with an unknown type is an error conditon.
 HX_RESULT CHXTPipelineConnector::tiebreakUncompVideoConnection(IHXTPropertyBag* \
pResultBag, IHXTPropertyBag* pErrorBag)  {
-    HX_RESULT res = HXR_OK;	
+    HX_RESULT res = HXR_OK;     
     
     // Use preferred audio properties as first tiebreaker
     if (m_spPreferredVideoProps)
-	res = mergeCommonProperties(pResultBag, m_spPreferredVideoProps);
+        res = mergeCommonProperties(pResultBag, m_spPreferredVideoProps);
     
     // Get the property enumerator
     IHXTPropertyEnumeratorPtr spEnum;
     if (SUCCEEDED(res))
-	res = pResultBag->GetPropertyEnumerator(spEnum.Adopt());
+        res = pResultBag->GetPropertyEnumerator(spEnum.Adopt());
     
     IHXTPropertyPtr spProp;
     HX_RESULT resEnum = HXR_OK;
     
-    if (SUCCEEDED(res))			
-	resEnum = spEnum->First(spProp.Adopt());
+    if (SUCCEEDED(res))                 
+        resEnum = spEnum->First(spProp.Adopt());
     
     // Check each property of the result bag for complex results and break any ties
     while (SUCCEEDED(resEnum) && resEnum != HXR_ELEMENT_NOT_FOUND && SUCCEEDED(res))
     {
-	const char* szPropName = spProp->GetKey();
-	
-	// Handle frame width, frame height -- select max value
-	if (strcmp(szPropName, kPropVideoFrameWidth) == 0 || strcmp(szPropName, \
                kPropVideoFrameHeight) == 0)
-	{
-	    // Determine the max value
-	    UINT32 ulMaxValue = 0;
-	    res = CHXTPropUtils::SelectMaxUintFromProperty(spProp, pResultBag, ulMaxValue);
-	    
-	    if (SUCCEEDED(res))
-	    {
-		res = pResultBag->SetUint(szPropName, ulMaxValue);
-	    }
-	    else
-	    {
-		
-		HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
                prop: %s", szPropName);
-		HX_ASSERT(FALSE);
-		
-		pResultBag->Remove(szPropName);
-		pErrorBag->SetProperty(spProp);
-		res = HXR_FAIL;				
-	    }			
-	}
-	
-	// Handle frame rate -- select max value
-	else if (strcmp(szPropName, kPropVideoFrameRate) == 0)
-	{
-	    // Determine the max value
-	    double dMaxValue = 0;
-	    res = CHXTPropUtils::SelectMaxDoubleFromProperty(spProp, pResultBag, \
                dMaxValue);
-	    
-	    if (SUCCEEDED(res))
-	    {
-		res = pResultBag->SetDouble(szPropName, dMaxValue);
-	    }
-	    else
-	    {
-		
-		HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
                prop: %s", szPropName);
-		HX_ASSERT(FALSE);
-		
-		pResultBag->Remove(szPropName);
-		pErrorBag->SetProperty(spProp);
-		res = HXR_FAIL;				
-	    }			
-	}
-	
-	// Handle color format
-	else if (strcmp(szPropName, kPropVideoColorFormat) == 0)
-	{
-	    if (spProp->GetType() != eTypeUINT32)
-	    {
-		// Handle list of uint32 -- select max value
-		if (spProp->GetType() == eTypeUintList)
-		{
-		    // Get the list
-		    IHXTUintListPtr spList;
-		    res = pResultBag->GetUintList(szPropName, spList.Adopt());
-		    
-		    // Select color format from pre-determined list
-		    if (SUCCEEDED(res))
-		    {
-			UINT32 i=0;
-			for (i=0; i<kulNumPrefColorFormats; i++)
-			{
-			    if (spList->Contains(kaePrefColorFormats[i]))
-			    {
-				res = pResultBag->SetUint(szPropName, kaePrefColorFormats[i]);
-				break;
-			    }
-			}
-			
-			// Unexpected color format -- treat as error condition
-			if (i == kulNumPrefColorFormats)
-			{
-			    HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection could not tiebreak color \
                format");
-			    HX_ASSERT(FALSE);
-			    
-			    pResultBag->Remove(szPropName);
-			    pErrorBag->SetProperty(spProp);
-			    res = HXR_FAIL;
-			}
-		    }
-		}
-		
-		// Handle range of uint32 -- select max value
-		else if (spProp->GetType() == eTypeUintRange)
-		{
-		    IHXTUintRangePtr spRange;
-		    res = pResultBag->GetUintRange(szPropName, spRange.Adopt());
-		    
-		    // Select color format from pre-determined list
-		    if (SUCCEEDED(res))
-		    {
-			UINT32 i=0;
-			for (i=0; i<kulNumPrefColorFormats; i++)
-			{
-			    if (spRange->IsInRange(kaePrefColorFormats[i]))
-			    {
-				res = pResultBag->SetUint(szPropName, kaePrefColorFormats[i]);
-				break;
-			    }
-			}
-			
-			// Unexpected color format -- treat as error condition
-			if (i == kulNumPrefColorFormats)
-			{
-			    HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection could not tiebreak color \
                format");
-			    HX_ASSERT(FALSE);
-			    
-			    pResultBag->Remove(szPropName);
-			    pErrorBag->SetProperty(spProp);
-			    res = HXR_FAIL;
-			}
-		    }
-		}
-		
-		// Otherwise, the property type is unknown -- treat as an error condition
-		else
-		{
-		    HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
                prop: %s", szPropName);
-		    HX_ASSERT(FALSE);
-		    
-		    pResultBag->Remove(szPropName);
-		    pErrorBag->SetProperty(spProp);
-		    res = HXR_FAIL;
-		}
-	    }
-	}
-	
-	// Ignore unknown properties (but log a warning)
-	else
-	{
-	    if (strcmp(szPropName, kPropMediaFormat) != 0)
-	    {
-		HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection encounted unexpected prop: %s", \
                szPropName);
-		HX_ASSERT(FALSE);
-	    }
-	}
-	
-	if (SUCCEEDED(res))
-	    resEnum = spEnum->Next(spProp.Adopt());
-	}
-	
-	return res;
+        const char* szPropName = spProp->GetKey();
+        
+        // Handle frame width, frame height -- select max value
+        if (strcmp(szPropName, kPropVideoFrameWidth) == 0 || strcmp(szPropName, \
kPropVideoFrameHeight) == 0) +        {
+            // Determine the max value
+            UINT32 ulMaxValue = 0;
+            res = CHXTPropUtils::SelectMaxUintFromProperty(spProp, pResultBag, \
ulMaxValue); +            
+            if (SUCCEEDED(res))
+            {
+                res = pResultBag->SetUint(szPropName, ulMaxValue);
+            }
+            else
+            {
+                
+                HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
prop: %s", szPropName); +                HX_ASSERT(FALSE);
+                
+                pResultBag->Remove(szPropName);
+                pErrorBag->SetProperty(spProp);
+                res = HXR_FAIL;                         
+            }                   
+        }
+        
+        // Handle frame rate -- select max value
+        else if (strcmp(szPropName, kPropVideoFrameRate) == 0)
+        {
+            // Determine the max value
+            double dMaxValue = 0;
+            res = CHXTPropUtils::SelectMaxDoubleFromProperty(spProp, pResultBag, \
dMaxValue); +            
+            if (SUCCEEDED(res))
+            {
+                res = pResultBag->SetDouble(szPropName, dMaxValue);
+            }
+            else
+            {
+                
+                HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
prop: %s", szPropName); +                HX_ASSERT(FALSE);
+                
+                pResultBag->Remove(szPropName);
+                pErrorBag->SetProperty(spProp);
+                res = HXR_FAIL;                         
+            }                   
+        }
+        
+        // Handle color format
+        else if (strcmp(szPropName, kPropVideoColorFormat) == 0)
+        {
+            if (spProp->GetType() != eTypeUINT32)
+            {
+                // Handle list of uint32 -- select max value
+                if (spProp->GetType() == eTypeUintList)
+                {
+                    // Get the list
+                    IHXTUintListPtr spList;
+                    res = pResultBag->GetUintList(szPropName, spList.Adopt());
+                    
+                    // Select color format from pre-determined list
+                    if (SUCCEEDED(res))
+                    {
+                        UINT32 i=0;
+                        for (i=0; i<kulNumPrefColorFormats; i++)
+                        {
+                            if (spList->Contains(kaePrefColorFormats[i]))
+                            {
+                                res = pResultBag->SetUint(szPropName, \
kaePrefColorFormats[i]); +                                break;
+                            }
+                        }
+                        
+                        // Unexpected color format -- treat as error condition
+                        if (i == kulNumPrefColorFormats)
+                        {
+                            HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection could not tiebreak color \
format"); +                            HX_ASSERT(FALSE);
+                            
+                            pResultBag->Remove(szPropName);
+                            pErrorBag->SetProperty(spProp);
+                            res = HXR_FAIL;
+                        }
+                    }
+                }
+                
+                // Handle range of uint32 -- select max value
+                else if (spProp->GetType() == eTypeUintRange)
+                {
+                    IHXTUintRangePtr spRange;
+                    res = pResultBag->GetUintRange(szPropName, spRange.Adopt());
+                    
+                    // Select color format from pre-determined list
+                    if (SUCCEEDED(res))
+                    {
+                        UINT32 i=0;
+                        for (i=0; i<kulNumPrefColorFormats; i++)
+                        {
+                            if (spRange->IsInRange(kaePrefColorFormats[i]))
+                            {
+                                res = pResultBag->SetUint(szPropName, \
kaePrefColorFormats[i]); +                                break;
+                            }
+                        }
+                        
+                        // Unexpected color format -- treat as error condition
+                        if (i == kulNumPrefColorFormats)
+                        {
+                            HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection could not tiebreak color \
format"); +                            HX_ASSERT(FALSE);
+                            
+                            pResultBag->Remove(szPropName);
+                            pErrorBag->SetProperty(spProp);
+                            res = HXR_FAIL;
+                        }
+                    }
+                }
+                
+                // Otherwise, the property type is unknown -- treat as an error \
condition +                else
+                {
+                    HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection doesn't know how to tiebreak \
prop: %s", szPropName); +                    HX_ASSERT(FALSE);
+                    
+                    pResultBag->Remove(szPropName);
+                    pErrorBag->SetProperty(spProp);
+                    res = HXR_FAIL;
+                }
+            }
+        }
+        
+        // Ignore unknown properties (but log a warning)
+        else
+        {
+            if (strcmp(szPropName, kPropMediaFormat) != 0)
+            {
+                HXTLOG(LC_DEV_WARN, FA_SDK_ENCODE, \
"CHXTPipelineConnector::tiebreakUncompVideoConnection encounted unexpected prop: %s", \
szPropName); +                HX_ASSERT(FALSE);
+            }
+        }
+        
+        if (SUCCEEDED(res))
+            resEnum = spEnum->Next(spProp.Adopt());
+        }
+        
+        return res;
 }
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::Connect
+//      CHXTPipelineConnector::Connect
 // Purpose:
-//	Break ties -- XXXLY - update later
+//      Break ties -- XXXLY - update later
 STDMETHODIMP CHXTPipelineConnector::Connect( IHXTConnectionAgent *pUpstreamAgent, \
                IHXTConnectionAgent *pDownstreamAgent,
-					    IHXTOutputConnection *pOutputConnection, IHXTInputConnection \
                *pInputConnection,
-					    UINT32 *puOutputStreamId, UINT32 *puInputStreamId,
-					    IHXTPropertyBag *pPreferred, IHXTPropertyBag **ppResult,
-					    IHXTPropertyBag **ppErrors, UINT32 *puConnectedOutputStreamId,
-					    UINT32 *puConnectedInputStreamId )
+                                            IHXTOutputConnection *pOutputConnection, \
IHXTInputConnection *pInputConnection, +                                            \
UINT32 *puOutputStreamId, UINT32 *puInputStreamId, +                                  \
IHXTPropertyBag *pPreferred, IHXTPropertyBag **ppResult, +                            \
IHXTPropertyBag **ppErrors, UINT32 *puConnectedOutputStreamId, +                      \
UINT32 *puConnectedInputStreamId )  {
     HX_RESULT res = HXR_OK;
     
@@ -476,52 +479,52 @@
     
     // Let the CHXTPropertyBasedStrategy do the actual connection
     res = CHXTPropertyBasedStrategy::Connect(pUpstreamAgent, pDownstreamAgent, \
                pOutputConnection, pInputConnection, puOutputStreamId, \
                puInputStreamId,
-	pPreferred, ppResult, spErrorBag.Adopt(), puConnectedOutputStreamId, \
puConnectedInputStreamId); +        pPreferred, ppResult, spErrorBag.Adopt(), \
puConnectedOutputStreamId, puConnectedInputStreamId);  
     // Log success
     if (SUCCEEDED(res))
     {
-	HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Connected filters: %s to %s", (const \
char*)m_strUpstreamFilter, (const char*)m_strDownstreamFilter); +        \
HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Connected filters: %s to %s", (const \
char*)m_strUpstreamFilter, (const char*)m_strDownstreamFilter);  }
     else
     {
-	if (spErrorBag && spErrorBag->GetCount() > 0)
-	{
-	    CHXString strError;
-	    
-	    // Get the property enumerator
-	    IHXTPropertyEnumeratorPtr spEnum;
-	    HX_RESULT resLogError = spErrorBag->GetPropertyEnumerator(spEnum.Adopt());
-	    
-	    IHXTPropertyPtr spProp;
-	    HX_RESULT resEnum = HXR_OK;
-	    
-	    if (SUCCEEDED(resLogError))			
-		resEnum = spEnum->First(spProp.Adopt());
-	    
-	    // Check each property of the result bag for complex results and break any ties
-	    while (SUCCEEDED(resEnum) && resEnum != HXR_ELEMENT_NOT_FOUND && \
                SUCCEEDED(resLogError))
-	    {
-		strError += spProp->GetKey();
-		strError += " ";
-		
-		resEnum = spEnum->Next(spProp.Adopt());
-	    }
-	    
-	    HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Failed to connect filters: %s to %s, due to \
props: %s", (const char*)m_strUpstreamFilter, (const char*)m_strDownstreamFilter, \
                (const char*)strError);			
-	}
-	
-	else
-	{
-	    HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Failed to connect filters: %s to %s", \
                (const char*)m_strUpstreamFilter, (const \
                char*)m_strDownstreamFilter);
-	}
+        if (spErrorBag && spErrorBag->GetCount() > 0)
+        {
+            CHXString strError;
+            
+            // Get the property enumerator
+            IHXTPropertyEnumeratorPtr spEnum;
+            HX_RESULT resLogError = \
spErrorBag->GetPropertyEnumerator(spEnum.Adopt()); +            
+            IHXTPropertyPtr spProp;
+            HX_RESULT resEnum = HXR_OK;
+            
+            if (SUCCEEDED(resLogError))                 
+                resEnum = spEnum->First(spProp.Adopt());
+            
+            // Check each property of the result bag for complex results and break \
any ties +            while (SUCCEEDED(resEnum) && resEnum != HXR_ELEMENT_NOT_FOUND \
&& SUCCEEDED(resLogError)) +            {
+                strError += spProp->GetKey();
+                strError += " ";
+                
+                resEnum = spEnum->Next(spProp.Adopt());
+            }
+            
+            HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Failed to connect filters: %s to %s, \
due to props: %s", (const char*)m_strUpstreamFilter, (const \
char*)m_strDownstreamFilter, (const char*)strError);                    +        }
+        
+        else
+        {
+            HXTLOG(LC_DEV_DIAG, FA_SDK_ENCODE, "Failed to connect filters: %s to \
%s", (const char*)m_strUpstreamFilter, (const char*)m_strDownstreamFilter); +        \
}  }
     
     // Copy error bag
     if (ppErrors && spErrorBag)
     {
-	*ppErrors = spErrorBag;
-	(*ppErrors)->AddRef();
+        *ppErrors = spErrorBag;
+        (*ppErrors)->AddRef();
     }
     
     return res;
@@ -529,9 +532,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::getFilterName
+//      CHXTPipelineConnector::getFilterName
 // Purpose:
-//	Break ties -- XXXLY - update later
+//      Break ties -- XXXLY - update later
 void CHXTPipelineConnector::getFilterName(IHXTConnectionAgent* pFilter, CHXString& \
strFilterName)  {
     HX_RESULT res = HXR_OK;
@@ -543,19 +546,19 @@
     // Get the filter name
     const char* szFilterName = NULL;
     if (SUCCEEDED(res))
-	res = spConfig->GetString( kPropPluginName, &szFilterName);
+        res = spConfig->GetString( kPropPluginName, &szFilterName);
     
     if (SUCCEEDED(res))
-	strFilterName = szFilterName;
+        strFilterName = szFilterName;
     else
-	strFilterName = "(unknown)";
+        strFilterName = "(unknown)";
 }
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::SetPreferredAudioProps
+//      CHXTPipelineConnector::SetPreferredAudioProps
 // Purpose:
-//	Used to specify the preferred audio properties
+//      Used to specify the preferred audio properties
 STDMETHODIMP CHXTPipelineConnector::SetPreferredAudioProps(IHXTPropertyBag* \
pPreferredProps)  {
     HX_RESULT res = HXR_OK;
@@ -563,8 +566,8 @@
     // Validate params
     if (!pPreferredProps)
     {
-	HX_ASSERT(FALSE);
-	return HXR_POINTER;
+        HX_ASSERT(FALSE);
+        return HXR_POINTER;
     }
     
     m_spPreferredAudioProps = pPreferredProps;
@@ -574,9 +577,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTPipelineConnector::SetPreferredVideoProps
+//      CHXTPipelineConnector::SetPreferredVideoProps
 // Purpose:
-//	Used to specify the preferred video properties
+//      Used to specify the preferred video properties
 STDMETHODIMP CHXTPipelineConnector::SetPreferredVideoProps(IHXTPropertyBag* \
pPreferredProps)  {
     HX_RESULT res = HXR_OK;
@@ -584,8 +587,8 @@
     // Validate params
     if (!pPreferredProps)
     {
-	HX_ASSERT(FALSE);
-	return HXR_POINTER;
+        HX_ASSERT(FALSE);
+        return HXR_POINTER;
     }
     
     m_spPreferredVideoProps = pPreferredProps;

Index: basepipeline.h
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encpipeline/basepipeline.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- basepipeline.h	12 Mar 2009 23:33:30 -0000	1.4
+++ basepipeline.h	27 Apr 2009 19:57:55 -0000	1.5
@@ -97,8 +97,8 @@
     
     STDMETHOD(removeFilter)(IHXTConnectionAgent *pConnectAgent);
 
-    BOOL m_bInitDone;
-    CHXString m_strResamplerQuality;
+    BOOL               m_bInitDone;
+    CHXString          m_strResamplerQuality;
     IHXTPropertyBagPtr m_spEncodingPropertyBag;
     
 protected:

Index: basepipeline.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encpipeline/basepipeline.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- basepipeline.cpp	12 Mar 2009 23:33:30 -0000	1.4
+++ basepipeline.cpp	27 Apr 2009 19:57:55 -0000	1.5
@@ -71,18 +71,19 @@
 
 #include "hxheap.h"
 #ifdef _DEBUG
+#include "hxtproputils.h"
 #undef HX_THIS_FILE
 static char HX_THIS_FILE[] = __FILE__;
 #endif
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CHXTBaseMgr::CHXTBaseMgr
[...1504 lines suppressed...]
+            HX_ASSERT( SUCCEEDED(res) || "Failed to connect audio level filter!" == \
NULL ); +        }
 
-	// Connect the current upstream helper/splitter filter to the original downstream \
                filter
-	if (SUCCEEDED(res))
-	    res = connectFilters(spCurUpstreamFilter, pDownStreamConnectAgent, \
pEventualDownstreamConnectAgent, kValueMediaFormatUncompAudio, spErrorBag.Adopt(), \
pnStreamToSplitter); +        // Connect the current upstream helper/splitter filter \
to the original downstream filter +        if (SUCCEEDED(res))
+            res = connectFilters(spCurUpstreamFilter, pDownStreamConnectAgent, \
pEventualDownstreamConnectAgent, kValueMediaFormatUncompAudio, spErrorBag.Adopt(), \
pnStreamToSplitter);  }
     
     if(FAILED(res))
     {
-	HXTLOG(LC_DEV_ERROR, FA_SDK_ENCODE, "CHXTBaseMgr::autoConnectAudioFilters unable to \
                connect filters");
-	HX_ASSERT(FALSE);
+        HXTLOG(LC_DEV_ERROR, FA_SDK_ENCODE, "CHXTBaseMgr::autoConnectAudioFilters \
unable to connect filters"); +        HX_ASSERT(FALSE);
     }
     
     return res;

Index: outputpipeline.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encpipeline/outputpipeline.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- outputpipeline.cpp	9 Apr 2009 13:21:53 -0000	1.9
+++ outputpipeline.cpp	27 Apr 2009 19:57:55 -0000	1.10
@@ -116,56 +116,56 @@
     resProperty = m_spStreamHeader->GetFirstPropertyULONG32(pPropertyName, \
uPropertyValue);  if (SUCCEEDED(resProperty))
     {
-	do{
+        do{
 
-	    res = pIStreamHeaderCopy->SetPropertyULONG32(pPropertyName, uPropertyValue);
-	    if(SUCCEEDED(res))
-		resProperty = m_spStreamHeader->GetNextPropertyULONG32(pPropertyName, \
uPropertyValue); +            res = \
pIStreamHeaderCopy->SetPropertyULONG32(pPropertyName, uPropertyValue); +            \
if(SUCCEEDED(res)) [...5263 lines suppressed...]
     if (SUCCEEDED(res) && m_spAsmMuxForPacketizedStream)
-	res = removeFilter(m_spAsmMuxForPacketizedStream);
+        res = removeFilter(m_spAsmMuxForPacketizedStream);
 
     if (SUCCEEDED(res))
-	m_spAsmMuxForPacketizedStream = NULL;
+        m_spAsmMuxForPacketizedStream = NULL;
 
     if (SUCCEEDED(res) && m_spAsmSplitterForPacketizedStream)
-	res = removeFilter(m_spAsmSplitterForPacketizedStream);
+        res = removeFilter(m_spAsmSplitterForPacketizedStream);
 
     if (SUCCEEDED(res))
-	m_spAsmSplitterForPacketizedStream = NULL;
+        m_spAsmSplitterForPacketizedStream = NULL;
 
     return res;
-}
\ No newline at end of file
+}

Index: pipelinemgr.cpp
===================================================================
RCS file: /cvsroot/client/encodesvc/engine/encpipeline/pipelinemgr.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pipelinemgr.cpp	10 Sep 2008 18:46:34 -0000	1.3
+++ pipelinemgr.cpp	27 Apr 2009 19:57:55 -0000	1.4
@@ -79,41 +79,41 @@
 
 /////////////////////////////////////////////////////////////////////////
 // Method:
-//	CreateEncodingPipelineManager
+//      CreateEncodingPipelineManager
 // Purpose:
-//	Creates an encoding pipeline manager
+//      Creates an encoding pipeline manager
 HX_RESULT CreateEncodingPipelineManager(IHXTEncodingPipelineManager** ppPipelineMgr)
 {
     HX_RESULT res = HXR_OK;
[...1484 lines suppressed...]
+            }
+        }
     }
     
-    // If everything went ok, return the output mgr	
-    if (SUCCEEDED(res))	
+    // If everything went ok, return the output mgr     
+    if (SUCCEEDED(res)) 
     {
-	m_vOutputPipeline.push_back(spOutputPipeline);
+        m_vOutputPipeline.push_back(spOutputPipeline);
     }
     
     if (SUCCEEDED(res))
     {
-	res = spOutputPipeline->QueryInterface(IID_IHXTOutputPipeline, (void**)ppPipeline);
+        res = spOutputPipeline->QueryInterface(IID_IHXTOutputPipeline, \
(void**)ppPipeline);  }
     
     HX_ASSERT(SUCCEEDED(res));


_______________________________________________
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