2014-07-02 07:28:09 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* H.264 Bitmap Compression
|
|
|
|
*
|
|
|
|
* Copyright 2014 Mike McDonald <Mike.McDonald@software.dell.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FREERDP_CODEC_H264_H
|
|
|
|
#define FREERDP_CODEC_H264_H
|
|
|
|
|
|
|
|
#include <freerdp/api.h>
|
|
|
|
#include <freerdp/types.h>
|
|
|
|
|
2014-07-14 17:59:57 +04:00
|
|
|
#ifdef WITH_LIBAVCODEC
|
|
|
|
#ifdef WITH_OPENH264
|
|
|
|
#undef WITH_OPENH264
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2014-07-02 07:28:09 +04:00
|
|
|
#ifdef WITH_OPENH264
|
|
|
|
#include "wels/codec_def.h"
|
|
|
|
#include "wels/codec_api.h"
|
|
|
|
#endif
|
|
|
|
|
2014-07-14 17:59:57 +04:00
|
|
|
#ifdef WITH_LIBAVCODEC
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
#include <libavutil/avutil.h>
|
|
|
|
#endif
|
|
|
|
|
2014-07-02 07:28:09 +04:00
|
|
|
struct _H264_CONTEXT
|
|
|
|
{
|
|
|
|
BOOL Compressor;
|
|
|
|
|
2014-07-10 00:41:36 +04:00
|
|
|
BYTE* data;
|
|
|
|
UINT32 size;
|
|
|
|
UINT32 width;
|
|
|
|
UINT32 height;
|
|
|
|
int scanline;
|
|
|
|
|
2014-07-02 07:28:09 +04:00
|
|
|
#ifdef WITH_OPENH264
|
|
|
|
ISVCDecoder* pDecoder;
|
|
|
|
#endif
|
2014-07-14 17:59:57 +04:00
|
|
|
|
|
|
|
#ifdef WITH_LIBAVCODEC
|
|
|
|
AVCodec* codec;
|
|
|
|
AVCodecContext* codecContext;
|
|
|
|
AVCodecParserContext* codecParser;
|
|
|
|
AVFrame* videoFrame;
|
|
|
|
#endif
|
2014-07-02 07:28:09 +04:00
|
|
|
};
|
|
|
|
typedef struct _H264_CONTEXT H264_CONTEXT;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
FREERDP_API int h264_compress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize);
|
|
|
|
|
|
|
|
FREERDP_API int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
|
|
|
|
BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight);
|
|
|
|
|
|
|
|
FREERDP_API void h264_context_reset(H264_CONTEXT* h264);
|
|
|
|
|
|
|
|
FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor);
|
|
|
|
FREERDP_API void h264_context_free(H264_CONTEXT* h264);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* FREERDP_CODEC_H264_H */
|
|
|
|
|