cra2ihxaenc.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:5k
- /* ***** 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 _HXENCODER_H_
- #define _HXENCODER_H_
- // $Private
- #include "hxcom.h"
- #include "hxtypes.h"
- #include "hxresult.h"
- #include "hxacodec.h"
- #include "racodec.h"
- /* opaque declarations */
- DECLARE_INTERFACE(IQueryDecoderUnit) ;
- DECLARE_INTERFACE(IPrepareDecoderUnit) ;
- // did not want to put this into racodec.h...
- extern int RAHaveSetPassword(void) ;
- class HXAudioEncoder : IHXAudioEncoder, IHXAudioEncoderConfigurator, IHXCodecOldStyleAuthenticate
- {
- public:
- HXAudioEncoder() ;
- HX_RESULT Init() ;
- /*
- * IUnknown methods
- */
- STDMETHOD(QueryInterface) (THIS_
- REFIID riid,
- void** ppvObj) ;
- STDMETHOD_(ULONG32,AddRef) (THIS) ;
- STDMETHOD_(ULONG32,Release) (THIS) ;
- /*
- * IHXAudioEncoder configuration/encoding methods
- */
- STDMETHOD_(UINT32,GetNumberOfFlavors) (THIS) CONSTMETHOD ;
- STDMETHOD(GetFlavorProperty) (THIS_
- INT32 flvIndex,
- PROPERTY_LONG p,
- INT32& l) CONSTMETHOD ;
- STDMETHOD(GetFlavorProperty) (THIS_
- INT32 flvIndex,
- PROPERTY_FLOAT p,
- float& l) CONSTMETHOD ;
- // on input, set buflen to what you have reserved. On output, will be set to space needed.
- // if space not sufficient, no copy will be done.
- STDMETHOD(GetFlavorProperty) (THIS_
- INT32 flvIndex,
- PROPERTY_VOID p,
- void* v,
- UINT32& buflen) CONSTMETHOD ;
- STDMETHOD(SetFlavor) (THIS_
- INT32 nFlavor) ;
- STDMETHOD(SetOption) (THIS_
- OPTION_LONG option, INT32 arg) ;
- STDMETHOD(OpenEncoder)(THIS) ;
- STDMETHOD(EncodeData)(THIS_
- void *pDataIn, UINT32 nSamplesIn,
- UINT32& nSamplesConsumed,
- IQueryDecoderUnit* dataOut[], UINT32& nDecoderUnits,
- INT32 eof) ;
- STDMETHOD_(void,CloseEncoder)(THIS) ;
- /*
- * IHXCodecOldStyleAuthenticate methods
- */
- STDMETHOD(SetPassword) (THIS_ const char* password) ;
- private:
- ~HXAudioEncoder() ;
- // Declaring these private, and not providing an implementation
- // makes it a compile error to accidentally try to use them
- HXAudioEncoder( const HXAudioEncoder& ) ;
- HXAudioEncoder& operator =( const HXAudioEncoder& ) ;
- HX_RESULT CreateIPrepareDecoderUnit(IPrepareDecoderUnit*& ppi) ;
- HX_RESULT retrieveProperties(void) ;
- long m_lRefCount ;
- RACODEC mpCodecRef ;
- UINT32 mnSamplesIn, mnBytesOut ;
- INT32 mCurrentFlavorIndex ;
- short* mpDataIn ;
- unsigned char* mpDataOut ;
- UINT32 mDataOffset ;
- struct tag_propTable {
- UINT32 bytesPerEncode, bytesPerFrame, framesPerBlock, samplesPerFrame;
- } *mpPropTable ;
- } ;
- // $EndPrivate
- #endif // _HXENCODER_H_