📄 rv30api.cpp
字号:
/* ***** 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 ***** */
///////////////////
// include files
#include "hxtypes.h"
#include "hxresult.h"
#if (defined(BUILD_RV789COMBO_DECODER_FRONTEND) || defined(BUILD_RV789MP4COMBO_DECODER_FRONTEND)) && defined(HELIX_FEATURE_DLLACCESS_CLIENT)
#define INITGUID 1
#include "hxcom.h"
#undef INITGUID
#else // (BUILD_RV789COMBO_DECODER_FRONTEND || BUILD_RV789MP4COMBO_DECODER_FRONTEND) && HELIX_FEATURE_DLLACCESS_CLIENT
#include "dllpath.h"
ENABLE_DLLACCESS_PATHS(RV30);
#endif // (BUILD_RV789COMBO_DECODER_FRONTEND || BUILD_RV789MP4COMBO_DECODER_FRONTEND) && HELIX_FEATURE_DLLACCESS_CLIENT
#include "hxassert.h"
#include "hxcodec.h"
#include "hxmtypes.h"
#include "hxheap.h"
#include "rv30api.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
static const char HX_THIS_FILE[] = __FILE__;
#endif
HX_RESULT RV20CreateInstance(IHXUnknown *pUnkOuter, HX_IID riid, void **ppv);
///////////////////
// local definitions
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_Open
//
// Purpose:
// PNCodec_Open() attempts to load a codec whose type is specified
// by moftFormatTag. Some currently used codec HX_MOFTAGs are:
// RA_FORMAT_3_ID RealAudio 14.4 audio codec
// RA_FORMAT_4_ID RealAudio 28.8 audio codec
//
// Parameters:
// moftFormatTag - the 4 byte codec identifier
// codecRef - the HXCODEC reference is returned in codecRef.
// You will need to use this reference in all future HXCodec_XXX() functions.
//
// Return:
// S_OK - loading of codec was successful.
// HXR_OUTOFMEMORY - insufficient memory to load codec.
// HXCODEC_LOAD_ERR - unable to load codec.
//
// Notes:
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Open)(HX_MOFTAG moftFormatTag, HXCODEC *pcodecRef)
{
HX_TRACE("PNCodec_Open()\r\n");
HX_RESULT theErr = S_OK;
HX_ASSERT_VALID_PTR(pcodecRef);
*pcodecRef = NULL;
theErr = RV20CreateInstance(NULL, moftFormatTag, pcodecRef);
return(theErr);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_Close
//
// Purpose:
// PNCodec_Close() closes a codec referenced by codecRef.
// Note: After calling PNCodec_Close(), codecRef is no longer a valid
// codec reference.
//
// Parameters:
// codecRef - the codec reference returned by PNCodec_Open().
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Close)(HXCODEC codecRef)
{
HX_TRACE("PNCodec_Close()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_Close();
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_GetUIName
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetUIName)(HXCODEC codecRef, char *pnameBuf)
{
HX_TRACE("PNCodec_GetUIName()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_GetUIName(pnameBuf);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_GetVersion
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetVersion)(HXCODEC codecRef, ULONG32 *pVersion)
{
HX_TRACE("PNCodec_GetVersion()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_GetVersion(pVersion);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_QueryMediaFormat
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_QueryMediaFormat)(HXCODEC codecRef, HX_MOF * pmofIn,
HX_MOF * pmofOut, UINT16 ioDirection)
{
HX_TRACE("PNCodec_QueryMediaFormat()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_QueryMediaFormat(pmofIn, pmofOut, ioDirection);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_PreferredMediaFormat
//
// Purpose:
// ioDirection Either HXCODEC_INPUT or HXCODEC_OUTPUT, HXCODEC_INPUT
// specifies the pmofOut is filled out with the desired
// output format and we want to find out what the perferred
// input media format is.
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_PreferredMediaFormat)(HXCODEC codecRef, HX_MOF * pmofIn,
HX_MOF * pmofOut, UINT16 ioDirection)
{
HX_TRACE("HXCodec_PerferredMediaFormat()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_PreferredMediaFormat(pmofIn, pmofOut, ioDirection);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_GetMediaFormats
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_GetMediaFormats)(HXCODEC codecRef, UINT16 ioDirection,
FP_MEDIAFORMATSCALLBACK fpCallback, void *userData)
{
HX_TRACE("PNCodec_GetMediaFormats()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_GetMediaFormats(ioDirection, fpCallback,
userData);
}
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_StreamOpen
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_StreamOpen)(HXCODEC codecRef, HXSTREAM * pStreamRef,
HXCODEC_INIT * pParams)
{
HX_TRACE("PNCodec_StreamOpen()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_StreamOpen(pStreamRef, pParams);
}
#ifdef ADD_HXCODEC_INPUT
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNCodec_Input
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
//
//
HX_RESULT HXEXPORT ENTRYPOINT(PNCodec_Input)(HXCODEC codecRef, HXCODEC_DATA * pData)
{
HX_TRACE("HXCodec_()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_Input(pData);
}
#endif
#if defined ADD_HXCODEC_GETIPNUNKNOWN
IHXUnknown * HXEXPORT ENTRYPOINT(PNCodec_GetIPNUnknown)(HXCODEC codecRef)
{
HX_TRACE("PNCodec_GetIPNUnknown()\r\n");
HX_ASSERT_VALID_PTR(codecRef);
IHX20Codec* pCodecObj = (IHX20Codec *)codecRef;
return pCodecObj->PNCodec_GetIPNUnknown();
}
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Function:
//
// PNStream_OpenSettingsBox
//
// Purpose:
//
//
// Parameters:
//
//
// Return:
//
//
// Notes:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -