mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-23 11:43:24 +00:00
Merge branch 'a2dp' of https://github.com/bluekitchen/btstack into a2dp
This commit is contained in:
commit
ce9654bbbd
@ -28,7 +28,7 @@ COMMON += \
|
|||||||
sdp_util.c \
|
sdp_util.c \
|
||||||
sdp_server.c \
|
sdp_server.c \
|
||||||
|
|
||||||
CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Werror
|
CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-variable -Wunused-parameter -Werror
|
||||||
CFLAGS += -I.
|
CFLAGS += -I.
|
||||||
CFLAGS += -I${BTSTACK_ROOT}/src
|
CFLAGS += -I${BTSTACK_ROOT}/src
|
||||||
CFLAGS += -I${BTSTACK_ROOT}/src/classic
|
CFLAGS += -I${BTSTACK_ROOT}/src/classic
|
||||||
|
@ -181,6 +181,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||||||
(void) timeInfo; /* Prevent unused variable warnings. */
|
(void) timeInfo; /* Prevent unused variable warnings. */
|
||||||
(void) statusFlags;
|
(void) statusFlags;
|
||||||
(void) inputBuffer;
|
(void) inputBuffer;
|
||||||
|
(void) userData;
|
||||||
|
|
||||||
int bytes_to_copy = framesPerBuffer * BYTES_PER_FRAME;
|
int bytes_to_copy = framesPerBuffer * BYTES_PER_FRAME;
|
||||||
|
|
||||||
@ -213,9 +214,15 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||||||
|
|
||||||
#ifdef DECODE_SBC
|
#ifdef DECODE_SBC
|
||||||
static void handle_pcm_data(int16_t * data, int num_samples, int num_channels, int sample_rate, void * context){
|
static void handle_pcm_data(int16_t * data, int num_samples, int num_channels, int sample_rate, void * context){
|
||||||
|
UNUSED(sample_rate);
|
||||||
|
UNUSED(context);
|
||||||
|
|
||||||
|
#ifdef STORE_SBC_TO_WAV_FILE
|
||||||
wav_writer_write_int16(num_samples*num_channels, data);
|
wav_writer_write_int16(num_samples*num_channels, data);
|
||||||
total_num_samples+=num_samples*num_channels;
|
|
||||||
frame_count++;
|
frame_count++;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
total_num_samples+=num_samples*num_channels;
|
||||||
|
|
||||||
#ifdef HAVE_PORTAUDIO
|
#ifdef HAVE_PORTAUDIO
|
||||||
if (!pa_stream_started){
|
if (!pa_stream_started){
|
||||||
@ -326,6 +333,9 @@ static void close_media_processing(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void handle_l2cap_media_data_packet(avdtp_stream_endpoint_t * stream_endpoint, uint8_t *packet, uint16_t size){
|
static void handle_l2cap_media_data_packet(avdtp_stream_endpoint_t * stream_endpoint, uint8_t *packet, uint16_t size){
|
||||||
|
|
||||||
|
UNUSED(stream_endpoint);
|
||||||
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
avdtp_media_packet_header_t media_header;
|
avdtp_media_packet_header_t media_header;
|
||||||
@ -405,6 +415,10 @@ static void dump_sbc_configuration(avdtp_media_codec_configuration_sbc_t configu
|
|||||||
|
|
||||||
|
|
||||||
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||||
|
|
||||||
|
UNUSED(channel);
|
||||||
|
UNUSED(size);
|
||||||
|
|
||||||
bd_addr_t event_addr;
|
bd_addr_t event_addr;
|
||||||
switch (packet_type) {
|
switch (packet_type) {
|
||||||
|
|
||||||
@ -595,6 +609,9 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac
|
|||||||
int btstack_main(int argc, const char * argv[]);
|
int btstack_main(int argc, const char * argv[]);
|
||||||
int btstack_main(int argc, const char * argv[]){
|
int btstack_main(int argc, const char * argv[]){
|
||||||
|
|
||||||
|
UNUSED(argc);
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
/* Register for HCI events */
|
/* Register for HCI events */
|
||||||
hci_event_callback_registration.callback = &packet_handler;
|
hci_event_callback_registration.callback = &packet_handler;
|
||||||
hci_add_event_handler(&hci_event_callback_registration);
|
hci_add_event_handler(&hci_event_callback_registration);
|
||||||
|
@ -98,6 +98,8 @@ int avdtp_read_signaling_header(avdtp_signaling_packet_t * signaling_header, uin
|
|||||||
}
|
}
|
||||||
|
|
||||||
int avdtp_pack_service_capabilities(uint8_t * buffer, int size, avdtp_capabilities_t caps, avdtp_service_category_t category, uint8_t pack_all_capabilities){
|
int avdtp_pack_service_capabilities(uint8_t * buffer, int size, avdtp_capabilities_t caps, avdtp_service_category_t category, uint8_t pack_all_capabilities){
|
||||||
|
UNUSED(size);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
// pos = 0 reserved for length
|
// pos = 0 reserved for length
|
||||||
int pos = 1;
|
int pos = 1;
|
||||||
|
@ -70,6 +70,7 @@ static int total_num_samples = 0;
|
|||||||
static char * wav_filename = "portaudio_sine.wav";
|
static char * wav_filename = "portaudio_sine.wav";
|
||||||
|
|
||||||
static void write_wav_data(int16_t * data, int num_frames, int num_channels, int sample_rate){
|
static void write_wav_data(int16_t * data, int num_frames, int num_channels, int sample_rate){
|
||||||
|
(void)sample_rate;
|
||||||
wav_writer_write_int16(num_frames*num_channels, data);
|
wav_writer_write_int16(num_frames*num_channels, data);
|
||||||
total_num_samples+=num_frames*num_channels;
|
total_num_samples+=num_frames*num_channels;
|
||||||
if (total_num_samples>5*SAMPLE_RATE) wav_writer_close();
|
if (total_num_samples>5*SAMPLE_RATE) wav_writer_close();
|
||||||
@ -105,6 +106,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||||||
(void) timeInfo; /* Prevent unused variable warnings. */
|
(void) timeInfo; /* Prevent unused variable warnings. */
|
||||||
(void) statusFlags;
|
(void) statusFlags;
|
||||||
(void) inputBuffer;
|
(void) inputBuffer;
|
||||||
|
(void) userData;
|
||||||
|
|
||||||
uint32_t bytes_read = 0;
|
uint32_t bytes_read = 0;
|
||||||
int bytes_per_buffer = framesPerBuffer * BYTES_PER_FRAME;
|
int bytes_per_buffer = framesPerBuffer * BYTES_PER_FRAME;
|
||||||
@ -120,6 +122,9 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, const char * argv[]){
|
int main(int argc, const char * argv[]){
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
|
|
||||||
PaError err;
|
PaError err;
|
||||||
static paTestData data;
|
static paTestData data;
|
||||||
static PaStream * stream;
|
static PaStream * stream;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user