/*
This file is part of GNUnet.
- (C) 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @file conversation/gnunet-helper-audio-record.c
* OPUS_SIGNAL_VOICE - Bias thresholds towards choosing LPC or Hybrid modes.
* OPUS_SIGNAL_MUSIC - Bias thresholds towards choosing MDCT modes.
*/
-#define CONV_OPUS_SIGNAL OPUS_AUTO
+#define CONV_OPUS_SIGNAL OPUS_SIGNAL_VOICE
/**
* Coding mode.
size_t msg_size;
msg_size = sizeof (struct AudioMessage) + og->header_len + og->body_len;
audio_message->header.size = htons ((uint16_t) msg_size);
- memcpy (&audio_message[1], og->header, og->header_len);
- memcpy (((char *) &audio_message[1]) + og->header_len, og->body, og->body_len);
+ GNUNET_memcpy (&audio_message[1], og->header, og->header_len);
+ GNUNET_memcpy (((char *) &audio_message[1]) + og->header_len, og->body, og->body_len);
toff += msg_size;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
while (transmit_buffer_length >= transmit_buffer_index + pcm_length)
{
- memcpy (pcm_buffer,
+ GNUNET_memcpy (pcm_buffer,
&transmit_buffer[transmit_buffer_index],
pcm_length);
transmit_buffer_index += pcm_length;
const void *data;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Got %u/%u bytes of PCM data\n",
- length,
+ "Got %u/%d bytes of PCM data\n",
+ (unsigned int) length,
pcm_length);
GNUNET_assert (NULL != s);
{
transmit_buffer = pa_xrealloc (transmit_buffer,
transmit_buffer_length + length);
- memcpy (&transmit_buffer[transmit_buffer_length],
+ GNUNET_memcpy (&transmit_buffer[transmit_buffer_length],
data,
length);
transmit_buffer_length += length;
else
{
transmit_buffer = pa_xmalloc (length);
- memcpy (transmit_buffer, data, length);
+ GNUNET_memcpy (transmit_buffer, data, length);
transmit_buffer_length = length;
transmit_buffer_index = 0;
}
opus_encoder_ctl (enc,
OPUS_SET_INBAND_FEC (CONV_OPUS_INBAND_FEC));
opus_encoder_ctl (enc,
- OPUS_SET_SIGNAL (OPUS_SIGNAL_VOICE));
+ OPUS_SET_SIGNAL (CONV_OPUS_SIGNAL));
}
static void
const char *opusver;
int vendor_length;
- memcpy (headpacket.magic, "OpusHead", 8);
+ GNUNET_memcpy (headpacket.magic, "OpusHead", 8);
headpacket.version = 1;
headpacket.channels = CHANNELS;
headpacket.preskip = GNUNET_htole16 (0);
if (NULL == commentspacket)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to allocate %d bytes for second packet\n"),
- commentspacket_len);
+ _("Failed to allocate %u bytes for second packet\n"),
+ (unsigned int) commentspacket_len);
exit (5);
}
- memcpy (commentspacket->magic, "OpusTags", 8);
+ GNUNET_memcpy (commentspacket->magic, "OpusTags", 8);
commentspacket->vendor_length = GNUNET_htole32 (vendor_length);
- memcpy (&commentspacket[1], opusver, vendor_length);
+ GNUNET_memcpy (&commentspacket[1], opusver, vendor_length);
*(uint32_t *) &((char *) &commentspacket[1])[vendor_length] = \
GNUNET_htole32 (0); /* no tags */