20 #include <freerdp/config.h>
26 #include <freerdp/addin.h>
27 #include <freerdp/client/channels.h>
29 #include "tsmf_types.h"
30 #include "tsmf_constants.h"
31 #include "tsmf_decoder.h"
33 static ITSMFDecoder* tsmf_load_decoder_by_name(
const char* name)
35 ITSMFDecoder* decoder = NULL;
38 PVIRTUALCHANNELENTRY pvce;
39 TSMF_DECODER_ENTRY entry;
41 cnv.pvce = freerdp_load_channel_addin_entry(
"tsmf", name,
"decoder", 0);
46 const UINT rc = cnv.entry(&decoder);
48 if ((rc != CHANNEL_RC_OK) || !decoder)
50 WLog_ERR(TAG,
"failed to call export function in %s", name);
57 static BOOL tsmf_decoder_set_format(ITSMFDecoder* decoder,
TS_AM_MEDIA_TYPE* media_type)
59 if (decoder->SetFormat(decoder, media_type))
65 ITSMFDecoder* tsmf_load_decoder(
const char* name,
TS_AM_MEDIA_TYPE* media_type)
67 ITSMFDecoder* decoder = NULL;
70 decoder = tsmf_load_decoder_by_name(name);
72 #if defined(WITH_GSTREAMER_1_0)
74 decoder = tsmf_load_decoder_by_name(
"gstreamer");
77 #if defined(WITH_VIDEO_FFMPEG)
79 decoder = tsmf_load_decoder_by_name(
"ffmpeg");
84 if (!tsmf_decoder_set_format(decoder, media_type))
86 decoder->Free(decoder);
94 BOOL tsmf_check_decoder_available(
const char* name)
96 ITSMFDecoder* decoder = NULL;
97 BOOL retValue = FALSE;
101 decoder = tsmf_load_decoder_by_name(name);
103 #if defined(WITH_GSTREAMER_1_0)
105 decoder = tsmf_load_decoder_by_name(
"gstreamer");
108 #if defined(WITH_VIDEO_FFMPEG)
110 decoder = tsmf_load_decoder_by_name(
"ffmpeg");
115 decoder->Free(decoder);