FreeRDP
server/rdpsnd_main.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/log.h>
#include "rdpsnd_common.h"
#include "rdpsnd_main.h"

Functions

static wStreamrdpsnd_server_get_buffer (RdpsndServerContext *context)
 
static UINT rdpsnd_server_send_formats (RdpsndServerContext *context)
 
static UINT rdpsnd_server_recv_waveconfirm (RdpsndServerContext *context, wStream *s)
 
static UINT rdpsnd_server_recv_trainingconfirm (RdpsndServerContext *context, wStream *s)
 
static UINT rdpsnd_server_recv_quality_mode (RdpsndServerContext *context, wStream *s)
 
static UINT rdpsnd_server_recv_formats (RdpsndServerContext *context, wStream *s)
 
static DWORD WINAPI rdpsnd_server_thread (LPVOID arg)
 
static UINT rdpsnd_server_initialize (RdpsndServerContext *context, BOOL ownThread)
 
static UINT rdpsnd_server_select_format (RdpsndServerContext *context, UINT16 client_format_index)
 
static UINT rdpsnd_server_training (RdpsndServerContext *context, UINT16 timestamp, UINT16 packsize, BYTE *data)
 
static BOOL rdpsnd_server_align_wave_pdu (wStream *s, UINT32 alignment)
 
static UINT rdpsnd_server_send_wave_pdu (RdpsndServerContext *context, UINT16 wTimestamp)
 
static UINT rdpsnd_server_send_wave2_pdu (RdpsndServerContext *context, UINT16 formatNo, const BYTE *data, size_t size, BOOL encoded, UINT16 timestamp, UINT32 audioTimeStamp)
 
static UINT rdpsnd_server_send_audio_pdu (RdpsndServerContext *context, UINT16 wTimestamp)
 
static UINT rdpsnd_server_send_samples (RdpsndServerContext *context, const void *buf, size_t nframes, UINT16 wTimestamp)
 
static UINT rdpsnd_server_send_samples2 (RdpsndServerContext *context, UINT16 formatNo, const void *buf, size_t size, UINT16 timestamp, UINT32 audioTimeStamp)
 
static UINT rdpsnd_server_set_volume (RdpsndServerContext *context, UINT16 left, UINT16 right)
 
static UINT rdpsnd_server_close (RdpsndServerContext *context)
 
static UINT rdpsnd_server_start (RdpsndServerContext *context)
 
static UINT rdpsnd_server_stop (RdpsndServerContext *context)
 
RdpsndServerContext * rdpsnd_server_context_new (HANDLE vcm)
 
void rdpsnd_server_context_reset (RdpsndServerContext *context)
 
void rdpsnd_server_context_free (RdpsndServerContext *context)
 
HANDLE rdpsnd_server_get_event_handle (RdpsndServerContext *context)
 
UINT rdpsnd_server_handle_messages (RdpsndServerContext *context)
 

Function Documentation

◆ rdpsnd_server_align_wave_pdu()

static BOOL rdpsnd_server_align_wave_pdu ( wStream s,
UINT32  alignment 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_close()

static UINT rdpsnd_server_close ( RdpsndServerContext *  context)
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:

◆ rdpsnd_server_context_free()

void rdpsnd_server_context_free ( RdpsndServerContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_context_new()

RdpsndServerContext* rdpsnd_server_context_new ( HANDLE  vcm)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_context_reset()

void rdpsnd_server_context_reset ( RdpsndServerContext *  context)
Here is the call graph for this function:

◆ rdpsnd_server_get_buffer()

static wStream* rdpsnd_server_get_buffer ( RdpsndServerContext *  context)
static

FreeRDP: A Remote Desktop Protocol Implementation Server Audio Virtual Channel

Copyright 2012 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

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_get_event_handle()

HANDLE rdpsnd_server_get_event_handle ( RdpsndServerContext *  context)

◆ rdpsnd_server_handle_messages()

UINT rdpsnd_server_handle_messages ( RdpsndServerContext *  context)

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:

◆ rdpsnd_server_initialize()

static UINT rdpsnd_server_initialize ( RdpsndServerContext *  context,
BOOL  ownThread 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the caller graph for this function:

◆ rdpsnd_server_recv_formats()

static UINT rdpsnd_server_recv_formats ( RdpsndServerContext *  context,
wStream s 
)
static

Read Client Audio Formats and Version PDU (2.2.2.2)

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:

◆ rdpsnd_server_recv_quality_mode()

static UINT rdpsnd_server_recv_quality_mode ( RdpsndServerContext *  context,
wStream s 
)
static

Read Quality Mode PDU (2.2.2.3)

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:

◆ rdpsnd_server_recv_trainingconfirm()

static UINT rdpsnd_server_recv_trainingconfirm ( RdpsndServerContext *  context,
wStream s 
)
static

Read Training Confirm PDU (2.2.3.2) and handle callback

Returns
0 on success, otherwise a Win32 error code
Here is the caller graph for this function:

◆ rdpsnd_server_recv_waveconfirm()

static UINT rdpsnd_server_recv_waveconfirm ( RdpsndServerContext *  context,
wStream s 
)
static

Read Wave Confirm PDU (2.2.3.8) and handle callback

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:

◆ rdpsnd_server_select_format()

static UINT rdpsnd_server_select_format ( RdpsndServerContext *  context,
UINT16  client_format_index 
)
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:

◆ rdpsnd_server_send_audio_pdu()

static UINT rdpsnd_server_send_audio_pdu ( RdpsndServerContext *  context,
UINT16  wTimestamp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_send_formats()

static UINT rdpsnd_server_send_formats ( RdpsndServerContext *  context)
static

Send Server Audio Formats and Version PDU (2.2.2.1)

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:

◆ rdpsnd_server_send_samples()

static UINT rdpsnd_server_send_samples ( RdpsndServerContext *  context,
const void *  buf,
size_t  nframes,
UINT16  wTimestamp 
)
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:

◆ rdpsnd_server_send_samples2()

static UINT rdpsnd_server_send_samples2 ( RdpsndServerContext *  context,
UINT16  formatNo,
const void *  buf,
size_t  size,
UINT16  timestamp,
UINT32  audioTimeStamp 
)
static

Send encoded audio samples using a Wave2 PDU.

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:

◆ rdpsnd_server_send_wave2_pdu()

static UINT rdpsnd_server_send_wave2_pdu ( RdpsndServerContext *  context,
UINT16  formatNo,
const BYTE data,
size_t  size,
BOOL  encoded,
UINT16  timestamp,
UINT32  audioTimeStamp 
)
static

Function description context->priv->lock should be obtained before calling this function

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:

◆ rdpsnd_server_send_wave_pdu()

static UINT rdpsnd_server_send_wave_pdu ( RdpsndServerContext *  context,
UINT16  wTimestamp 
)
static

Function description context->priv->lock should be obtained before calling this function

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:

◆ rdpsnd_server_set_volume()

static UINT rdpsnd_server_set_volume ( RdpsndServerContext *  context,
UINT16  left,
UINT16  right 
)
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:

◆ rdpsnd_server_start()

static UINT rdpsnd_server_start ( RdpsndServerContext *  context)
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:

◆ rdpsnd_server_stop()

static UINT rdpsnd_server_stop ( RdpsndServerContext *  context)
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:

◆ rdpsnd_server_thread()

static DWORD WINAPI rdpsnd_server_thread ( LPVOID  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpsnd_server_training()

static UINT rdpsnd_server_training ( RdpsndServerContext *  context,
UINT16  timestamp,
UINT16  packsize,
BYTE data 
)
static

Send Training PDU (2.2.3.1)

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: