Blame channels/tsmf/client/tsmf_decoder.h

Packit Service fa4841
/**
Packit Service fa4841
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit Service fa4841
 * Video Redirection Virtual Channel - Decoder
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright 2010-2011 Vic Lee
Packit Service fa4841
 * Copyright 2012 Hewlett-Packard Development Company, L.P.
Packit Service fa4841
 *
Packit Service fa4841
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit Service fa4841
 * you may not use this file except in compliance with the License.
Packit Service fa4841
 * You may obtain a copy of the License at
Packit Service fa4841
 *
Packit Service fa4841
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit Service fa4841
 *
Packit Service fa4841
 * Unless required by applicable law or agreed to in writing, software
Packit Service fa4841
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit Service fa4841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service fa4841
 * See the License for the specific language governing permissions and
Packit Service fa4841
 * limitations under the License.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#ifndef FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
Packit Service fa4841
#define FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
Packit Service fa4841
Packit Service fa4841
#include "tsmf_types.h"
Packit Service fa4841
Packit Service fa4841
typedef enum _ITSMFControlMsg
Packit Service fa4841
{
Packit Service fa4841
	Control_Pause,
Packit Service fa4841
	Control_Resume,
Packit Service fa4841
	Control_Restart,
Packit Service fa4841
	Control_Stop
Packit Service fa4841
} ITSMFControlMsg;
Packit Service fa4841
Packit Service fa4841
typedef struct _ITSMFDecoder ITSMFDecoder;
Packit Service fa4841
Packit Service fa4841
struct _ITSMFDecoder
Packit Service fa4841
{
Packit Service fa4841
	/* Set the decoder format. Return true if supported. */
Packit Service bb5c11
	BOOL (*SetFormat)(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *media_type);
Packit Service fa4841
	/* Decode a sample. */
Packit Service bb5c11
	BOOL (*Decode)(ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions);
Packit Service fa4841
	/* Get the decoded data */
Packit Service bb5c11
	BYTE *(*GetDecodedData)(ITSMFDecoder *decoder, UINT32 *size);
Packit Service fa4841
	/* Get the pixel format of decoded video frame */
Packit Service bb5c11
	UINT32(*GetDecodedFormat)(ITSMFDecoder *decoder);
Packit Service fa4841
	/* Get the width and height of decoded video frame */
Packit Service bb5c11
	BOOL (*GetDecodedDimension)(ITSMFDecoder *decoder, UINT32 *width, UINT32 *height);
Packit Service fa4841
	/* Free the decoder */
Packit Service bb5c11
	void (*Free)(ITSMFDecoder *decoder);
Packit Service fa4841
	/* Optional Contol function */
Packit Service bb5c11
	BOOL (*Control)(ITSMFDecoder *decoder, ITSMFControlMsg control_msg, UINT32 *arg);
Packit Service fa4841
	/* Decode a sample with extended interface. */
Packit Service bb5c11
	BOOL (*DecodeEx)(ITSMFDecoder *decoder, const BYTE *data, UINT32 data_size, UINT32 extensions,
Packit Service bb5c11
					UINT64 start_time, UINT64 end_time, UINT64 duration);
Packit Service fa4841
	/* Get current play time */
Packit Service bb5c11
	UINT64(*GetRunningTime)(ITSMFDecoder *decoder);
Packit Service fa4841
	/* Update Gstreamer Rendering Area */
Packit Service bb5c11
	BOOL (*UpdateRenderingArea)(ITSMFDecoder *decoder, int newX, int newY, int newWidth, int newHeight, int numRectangles, RDP_RECT *rectangles);
Packit Service fa4841
	/* Change Gstreamer Audio Volume */
Packit Service bb5c11
	BOOL (*ChangeVolume)(ITSMFDecoder *decoder, UINT32 newVolume, UINT32 muted);
Packit Service fa4841
	/* Check buffer level */
Packit Service bb5c11
	BOOL (*BufferLevel)(ITSMFDecoder *decoder);
Packit Service fa4841
	/* Register a callback for frame ack. */
Packit Service bb5c11
	BOOL (*SetAckFunc)(ITSMFDecoder *decoder, BOOL (*cb)(void *,BOOL), void *stream);
Packit Service fa4841
	/* Register a callback for stream seek detection. */
Packit Service bb5c11
	BOOL (*SetSyncFunc)(ITSMFDecoder *decoder, void (*cb)(void *), void *stream);
Packit Service fa4841
};
Packit Service fa4841
Packit Service fa4841
#define TSMF_DECODER_EXPORT_FUNC_NAME "TSMFDecoderEntry"
Packit Service bb5c11
typedef ITSMFDecoder *(*TSMF_DECODER_ENTRY)(void);
Packit Service fa4841
Packit Service bb5c11
ITSMFDecoder *tsmf_load_decoder(const char *name, TS_AM_MEDIA_TYPE *media_type);
Packit Service fa4841
BOOL tsmf_check_decoder_available(const char* name);
Packit Service fa4841
Packit Service fa4841
#endif /* FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H */