2013-12-09 13:51:09 +01:00
|
|
|
/*!
|
|
|
|
* \copy
|
|
|
|
* Copyright (c) 2009-2013, Cisco Systems
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* WelsDecoderExt.h
|
|
|
|
*
|
|
|
|
* Abstract
|
|
|
|
* Cisco OpenH264 decoder extension utilization interface
|
|
|
|
*
|
|
|
|
* History
|
|
|
|
* 3/12/2009 Created
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*************************************************************************/
|
|
|
|
#if !defined(AFX_WELSH264DECODER_H__D9FAA1D1_5403_47E1_8E27_78F11EE65F02__INCLUDED_)
|
|
|
|
#define AFX_WELSH264DECODER_H__D9FAA1D1_5403_47E1_8E27_78F11EE65F02__INCLUDED_
|
|
|
|
|
|
|
|
#include "codec_api.h"
|
|
|
|
#include "codec_app_def.h"
|
|
|
|
#include "decoder_context.h"
|
|
|
|
#include "welsCodecTrace.h"
|
2014-01-23 04:01:51 +01:00
|
|
|
#include "cpu.h"
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
class ISVCDecoder;
|
|
|
|
|
|
|
|
namespace WelsDec {
|
|
|
|
|
|
|
|
//#define OUTPUT_BIT_STREAM ////for test to output bitstream
|
|
|
|
|
2013-12-12 23:21:12 +01:00
|
|
|
class CWelsDecoder : public ISVCDecoder {
|
|
|
|
public:
|
2014-02-08 22:26:33 +01:00
|
|
|
CWelsDecoder (void);
|
2013-12-12 23:21:12 +01:00
|
|
|
virtual ~CWelsDecoder();
|
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
virtual long EXTAPI Initialize (void* pParam, const INIT_TYPE keInitType);
|
2014-01-21 15:12:57 +01:00
|
|
|
virtual long EXTAPI Uninitialize();
|
2013-12-12 23:21:12 +01:00
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* Description:
|
|
|
|
* Decompress one frame, and output RGB24 or YV12 decoded stream and its length.
|
|
|
|
* Input parameters:
|
|
|
|
* Parameter TYPE Description
|
|
|
|
* pSrc unsigned char* the h264 stream to decode
|
|
|
|
* srcLength int the length of h264 steam
|
|
|
|
* pDst unsigned char* buffer pointer of decoded data
|
|
|
|
* pDstInfo SBufferInfo& information provided to API including width, height, SW/HW option, etc
|
|
|
|
*
|
|
|
|
* return: if decode frame success return 0, otherwise corresponding error returned.
|
2013-12-13 21:03:38 +01:00
|
|
|
***************************************************************************/
|
2014-01-21 15:12:57 +01:00
|
|
|
virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* kpSrc,
|
|
|
|
const int kiSrcLen,
|
|
|
|
unsigned char** ppDst,
|
|
|
|
int* pStride,
|
|
|
|
int& iWidth,
|
|
|
|
int& iHeight);
|
|
|
|
|
|
|
|
virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* kpSrc,
|
|
|
|
const int kiSrcLen,
|
2014-02-08 22:26:33 +01:00
|
|
|
void** ppDst,
|
2014-01-21 15:12:57 +01:00
|
|
|
SBufferInfo* pDstInfo);
|
|
|
|
virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* kpSrc,
|
|
|
|
const int kiSrcLen,
|
|
|
|
unsigned char* pDst,
|
|
|
|
int iDstStride,
|
|
|
|
int& iDstLen,
|
|
|
|
int& iWidth,
|
|
|
|
int& iHeight,
|
|
|
|
int& color_format);
|
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
virtual long EXTAPI SetOption (DECODER_OPTION eOptID, void* pOption);
|
|
|
|
virtual long EXTAPI GetOption (DECODER_OPTION eOptID, void* pOption);
|
2013-12-12 23:21:12 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
PWelsDecoderContext m_pDecContext;
|
|
|
|
IWelsTrace* m_pTrace;
|
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
void InitDecoder (void);
|
|
|
|
void UninitDecoder (void);
|
2013-12-12 23:21:12 +01:00
|
|
|
|
2014-01-23 04:01:51 +01:00
|
|
|
XMMREG_PROTECT_DECLARE(CWelsH264Decoder);
|
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
#ifdef OUTPUT_BIT_STREAM
|
2013-12-12 23:21:12 +01:00
|
|
|
WelsFileHandle* m_pFBS;
|
|
|
|
WelsFileHandle* m_pFBSSize;
|
2013-12-09 13:51:09 +01:00
|
|
|
#endif//OUTPUT_BIT_STREAM
|
2013-12-12 23:21:12 +01:00
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace WelsDec
|
|
|
|
|
|
|
|
#endif // !defined(AFX_WELSH264DECODER_H__D9FAA1D1_5403_47E1_8E27_78F11EE65F02__INCLUDED_)
|