Re: CR:Bug 244016: Clicking "..." on a device control after encoding can cause a
Steve McMillen <[email protected]>
| Newsgroups | gmane.comp.multimedia.helix.devel |
|---|---|
| Organization | RealNetworks |
| Message-ID | <[email protected]> |
Let's discuss in the stand-up. Input files themselves do not indicate if they are audio or video so there were need to be that information exposed to the application per input. Also, prefilters themselves are not inherently assigned a media type. Since the SDK apparently already supports adding prefilters at the higher level and (I assume) applies them to the appropriate media types, why not support it. This makes it simpler for users and applications building job files since you don't need to think about what media types a given filter needs to be applied to. -- Steve on 6/23/09 7:31 AM Eric Hyche wrote the following: > 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; >>> } >>> >>> >>> >>> >