2011-09-19 18:54:09 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-09-19 18:54:09 +04:00
|
|
|
* Video Redirection Virtual Channel - Decoder
|
|
|
|
*
|
|
|
|
* Copyright 2010-2011 Vic Lee
|
2012-06-13 23:45:58 +04:00
|
|
|
* Copyright 2012 Hewlett-Packard Development Company, L.P.
|
2011-09-19 18:54:09 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#ifndef FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
|
|
|
|
#define FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
|
2011-09-19 18:54:09 +04:00
|
|
|
|
|
|
|
#include "tsmf_types.h"
|
|
|
|
|
2012-06-13 23:45:58 +04:00
|
|
|
typedef enum _ITSMFControlMsg
|
|
|
|
{
|
|
|
|
Control_Pause,
|
2014-05-23 15:48:02 +04:00
|
|
|
Control_Resume,
|
2015-07-08 00:39:29 +03:00
|
|
|
Control_Restart,
|
2014-05-23 15:48:02 +04:00
|
|
|
Control_Stop
|
2012-06-13 23:45:58 +04:00
|
|
|
} ITSMFControlMsg;
|
|
|
|
|
2011-09-19 18:54:09 +04:00
|
|
|
typedef struct _ITSMFDecoder ITSMFDecoder;
|
|
|
|
|
|
|
|
struct _ITSMFDecoder
|
|
|
|
{
|
2011-11-19 21:19:16 +04:00
|
|
|
/* Set the decoder format. Return true if supported. */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*SetFormat)(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type);
|
2011-09-19 18:54:09 +04:00
|
|
|
/* Decode a sample. */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*Decode)(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions);
|
2011-09-19 18:54:09 +04:00
|
|
|
/* Get the decoded data */
|
2019-11-06 17:24:51 +03:00
|
|
|
BYTE* (*GetDecodedData)(ITSMFDecoder* decoder, UINT32* size);
|
2011-09-19 18:54:09 +04:00
|
|
|
/* Get the pixel format of decoded video frame */
|
2019-11-06 17:24:51 +03:00
|
|
|
UINT32 (*GetDecodedFormat)(ITSMFDecoder* decoder);
|
2011-09-19 18:54:09 +04:00
|
|
|
/* Get the width and height of decoded video frame */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*GetDecodedDimension)(ITSMFDecoder* decoder, UINT32* width, UINT32* height);
|
2011-09-19 18:54:09 +04:00
|
|
|
/* Free the decoder */
|
2019-11-06 17:24:51 +03:00
|
|
|
void (*Free)(ITSMFDecoder* decoder);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Optional Contol function */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*Control)(ITSMFDecoder* decoder, ITSMFControlMsg control_msg, UINT32* arg);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Decode a sample with extended interface. */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL(*DecodeEx)
|
|
|
|
(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions,
|
|
|
|
UINT64 start_time, UINT64 end_time, UINT64 duration);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Get current play time */
|
2019-11-06 17:24:51 +03:00
|
|
|
UINT64 (*GetRunningTime)(ITSMFDecoder* decoder);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Update Gstreamer Rendering Area */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL(*UpdateRenderingArea)
|
|
|
|
(ITSMFDecoder* decoder, int newX, int newY, int newWidth, int newHeight, int numRectangles,
|
|
|
|
RDP_RECT* rectangles);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Change Gstreamer Audio Volume */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*ChangeVolume)(ITSMFDecoder* decoder, UINT32 newVolume, UINT32 muted);
|
2012-06-13 23:45:58 +04:00
|
|
|
/* Check buffer level */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*BufferLevel)(ITSMFDecoder* decoder);
|
2014-05-23 15:48:02 +04:00
|
|
|
/* Register a callback for frame ack. */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*SetAckFunc)(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL), void* stream);
|
2014-05-23 15:48:02 +04:00
|
|
|
/* Register a callback for stream seek detection. */
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL (*SetSyncFunc)(ITSMFDecoder* decoder, void (*cb)(void*), void* stream);
|
2011-09-19 18:54:09 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define TSMF_DECODER_EXPORT_FUNC_NAME "TSMFDecoderEntry"
|
2019-11-06 17:24:51 +03:00
|
|
|
typedef ITSMFDecoder* (*TSMF_DECODER_ENTRY)(void);
|
2011-09-19 18:54:09 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
ITSMFDecoder* tsmf_load_decoder(const char* name, TS_AM_MEDIA_TYPE* media_type);
|
2015-07-08 00:39:29 +03:00
|
|
|
BOOL tsmf_check_decoder_available(const char* name);
|
2011-09-19 18:54:09 +04:00
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#endif /* FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H */
|