RE: CR:Bug 244016: Clicking "..." on a device control after encoding can cause a

"Eric Hyche" <[email protected]>
Newsgroups gmane.comp.multimedia.helix.devel
Organization RealNetworks, Inc.
Message-ID <00a201c9f40f$55a9d4d0$00fd7e70$@com>
But the prefilters are specific to audio or video, right? (audio gain prefilter
or video smoothing prefilter, etc.) In that case, I think it makes
more sense to put them inside the <input> element as it is spec'd now:

<parInputs>
   <input xsi:type="AVFileInput" Filename="foo.mp3" ...>
       <prefilters>
           <prefilter xsi:type="AudioGainPrefilter" ... />
       </prefilters>
   </input>
   <input xsi:type="AVFileInput" Filename="video_only.avi" ...>
       <prefilters>
           <prefilter xsi:type="VideoInputCroppingPrefilter" ... />
           <prefilter xsi:type="VideoResizePrefilter" ... />
       </prefilters>
   </input>
</parInputs>

rather than putting them on the <parInputs> elements and 
then having to make assumptions about which <input> they belong to,
like this:

<parInputs>
   <prefilters>
       <prefilter xsi:type="AudioGainPrefilter" ... />
       <prefilter xsi:type="VideoInputCroppingPrefilter" ... />
       <prefilter xsi:type="VideoResizePrefilter" ... />
   </prefilters>
   <input xsi:type="AVFileInput" Filename="foo.mp3" ... />
   <input xsi:type="AVFileInput" Filename="video_only.avi" ... />
</parInputs>

Eric

=======================================
Eric Hyche ([email protected])
Principal Engineer
RealNetworks, Inc.


