FreeRDP
audin_main.c File Reference
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/cmdline.h>
#include <winpr/wlog.h>
#include <freerdp/addin.h>
#include <winpr/stream.h>
#include <freerdp/freerdp.h>
#include <freerdp/codec/dsp.h>
#include "audin_main.h"

Macros

#define MSG_SNDIN_VERSION   0x01
 
#define MSG_SNDIN_FORMATS   0x02
 
#define MSG_SNDIN_OPEN   0x03
 
#define MSG_SNDIN_OPEN_REPLY   0x04
 
#define MSG_SNDIN_DATA_INCOMING   0x05
 
#define MSG_SNDIN_DATA   0x06
 
#define MSG_SNDIN_FORMATCHANGE   0x07
 
#define DVCPluginEntry   FREERDP_API DVCPluginEntry
 

Functions

static BOOL audin_process_addin_args (AUDIN_PLUGIN *audin, ADDIN_ARGV *args)
 
static UINT audin_channel_write_and_free (AUDIN_CHANNEL_CALLBACK *callback, wStream *out, BOOL freeStream)
 
static UINT audin_process_version (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT audin_send_incoming_data_pdu (AUDIN_CHANNEL_CALLBACK *callback)
 
static UINT audin_process_formats (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT audin_send_format_change_pdu (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, UINT32 NewFormat)
 
static UINT audin_send_open_reply_pdu (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, UINT32 Result)
 
static UINT audin_receive_wave_data (const AUDIO_FORMAT *format, const BYTE *data, size_t size, void *user_data)
 
static BOOL audin_open_device (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback)
 
static UINT audin_process_open (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT audin_process_format_change (AUDIN_PLUGIN *audin, AUDIN_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT audin_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
 
static UINT audin_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT audin_on_new_channel_connection (IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT audin_plugin_initialize (IWTSPlugin *pPlugin, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT audin_plugin_terminated (IWTSPlugin *pPlugin)
 
static UINT audin_plugin_attached (IWTSPlugin *pPlugin)
 
static UINT audin_plugin_detached (IWTSPlugin *pPlugin)
 
static UINT audin_register_device_plugin (IWTSPlugin *pPlugin, IAudinDevice *device)
 
static UINT audin_load_device_plugin (AUDIN_PLUGIN *audin, char *name, ADDIN_ARGV *args)
 
static UINT audin_set_subsystem (AUDIN_PLUGIN *audin, const char *subsystem)
 
static UINT audin_set_device_name (AUDIN_PLUGIN *audin, const char *device_name)
 
UINT DVCPluginEntry (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 

Variables

static COMMAND_LINE_ARGUMENT_A audin_args []
 

Macro Definition Documentation

#define DVCPluginEntry   FREERDP_API DVCPluginEntry
#define MSG_SNDIN_DATA   0x06
#define MSG_SNDIN_DATA_INCOMING   0x05
#define MSG_SNDIN_FORMATCHANGE   0x07
#define MSG_SNDIN_FORMATS   0x02
#define MSG_SNDIN_OPEN   0x03
#define MSG_SNDIN_OPEN_REPLY   0x04
#define MSG_SNDIN_VERSION   0x01

FreeRDP: A Remote Desktop Protocol Implementation Audio Input Redirection Virtual Channel

Copyright 2010-2011 Vic Lee Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2015 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m

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.

Function Documentation

static UINT audin_channel_write_and_free ( AUDIN_CHANNEL_CALLBACK *  callback,
wStream *  out,
BOOL  freeStream 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_load_device_plugin ( AUDIN_PLUGIN *  audin,
char *  name,
ADDIN_ARGV *  args 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream *  data 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_on_new_channel_connection ( IWTSListenerCallback *  pListenerCallback,
IWTSVirtualChannel *  pChannel,
BYTE Data,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL audin_open_device ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_plugin_attached ( IWTSPlugin *  pPlugin)
static

Here is the caller graph for this function:

static UINT audin_plugin_detached ( IWTSPlugin *  pPlugin)
static

Here is the caller graph for this function:

static UINT audin_plugin_initialize ( IWTSPlugin *  pPlugin,
IWTSVirtualChannelManager *  pChannelMgr 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_plugin_terminated ( IWTSPlugin *  pPlugin)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL audin_process_addin_args ( AUDIN_PLUGIN *  audin,
ADDIN_ARGV *  args 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_process_format_change ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
wStream *  s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_process_formats ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
wStream *  s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_process_open ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
wStream *  s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_process_version ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
wStream *  s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_receive_wave_data ( const AUDIO_FORMAT format,
const BYTE data,
size_t  size,
void user_data 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_register_device_plugin ( IWTSPlugin *  pPlugin,
IAudinDevice *  device 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT audin_send_format_change_pdu ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
UINT32  NewFormat 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_send_incoming_data_pdu ( AUDIN_CHANNEL_CALLBACK *  callback)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT audin_send_open_reply_pdu ( AUDIN_PLUGIN *  audin,
AUDIN_CHANNEL_CALLBACK *  callback,
UINT32  Result 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_set_device_name ( AUDIN_PLUGIN *  audin,
const char *  device_name 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT audin_set_subsystem ( AUDIN_PLUGIN *  audin,
const char *  subsystem 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

UINT DVCPluginEntry ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Variable Documentation

COMMAND_LINE_ARGUMENT_A audin_args[]
static
Initial value:
=
{
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ "format", COMMAND_LINE_VALUE_REQUIRED, "<format>", NULL, NULL, -1, NULL, "format" },
{ "rate", COMMAND_LINE_VALUE_REQUIRED, "<rate>", NULL, NULL, -1, NULL, "rate" },
{ "channel", COMMAND_LINE_VALUE_REQUIRED, "<channel>", NULL, NULL, -1, NULL, "channel" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
}
#define COMMAND_LINE_VALUE_REQUIRED
Definition: winpr/include/winpr/cmdline.h:34
if availableBytes return NULL
Definition: TPCircularBuffer.h:104