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