>-----Original Message-----
>From: Steve McMillen [mailto:[email protected]]
>Sent: Tuesday, June 23, 2009 10:14 AM
>To: [email protected]
>Cc: [email protected]; [email protected]
>Subject: Re: CR:Bug 244016: Clicking "..." on a device control after encoding can cause a
>
>Let's discuss in the standup but some initial thoughts below...
>
>So the sdk support <prefilters> in both <input> and <ParInput> elements?
>
>We could easily add it to the XSD obviously.  Setting prefilters at the
><ParInputs> level sounds like the right place anyways when dealing with
>parallel inputs instead of putting something on each input.
>
>Nothing about the GUI or CLI assumes we need to add prefilters to either
>region and long term I'd suggest it makes more sense to set the
>prefilter at the <ParInputs> level - I just never realized that's the
>way the SDK was designed.
>
>-- Steve
>
>on 6/23/09 12:29 AM [email protected] wrote the following:
>> Synopsis
>> ========
>> Bug 244016: Clicking "..." on a device control after encoding can cause a
>> SDK error or unhandled exception.
>>
>> Branches: PRODUCER_13_0_RN and HEAD.
>> Suggested Reviewer: Anyone.
>>
>>
>> Description
>> ===========
>> Problem was that Active-x control was adding a audio gain prefilter to
>> <parInput>, while new xsd only supports adding prefilter to input and not
>> parInput.
>>
>> Changed Active-x control to add prefilter to first audio input in par
>> inputs and changed logic to check par inputs for pre-filter.
>> Need to check further, if adding of prefilters to par inputs should be
>> allowed.
>>
>>
>> Files Affected
>> ==============
>> client/encodesvc/activex/ctrl/ProducerCtrl.cpp
>>
>> Testing Performed
>> =================
>> Tested with capture and file encode jobs
>>
>> Performance Tests:
>> - None
>>
>> Platforms Tested: win32-i386-vc7
>> Build verified: win32-i386-vc7
>>
>> QA Hints
>> ========
>> Please test bug repro with prefilters.
>>
>> Index: ProducerCtrl.cpp
>> ===================================================================
>> RCS file: /cvsroot/client/encodesvc/activex/ctrl/ProducerCtrl.cpp,v
>> retrieving revision 1.3.2.1
>> diff -u -r1.3.2.1 ProducerCtrl.cpp
>> --- ProducerCtrl.cpp	5 Jun 2009 19:57:58 -0000	1.3.2.1
>> +++ ProducerCtrl.cpp	23 Jun 2009 06:12:41 -0000
>> @@ -6654,6 +6654,60 @@
>>   	}
>>       }
>>
>> +    if (!bFoundAudioGain)
>> +    {
>> +	HXBOOL bInputIsParallelGroup = FALSE;
>> +	if (SUCCEEDED(res)&&  spInput)
>> +	{
>> +	    const char* pkszPluginType = NULL;
>> +	    res = spInput->GetString(kPropPluginType,&pkszPluginType);
>> +	    if (SUCCEEDED(res)&&
>> +    		(strcmp(pkszPluginType, kValuePluginTypeInputParGroup) == 0))
>> +	    {
>> +		bInputIsParallelGroup = TRUE;
>> +	    }
>> +	}
>> +
>> +	IHXTInput2Ptr spInputGroup;
>> +	if ( SUCCEEDED(res)&&  bInputIsParallelGroup)
>> +	{
>> +	    spInput->QueryInterface( IID_IHXTInput2,
>> (void**)spInputGroup.Adopt() );
>> +	    if ( spInputGroup  )
>> +	    {
>> +		//Input Group present
>> +		UINT32 uiNumInputs = spInputGroup->GetInputCount();
>> +		IHXTInputPtr spSingleInputPtr;
>> +
>> +		for (UINT32 i=0; SUCCEEDED(res)&&  i<uiNumInputs; i++)
>> +		{
>> +		    res = spInputGroup->GetInput( i, spSingleInputPtr.Adopt() );
>> +		    if ( SUCCEEDED( res ) )
>> +		    {
>> +			UINT32 ulNumPrefilters = spSingleInputPtr->GetPrefilterCount();
>> +			const char* pkszPluginName = NULL;
>> +
>> +			for ( UINT32 i=0; i<ulNumPrefilters; ++i )
>> +			{
>> +			    res = spInput->GetPrefilter( i, spPrefilter.Adopt() );
>> +
>> +			    if ( SUCCEEDED( res ) )
>> +			    {
>> +				spPrefilter->GetString( kPropPluginName ,&pkszPluginName);
>> +
>> +				if ( strcmp( pkszPluginName, kValuePluginNamePrefilterAudioGain) == 0 )
>> +				{
>> +				    bFoundAudioGain = TRUE;
>> +				    break;
>> +				}
>> +			    }
>> +			}
>> +		    }
>> +		}
>> +	    }
>> +	}
>> +    }
>> +
>> +
>>       if ( SUCCEEDED( res )&&  bFoundAudioGain )
>>       {
>>   	HX_RELEASE(*ppPrefilter);
>> @@ -6681,6 +6735,8 @@
>>   CProducerCtrl::AddAudioGainPrefilter(double lfAudioGain)
>>   {
>>       VARIANT_BOOL bIsRunning = VARIANT_FALSE;
>> +    IHXTPrefilterPtr spPrefilter;
>> +
>>       get_IsRunning(&bIsRunning);
>>       if (bIsRunning)
>>       {
>> @@ -6719,16 +6775,54 @@
>>   	    // Create the prefilter
>>   	    if ( SUCCEEDED( res ) )
>>   	    {
>> -		IHXTPrefilterPtr spPrefilter;
>>   		res = HXBuildInstance(m_spFactory, IID_IHXTPrefilter, spBag,
>> (IUnknown**)spPrefilter.Adopt());
>>   		HX_ASSERT(res == HXR_OK);
>> -		if (SUCCEEDED(res))
>> +	    }
>> +	}
>> +    }
>> +
>> +    HXBOOL bInputIsParallelGroup = FALSE;
>> +    if (SUCCEEDED(res)&&  spInput)
>> +    {
>> +        const char* pkszPluginType = NULL;
>> +	res = spInput->GetString(kPropPluginType,&pkszPluginType);
>> +        if (SUCCEEDED(res)&&
>> +    	    (strcmp(pkszPluginType, kValuePluginTypeInputParGroup) == 0))
>> +	{
>> +	    bInputIsParallelGroup = TRUE;
>> +	}
>> +    }
>> +
>> +    IHXTInput2Ptr spInputGroup;
>> +    if ( SUCCEEDED(res)&&  bInputIsParallelGroup)
>> +    {
>> +	spInput->QueryInterface( IID_IHXTInput2, (void**)spInputGroup.Adopt() );
>> +	if ( spInputGroup  )
>> +	{
>> +	    //Input Group present
>> +	    UINT32 uiNumInputs = spInputGroup->GetInputCount();
>> +	    IHXTInputPtr spSingleInputPtr;
>> +
>> +	    for (UINT32 i=0; i<  uiNumInputs; i++)
>> +	    {
>> +		res = spInputGroup->GetInput( i, spSingleInputPtr.Adopt() );
>> +		if ( spSingleInputPtr )
>>   		{
>> -		    res = spInput->AddPrefilter( spPrefilter );
>> +		    HXBOOL bHasAudio = FALSE;
>> +		    spSingleInputPtr->GetBool(kPropHasAudio,&bHasAudio);
>> +		    if (bHasAudio)
>> +		    {
>> +			res = spSingleInputPtr->AddPrefilter( spPrefilter );
>> +			break;
>> +		    }
>>   		}
>>   	    }
>>   	}
>>       }
>> +    else if (SUCCEEDED(res))
>> +    {
>> +	res = spInput->AddPrefilter( spPrefilter );
>> +    }
>>
>>       return res;
>>   }
>>
>>
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.