From: Tim B. <tbi...@us...> - 2006-07-28 09:17:14
|
Update of /cvsroot/aaf/AAF/ref-impl/aaflib In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv27321/ref-impl/aaflib Modified Files: aaflib.cpp aaflib.h Log Message: Add AAFSetDiagnosticOutput() and IAAFDiagnosticOutput to support diagnostic output from the library to a client implemented destination. Index: aaflib.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/aaflib/aaflib.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** aaflib.cpp 9 Jun 2006 21:56:42 -0000 1.43 --- aaflib.cpp 25 Jul 2006 23:26:28 -0000 1.44 *************** *** 829,834 **** --- 829,862 ---- + //*********************************************************** + // + // AAFSetDiagnosticOutput() + // + STDAPI AAFSetDiagnosticOutput ( + IAAFDiagnosticOutput * pStream) + { + HRESULT hr = S_OK; + AAFDLL *pAAFDLL = NULL; + // Get the dll wrapper + hr = LoadIfNecessary(&pAAFDLL); + if (FAILED(hr)) + return hr; + + try + { + // Attempt to call the dll's exported function... + hr = pAAFDLL->SetDiagnosticOutput + (pStream); + } + catch (...) + { + // Return a reasonable exception code. + // + hr = AAFRESULT_UNEXPECTED_EXCEPTION; + } + return hr; + } STDAPI *************** *** 1133,1136 **** --- 1161,1168 ---- rc = ::AAFFindSymbol(_libHandle, + "AAFSetDiagnosticOutput", + (AAFSymbolAddr *)&_pfnSetDiagnosticOutput); + + rc = ::AAFFindSymbol(_libHandle, "AAFGetLibraryVersion", (AAFSymbolAddr *)&_pfnGetLibraryVersion); *************** *** 1202,1205 **** --- 1234,1238 ---- _pfnSetProgressCallback = 0; _pfnGetFileEncodings = 0; + _pfnSetDiagnosticOutput = 0; _pfnGetLibraryVersion = 0; _pfnGetLibraryPathNameBufLen = 0; *************** *** 1461,1464 **** --- 1494,1507 ---- } + HRESULT AAFDLL::SetDiagnosticOutput ( + IAAFDiagnosticOutput * pStream) + { + // This callback did not exist in DR4 or earlier toolkits. + if (NULL == _pfnSetDiagnosticOutput) + return AAFRESULT_DLL_SYMBOL_NOT_FOUND; + + return _pfnSetDiagnosticOutput + (pStream); + } HRESULT AAFDLL::GetLibraryVersion Index: aaflib.h =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/aaflib/aaflib.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** aaflib.h 9 Jun 2006 01:38:06 -0000 1.22 --- aaflib.h 25 Jul 2006 23:26:28 -0000 1.23 *************** *** 140,143 **** --- 140,146 ---- IEnumAAFFileEncodings ** ppFileEncodings); + typedef STDAPICALLTYPE HRESULT (* LPFNAAFSETOUTPUTSTREAM)( + IAAFDiagnosticOutput * pStream); + typedef STDAPICALLTYPE HRESULT (* LPFNAAFGETLIBRARYVERSION)( aafProductVersion_t * pVersion); *************** *** 261,264 **** --- 264,270 ---- IEnumAAFFileEncodings ** ppFileEncodings); + typedef HRESULT (STDAPICALLTYPE * LPFNAAFSETOUTPUTSTREAM)( + IAAFDiagnosticOutput * pStream); + typedef HRESULT (STDAPICALLTYPE * LPFNAAFGETLIBRARYVERSION)( aafProductVersion_t * pVersion); *************** *** 423,426 **** --- 429,435 ---- IEnumAAFFileEncodings ** ppFileEncodings); + HRESULT SetDiagnosticOutput ( + IAAFDiagnosticOutput * pStreams); + HRESULT GetLibraryVersion ( aafProductVersion_t * pVersion); *************** *** 475,478 **** --- 484,488 ---- LPFNAAFSETPROGRESSCALLBACK _pfnSetProgressCallback; LPFNAAFGETFILEENCODINGS _pfnGetFileEncodings; + LPFNAAFSETOUTPUTSTREAM _pfnSetDiagnosticOutput; LPFNAAFGETLIBRARYVERSION _pfnGetLibraryVersion; LPFNAAFGETLIBRARYPATHNAMEBUFLEN _pfnGetLibraryPathNameBufLen; |