codeclib.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:10k
- /* ***** BEGIN LICENSE BLOCK *****
- * Version: RCSL 1.0/RPSL 1.0
- *
- * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
- *
- * The contents of this file, and the files included with this file, are
- * subject to the current version of the RealNetworks Public Source License
- * Version 1.0 (the "RPSL") available at
- * http://www.helixcommunity.org/content/rpsl unless you have licensed
- * the file under the RealNetworks Community Source License Version 1.0
- * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
- * in which case the RCSL will apply. You may also obtain the license terms
- * directly from RealNetworks. You may not use this file except in
- * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
- * applicable to this file, the RCSL. Please see the applicable RPSL or
- * RCSL for the rights, obligations and limitations governing use of the
- * contents of the file.
- *
- * This file is part of the Helix DNA Technology. RealNetworks is the
- * developer of the Original Code and owns the copyrights in the portions
- * it created.
- *
- * This file, and the files included with this file, is distributed and made
- * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- *
- * Technology Compatibility Kit Test Suite(s) Location:
- * http://www.helixcommunity.org/content/tck
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
- #ifndef __CODECLIB_H__
- #define __CODECLIB_H__
- #include "hxcodec.h"
- typedef HX_RESULT (HXEXPORT_PTR FPCODECOPEN)(HX_MOFTAG moftFormatTag,HXCODEC *codecRef);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECCLOSE)(HXCODEC codecRef);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECGETUINAME)(HXCODEC codecRef,char *nameBuf);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECGETVERSION)(HXCODEC codecRef, ULONG32 *pVersion);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECOPENSETTINGSBOX)(HXCODEC codecRef, void * platformData);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECQUERYMEDIAFORMAT)(HXCODEC codecRef,HX_MOF * pmofIn,
- HX_MOF * pmofOut, UINT16 ioDirection);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECPREFERREDMEDIAFORMAT)(HXCODEC codecRef,HX_MOF * pmofIn,
- HX_MOF * pmofOut, UINT16 ioDirection);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECGETMEDIAFORMATS)(HXCODEC codecRef,HX_MOF **pFormats,
- ULONG32 * numFormats,UINT16 oDirection);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECSTREAMOPEN)(HXCODEC codecRef,HXSTREAM *streamRef,HXCODEC_INIT
- *params);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMCLOSE)(HXSTREAM streamRef);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMSETDATACALLBACK)(HXSTREAM streamRef,HXSTREAM callbackRef,
- HXMEMORY memoryRef, FP_STREAM_DATA data_callback);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMGETSTREAMHEADERSIZE)(HXSTREAM streamRef, ULONG32 *puSize);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMGETSTREAMHEADER)(HXSTREAM streamRef, HX_MOF *pHeader);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMINPUT)(HXSTREAM streamRef,HXSTREAM fromStreamRef,
- HXCODEC_DATA *pData);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMSETOUTPUTPACKETSIZE)(HXSTREAM streamRef,ULONG32 prefSize,
- ULONG32 maxSize,ULONG32 *actualSize);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMGETINPUTBUFFERSIZE)(HXSTREAM streamRef,ULONG32 *puSize);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMGETPROPERTY)(HXSTREAM streamRef,ULONG32 prop, void *pValue);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMSETPROPERTY)(HXSTREAM streamRef,ULONG32 prop, void *pValue);
- // XXXKB: This needs to be modified to support the postfilter ROI:
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMPOSTPROCESS)
- (HXSTREAM streamRef,
- HXCODEC_DATA *pncData,
- ULONG32 uCurrentTime,
- UCHAR *pDestBuffer,
- UINT32 uDestPitch,
- INT32 cidDestColorFormat);
- typedef HX_RESULT (HXEXPORT_PTR FPSTREAMRELEASEFRAME)
- (HXSTREAM streamRef,
- HXCODEC_DATA *pncData);
- typedef PIHXUnknown (HXEXPORT_PTR FPGETHXUNKNOWN)(HXSTREAM streamRef);
- typedef PIHXUnknown (HXEXPORT_PTR FPCODECGETHXUNKNOWN)(HXCODEC codecRef);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECINPUT) (HXCODEC codecRef, HXCODEC_DATA *pData);
- typedef HX_RESULT (HXEXPORT_PTR FPCODECQUERYMEDIAFORMAT) (HXCODEC codecRef,
- HX_MOF * pmofIn,
- HX_MOF * pmofOut,
- UINT16 ioDirection);
- class DLLAccessBridge;
- class CRADynamicCodecLibrary
- {
- // Construction & Destruction
- public:
- CRADynamicCodecLibrary(IUnknown* pContext = NULL, BOOL bDummy = FALSE);
- virtual ~CRADynamicCodecLibrary();
- virtual HX_RESULT LoadCodecLib(HX_MOFTAG moftFormatTag, const char* szCodecDLL=NULL);
- virtual HX_RESULT PNCodec_Open(HX_MOFTAG moftFormatTag,HXCODEC *codecRef) const;
- virtual HX_RESULT PNCodec_Close(HXCODEC codecRef) const;
- virtual HX_RESULT PNCodec_StreamOpen(HXCODEC codecRef,HXSTREAM *streamRef,HXCODEC_INIT *params) const;
- virtual HX_RESULT PNStream_Close(HXSTREAM streamRef);
- virtual HX_RESULT PNStream_SetDataCallback(HXSTREAM streamRef, HXSTREAM callbackRef,
- HXMEMORY memoryRef, FP_STREAM_DATA data_callback) const;
- virtual HX_RESULT PNStream_GetStreamHeaderSize(HXSTREAM streamRef,ULONG32 *puSize) const;
- virtual HX_RESULT PNStream_GetStreamHeader(HXSTREAM streamRef,HX_MOF *pHeader) const;
- virtual HX_RESULT PNStream_Input(HXSTREAM streamRef,HXSTREAM fromStreamRef,HXCODEC_DATA *pData);
- virtual HX_RESULT PNStream_SetOutputPacketSize(HXSTREAM streamRef,ULONG32 prefSize,
- ULONG32 maxSize, ULONG32 *actualSize) const;
- virtual HX_RESULT PNStream_GetInputBufferSize(HXSTREAM streamRef,ULONG32 *puSize) const;
- virtual HX_RESULT PNStream_GetProperty(HXSTREAM streamRef,ULONG32 prop, void *pValue) const;
- virtual HX_RESULT PNStream_SetProperty(HXSTREAM streamRef,ULONG32 prop, void *pValue) const;
- virtual HX_RESULT PNStream_PostProcess(HXSTREAM streamRef,
- HXCODEC_DATA* pncData,
- ULONG32 uCurrentTime,
- UCHAR* pDestBuffer,
- UINT32 uDestPitch,
- INT32 cidDestColorFormat,
- UINT32 roiX,
- UINT32 roiY,
- UINT32 roiWidth,
- UINT32 roiHeight);
- virtual HX_RESULT PNStream_ReleaseFrame(HXSTREAM streamRef,
- HXCODEC_DATA* pncData);
- virtual PIHXUnknown PNStream_GetIPNUnknown(HXSTREAM streamRef) const;
- virtual HX_RESULT PNCodec_GetUIName(HXCODEC codecRef,char *nameBuf) const;
- virtual HX_RESULT DoAutoUpdate(BOOL bSigErr = TRUE) { return HXR_OK; }
- HX_RESULT PNCodec_Input(HXCODEC codecRef,HXCODEC_DATA *pData);
- virtual PIHXUnknown PNCodec_GetIPNUnknown(HXCODEC codecRef) const;
-
- virtual HX_RESULT PNCodec_QueryMediaFormat(HXCODEC codecRef,
- HX_MOF * pmofIn,
- HX_MOF * pmofOut,
- UINT16 ioDirection);
- protected:
- IUnknown* m_pContext;
- DLLAccessBridge* m_pCodecAccess;
- FPCODECOPEN m_fpHXCodec_Open;
- FPCODECCLOSE m_fpHXCodec_Close;
- FPCODECSTREAMOPEN m_fpHXCodec_StreamOpen;
- FPSTREAMCLOSE m_fpHXStream_Close;
- FPSTREAMSETDATACALLBACK m_fpHXStream_SetDataCallback;
- FPSTREAMGETSTREAMHEADERSIZE m_fpHXStream_GetStreamHeaderSize;
- FPSTREAMGETSTREAMHEADER m_fpHXStream_GetStreamHeader;
- FPSTREAMINPUT m_fpHXStream_Input;
- FPSTREAMSETOUTPUTPACKETSIZE m_fpHXStream_SetOutputPacketSize;
- FPSTREAMGETINPUTBUFFERSIZE m_fpHXStream_GetInputBufferSize;
- FPSTREAMGETPROPERTY m_fpHXStream_GetProperty;
- FPSTREAMSETPROPERTY m_fpHXStream_SetProperty;
- FPSTREAMPOSTPROCESS m_fpHXStream_PostProcess;
- FPSTREAMRELEASEFRAME m_fpHXStream_ReleaseFrame;
- FPGETHXUNKNOWN m_fpHXStream_GetIHXUnknown;
- FPCODECGETUINAME m_fpHXCodec_GetUIName;
- FPCODECINPUT m_fpHXCodecInput;
- FPCODECGETHXUNKNOWN m_fpHXCodec_GetIHXUnknown;
- FPCODECQUERYMEDIAFORMAT m_fpHXCodec_QueryMediaFormat;
-
- #ifdef _MACINTOSH
- INT16 m_CodecResFileNum;
- BOOL m_bNeedToUseResourceFile;
- #endif
- BOOL OS_ValidModule (ULONG32 modHandle);
- BOOL OS_BuildLibName (HX_MOFTAG tag, char *libName);
- BOOL OS_BuildOldLibName (HX_MOFTAG tag, char *libName);
- void ClearFunctionPointers();
- BOOL GetAlternateMoftCodecTag(HX_MOFTAG& alternateMoftCodecTag,
- HX_MOFTAG moftCodecTag,
- UINT32& ulAttemptCounter);
- };
- #endif // __CODECLIB_H__