Blame server/Mac/mf_audin.c

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * FreeRDP Mac OS X Server (Audio Input)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 * Copyright 2015 Thincast Technologies GmbH
Packit 1fb8d4
 * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifdef HAVE_CONFIG_H
Packit 1fb8d4
#include "config.h"
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#include "mfreerdp.h"
Packit 1fb8d4
Packit 1fb8d4
#include "mf_audin.h"
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/server/server-common.h>
Packit 1fb8d4
#include <freerdp/log.h>
Packit 1fb8d4
#define TAG SERVER_TAG("mac")
Packit 1fb8d4
Packit 1fb8d4
/**
Packit 1fb8d4
 * Function description
Packit 1fb8d4
 *
Packit 1fb8d4
 * @return 0 on success, otherwise a Win32 error code
Packit 1fb8d4
 */
Packit 1fb8d4
static UINT mf_peer_audin_opening(audin_server_context* context)
Packit 1fb8d4
{
Packit 1fb8d4
	context->SelectFormat(context, 0);
Packit 1fb8d4
	return CHANNEL_RC_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
/**
Packit 1fb8d4
 * Function description
Packit 1fb8d4
 *
Packit 1fb8d4
 * @return 0 on success, otherwise a Win32 error code
Packit 1fb8d4
 */
Packit 1fb8d4
static UINT mf_peer_audin_open_result(audin_server_context* context, UINT32 result)
Packit 1fb8d4
{
Packit 1fb8d4
	return CHANNEL_RC_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
/**
Packit 1fb8d4
 * Function description
Packit 1fb8d4
 *
Packit 1fb8d4
 * @return 0 on success, otherwise a Win32 error code
Packit 1fb8d4
 */
Packit 1fb8d4
static UINT mf_peer_audin_receive_samples(audin_server_context* context, const void* buf,
Packit 1fb8d4
        int nframes)
Packit 1fb8d4
{
Packit 1fb8d4
	return CHANNEL_RC_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
void mf_peer_audin_init(mfPeerContext* context)
Packit 1fb8d4
{
Packit 1fb8d4
	context->audin = audin_server_context_new(context->vcm);
Packit 1fb8d4
	context->audin->rdpcontext = &context->_p;
Packit 1fb8d4
	context->audin->data = context;
Packit 1fb8d4
	context->audin->num_server_formats = server_audin_get_formats(&context->audin->server_formats);
Packit 1fb8d4
	if (context->audin->num_server_formats > 0)
Packit 1fb8d4
		context->audin->dst_format = &context->audin->server_formats[0];
Packit 1fb8d4
	context->audin->Opening = mf_peer_audin_opening;
Packit 1fb8d4
	context->audin->OpenResult = mf_peer_audin_open_result;
Packit 1fb8d4
	context->audin->ReceiveSamples = mf_peer_audin_receive_samples;
Packit 1fb8d4
}