Blame channels/tsmf/client/tsmf_decoder.h

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