Comments below....
>Index: hxaudses.cpp >=================================================================== >RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v >retrieving revision 1.28.4.9 >diff -u -w -r1.28.4.9 hxaudses.cpp >--- hxaudses.cpp 13 Oct 2004 00:03:55 -0000 1.28.4.9 >+++ hxaudses.cpp 3 May 2005 05:18:31 -0000 >@@ -258,6 +258,8 @@ > , m_bSessionBufferDirty(FALSE) > , m_bPostMixHooksUpdated(FALSE) > , m_pMPPSupport(NULL) >+ , m_bOpaqueMode(FALSE) >+ , m_pOpaqueData(NULL)
Make sure you put any new variables in the correct order (as they are listed in the .h file) when adding them to the init list. If you init them out of order it generates a warning on most compilers. We are currently trying get rid of all warnings on HEAD and 150Cay. Other branches may still be out of order.
Also, as Eric mentioned, HXBOOL is now used on HEAD and 150Cay instead of BOOL.
> { > m_pFakeAudioCBTime = new Timeval; > m_pInDataPtr = new HXAudioData; >@@ -1714,7 +1716,7 @@ > } > } > >- if (m_pHookList) >+ if (m_pHookList && !m_bOpaqueMode) > { > ProcessHooks(&audioData); > } >@@ -1985,6 +1987,16 @@ > { > ((CHXAudioDevice*)m_pAudioDev)->SetGranularity( m_ulGranularity, m_ulBytesPerGran); > } >+ if (m_bOpaqueMode) >+ { >+ IHXOpaqueAudioDevice* pOpaqueDevice = NULL; >+ m_pAudioDev->QueryInterface (IID_IHXOpaqueAudioDevice, (void **)&pOpaqueDevice); >+ if (!pOpaqueDevice) >+ return HXR_FAIL; >+ theErr = pOpaqueDevice->Open(&m_ActualDeviceFmt, this, m_strOpaqueType, m_pOpaqueData ); >+ HX_RELEASE(pOpaqueDevice); >+ } >+ else > theErr = m_pAudioDev->Open( &m_ActualDeviceFmt, this ); > bDeviceOpened = TRUE; > m_ulBlocksWritten = 0; >@@ -2546,6 +2558,8 @@ > m_bDeferActualResume = FALSE; > m_pLastPausedPlayer = NULL; > >+ m_bOpaqueMode = FALSE; >+ HX_RELEASE(m_pOpaqueData);
You also need to release m_pOpaqueData in the ::Close() method.
>
> HX_RELEASE(m_pMPPSupport);
>
>@@ -4676,5 +4690,18 @@
>
> STDMETHODIMP_(BOOL) CHXAudioSession::HXDeviceSetupCallback::IsInterruptSafe()
> {
>+ return TRUE;
>+}
>+
>+BOOL CHXAudioSession::SetOpaqueMode( const char * pszOpaqueType, IHXBuffer *
pOpaqueData )
>+{
>+ if( m_bOpaqueMode )
>+ return FALSE;If you try to set OpaqueMode while already in that mode it is really an error?
>+ >+ m_bOpaqueMode = TRUE; >+ m_strOpaqueType = pszOpaqueType; >+ m_pOpaqueData = pOpaqueData; >+ m_pOpaqueData->AddRef();
Check for NULL in the params and return FAIL in that case.
>Index: platform/win/hxaudevds.cpp
>===================================================================
>RCS file: /cvsroot/audio/device/platform/win/hxaudevds.cpp,v
>retrieving revision 1.10.16.11
>diff -u -w -r1.10.16.11 hxaudevds.cpp
>--- platform/win/hxaudevds.cpp 17 Jan 2005 20:49:35 -0000 1.10.16.11
>+++ platform/win/hxaudevds.cpp 2 May 2005 03:25:06 -0000
>@@ -112,6 +112,8 @@
> , m_bExitThread(FALSE)
> , m_ulOriginalThreadId(0)
> , m_pAudioHookDMO(NULL)
>+ , m_pWaveFormat(NULL)
>+ , m_bOpaqueFormat(FALSE)
> {
Again, these should be in the same oreder as defined by the .h file.
>@@ -291,25 +326,26 @@ > DSBCAPS_CTRLPOSITIONNOTIFY | // have them reported here > DSBCAPS_GLOBALFOCUS | // take control! > DSBCAPS_STICKYFOCUS | >-#ifdef HELIX_FEATURE_AUDIO_DEVICE_HOOKS >- (bUsingDS8 && m_WaveFormat.Format.nChannels <= 2 ? DSBCAPS_CTRLFX : 0); >-#else >+//#ifdef HELIX_FEATURE_AUDIO_DEVICE_HOOKS >+ (bUsingDS8 && m_pWaveFormat->nChannels <= 2 && !m_bOpaqueFormat ? DSBCAPS_CTRLFX : 0); >+//#else > 0; >-#endif >+//#endif
Did you really mean to comment out the #ifdefs? If so, we shoud just remove them.
--greg.
Kevin Ross wrote:
Synopsis:
Implement opaque streams, which will be used initially by Secure Audio Path.
Overview:
Secure Audio Path (SAP) is used by certain DRM content, in which the audio
data is fed to our application in an encrypted state, and is decrypted by
the audio driver. Therefore, our app must not do anything to modify the
data during its journey through the core.
This is implemented by adding the concept of an opaque audio stream. New
header values were added to the audio stream to signify this is an opaque
stream. Audio services will see this header, and go into an "opaque mode".
This causes audio services to allow only one stream, and no modifications
may be done to it (no up/down mix, no pre- or post-mix hooks, etc). Also,
the audio device will be opened in an opaque mode, passing to it any special
data needed for this type of opaque stream. For SAP, this is a custom
WAVEFORMATEX header with which the audio device must be opened.
Files Modified: client/audiosvc/hxaudses.cpp/.h: Add flag for opaque mode, opens audio device in opaque mode if needed, disables post-mix hooks in opaque mode client/audiosvc/hxaudstr_new.cpp/.h: Read audio stream headers for opaque mode, sets audio session to opaque mode if needed client/audiosvc/mixengine.cpp/.h: Disables modifications to audio data if in opaque mode common/include/hxausvc.h and hxiids.h: Add new interface IHXOpaqueAudioDevice audio/device/hxaudev.cpp/.h: Implement IHXOpaqueAudioDevice interface. Calls derived _Imp_OpaqueOpen in platform-specific audio device audio/device/platform/win/hxaudevds.cpp/.h: Implemented opaque mode, uses passed-in WAVEFORMATEX struct instead of building one when in opaque mode, also disables real-time hooks.
Image Size and Heap Use impact: Didn't measure, shouldn't add more than 1K total for image size and heap use.
Platforms and Profiles Affected: All
Distribution Libraries affected:
none
Distribution library impact and planned action:
none
-----------------------------------------------------------
Platforms and Profiles Build Verified:
win32-i386-vc7, helix-client-all-defines
Platforms and Profiles Functionality verified: win32-i386-vc7, helix-client-all-defines
Branch: neptune 116, 123, 150, and HEAD (I think that's all)
QA Instructions: A seperate test plan has been written
_______________________________________________ Audio-dev mailing list [email protected] http://lists.helixcommunity.org/mailman/listinfo/audio-dev
