Expose client rdpsnd get context function

This commit is contained in:
akallabeth 2022-06-23 09:17:10 +02:00 committed by akallabeth
parent f1d3d457fb
commit c698f7e7d9
2 changed files with 40 additions and 33 deletions

View File

@ -29,8 +29,6 @@
#define TAG CHANNELS_TAG("rdpsnd.client") #define TAG CHANNELS_TAG("rdpsnd.client")
FREERDP_API rdpContext* freerdp_rdpsnd_get_context(rdpsndPlugin* rdpsnd);
#if defined(WITH_DEBUG_SND) #if defined(WITH_DEBUG_SND)
#define DEBUG_SND(...) WLog_DBG(TAG, __VA_ARGS__) #define DEBUG_SND(...) WLog_DBG(TAG, __VA_ARGS__)
#else #else

View File

@ -22,39 +22,43 @@
#define FREERDP_CHANNEL_RDPSND_CLIENT_RDPSND_H #define FREERDP_CHANNEL_RDPSND_CLIENT_RDPSND_H
#include <freerdp/channels/rdpsnd.h> #include <freerdp/channels/rdpsnd.h>
#ifdef __cplusplus
/** extern "C"
* Subsystem Interface
*/
typedef struct rdpsnd_plugin rdpsndPlugin;
typedef struct rdpsnd_device_plugin rdpsndDevicePlugin;
typedef BOOL (*pcFormatSupported)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format);
typedef BOOL (*pcOpen)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency);
typedef UINT32 (*pcGetVolume)(rdpsndDevicePlugin* device);
typedef BOOL (*pcSetVolume)(rdpsndDevicePlugin* device, UINT32 value);
typedef UINT (*pcPlay)(rdpsndDevicePlugin* device, const BYTE* data, size_t size);
typedef void (*pcStart)(rdpsndDevicePlugin* device);
typedef void (*pcClose)(rdpsndDevicePlugin* device);
typedef void (*pcFree)(rdpsndDevicePlugin* device);
typedef BOOL (*pcDefaultFormat)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* desired,
AUDIO_FORMAT* defaultFormat);
struct rdpsnd_device_plugin
{ {
rdpsndPlugin* rdpsnd; #endif
pcFormatSupported FormatSupported; /**
pcOpen Open; * Subsystem Interface
pcGetVolume GetVolume; */
pcSetVolume SetVolume; typedef struct rdpsnd_plugin rdpsndPlugin;
pcPlay Play;
pcStart Start; /* Deprecated, unused. */ typedef struct rdpsnd_device_plugin rdpsndDevicePlugin;
pcClose Close;
pcFree Free; typedef BOOL (*pcFormatSupported)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format);
pcDefaultFormat DefaultFormat; typedef BOOL (*pcOpen)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* format, UINT32 latency);
}; typedef UINT32 (*pcGetVolume)(rdpsndDevicePlugin* device);
typedef BOOL (*pcSetVolume)(rdpsndDevicePlugin* device, UINT32 value);
typedef UINT (*pcPlay)(rdpsndDevicePlugin* device, const BYTE* data, size_t size);
typedef void (*pcStart)(rdpsndDevicePlugin* device);
typedef void (*pcClose)(rdpsndDevicePlugin* device);
typedef void (*pcFree)(rdpsndDevicePlugin* device);
typedef BOOL (*pcDefaultFormat)(rdpsndDevicePlugin* device, const AUDIO_FORMAT* desired,
AUDIO_FORMAT* defaultFormat);
struct rdpsnd_device_plugin
{
rdpsndPlugin* rdpsnd;
pcFormatSupported FormatSupported;
pcOpen Open;
pcGetVolume GetVolume;
pcSetVolume SetVolume;
pcPlay Play;
pcStart Start; /* Deprecated, unused. */
pcClose Close;
pcFree Free;
pcDefaultFormat DefaultFormat;
};
#define RDPSND_DEVICE_EXPORT_FUNC_NAME "freerdp_rdpsnd_client_subsystem_entry" #define RDPSND_DEVICE_EXPORT_FUNC_NAME "freerdp_rdpsnd_client_subsystem_entry"
@ -70,4 +74,9 @@ typedef FREERDP_RDPSND_DEVICE_ENTRY_POINTS* PFREERDP_RDPSND_DEVICE_ENTRY_POINTS;
typedef UINT (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); typedef UINT (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints);
FREERDP_API rdpContext* freerdp_rdpsnd_get_context(rdpsndPlugin* plugin);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_CHANNEL_RDPSND_CLIENT_RDPSND_H */ #endif /* FREERDP_CHANNEL_RDPSND_CLIENT_RDPSND_H */