FreeRDP
Loading...
Searching...
No Matches
tsmf_decoder.h
1
21#ifndef FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
22#define FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H
23
24#include "tsmf_types.h"
25
26typedef enum
27{
28 Control_Pause,
29 Control_Resume,
30 Control_Restart,
31 Control_Stop
32} ITSMFControlMsg;
33
34typedef struct s_ITSMFDecoder ITSMFDecoder;
35
37{
38 /* Set the decoder format. Return true if supported. */
39 WINPR_ATTR_NODISCARD BOOL (*SetFormat)(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type);
40 /* Decode a sample. */
41 WINPR_ATTR_NODISCARD BOOL (*Decode)(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size,
42 UINT32 extensions);
43 /* Get the decoded data */
44 WINPR_ATTR_NODISCARD BYTE* (*GetDecodedData)(ITSMFDecoder* decoder, UINT32* size);
45 /* Get the pixel format of decoded video frame */
46 WINPR_ATTR_NODISCARD UINT32 (*GetDecodedFormat)(ITSMFDecoder* decoder);
47 /* Get the width and height of decoded video frame */
48 WINPR_ATTR_NODISCARD BOOL (*GetDecodedDimension)(ITSMFDecoder* decoder, UINT32* width,
49 UINT32* height);
50 /* Free the decoder */
51 void (*Free)(ITSMFDecoder* decoder);
52 /* Optional Control function */
53 WINPR_ATTR_NODISCARD BOOL (*Control)(ITSMFDecoder* decoder, ITSMFControlMsg control_msg,
54 UINT32* arg);
55 /* Decode a sample with extended interface. */
56 WINPR_ATTR_NODISCARD BOOL (*DecodeEx)(ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size,
57 UINT32 extensions, UINT64 start_time, UINT64 end_time,
58 UINT64 duration);
59 /* Get current play time */
60 WINPR_ATTR_NODISCARD UINT64 (*GetRunningTime)(ITSMFDecoder* decoder);
61 /* Update Gstreamer Rendering Area */
62 WINPR_ATTR_NODISCARD BOOL (*UpdateRenderingArea)(ITSMFDecoder* decoder, UINT32 newX,
63 UINT32 newY, UINT32 newWidth, UINT32 newHeight,
64 UINT32 numRectangles,
65 const RECTANGLE_32* rectangles);
66 /* Change Gstreamer Audio Volume */
67 WINPR_ATTR_NODISCARD BOOL (*ChangeVolume)(ITSMFDecoder* decoder, UINT32 newVolume,
68 UINT32 muted);
69 /* Check buffer level */
70 WINPR_ATTR_NODISCARD BOOL (*BufferLevel)(ITSMFDecoder* decoder);
71 /* Register a callback for frame ack. */
72 WINPR_ATTR_NODISCARD BOOL (*SetAckFunc)(ITSMFDecoder* decoder, BOOL (*cb)(void*, BOOL),
73 void* stream);
74 /* Register a callback for stream seek detection. */
75 WINPR_ATTR_NODISCARD BOOL (*SetSyncFunc)(ITSMFDecoder* decoder, void (*cb)(void*),
76 void* stream);
77};
78
79#define TSMF_DECODER_EXPORT_FUNC_NAME "TSMFDecoderEntry"
80typedef UINT(VCAPITYPE* TSMF_DECODER_ENTRY)(ITSMFDecoder** decoder);
81
82WINPR_ATTR_NODISCARD FREERDP_LOCAL ITSMFDecoder* tsmf_load_decoder(const char* name,
83 TS_AM_MEDIA_TYPE* media_type);
84
85WINPR_ATTR_NODISCARD FREERDP_LOCAL BOOL tsmf_check_decoder_available(const char* name);
86
87#endif /* FREERDP_CHANNEL_TSMF_CLIENT_DECODER_H */