#pragma once
#ifdef __cplusplus
extern "C"
{
#endif

#ifdef _WIN32
#define EZ_DECODER_EXPORTS_API	__declspec(dllexport)
#define EZ_DECODER_EXPORTS_APICALL __stdcall
#else
#define EZ_DECODER_EXPORTS_API	
#define EZ_DECODER_EXPORTS_APICALL
#endif

	typedef void* EZ_DECODER_HANDLE;

	typedef struct __EZ_DECODER_INFO__
	{
		int width;
		int height;
		int data_size;
	}EZDecoderInfo;

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		ez_decoder_create(EZ_DECODER_HANDLE *handle);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		ez_decoder_destroy(EZ_DECODER_HANDLE* handle);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		ez_decoder_push_data(EZ_DECODER_HANDLE handle, const unsigned char *data, int data_size, int video_id, unsigned char **out_data, EZDecoderInfo *info);

	/* ����־ */
	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL ez_activate_log(const char* logDir, int logDirSize);

	//typedef void* PullStream_Handle;
#define PullStream_Handle void*
	typedef int (EZ_DECODER_EXPORTS_APICALL* PullStreamCallBack)(void* _channelPtr, int _frameType, void* pBuf, int puf_len, int frameCodec, int frameFlag);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		PullStream_Init(PullStream_Handle* handle);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		PullStream_DeInit(PullStream_Handle handle);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		PullStream_SetCallback(PullStream_Handle handle, PullStreamCallBack callback);

	EZ_DECODER_EXPORTS_API int EZ_DECODER_EXPORTS_APICALL
		PullStream_Open(PullStream_Handle handle, void* userPtr, char *url, int timeout);

#ifdef __cplusplus
}
#endif

