diff --git a/CHANGELOG.md b/CHANGELOG.md index a7dfdb804..5507364ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - esp32: add BTstack component config options via menuconfig - esp32: allow to disable default audio i2s driver via component config - esp32: support esp-idf v5.x audio driver + +## Removed +- AVDTP Source: avdtp_source_stream_send_media_payload, use avdtp_source_stream_send_media_payload_rtp instead ## Fixed - HCI: fix set extended scan response diff --git a/src/classic/avdtp_source.c b/src/classic/avdtp_source.c index bcf46647a..535403983 100644 --- a/src/classic/avdtp_source.c +++ b/src/classic/avdtp_source.c @@ -188,36 +188,6 @@ avdtp_source_setup_media_header(uint8_t *media_packet, uint8_t marker, uint16_t big_endian_store_32(media_packet, pos, ssrc); // only used for multicast } -// @deprecated, use avdtp_source_stream_send_media_payload_rtp instead -int avdtp_source_stream_send_media_payload(uint16_t avdtp_cid, uint8_t local_seid, const uint8_t * payload, uint16_t payload_size, uint8_t num_frames, uint8_t marker){ - UNUSED(avdtp_cid); - - avdtp_stream_endpoint_t * stream_endpoint = avdtp_get_stream_endpoint_for_seid(local_seid); - if (!stream_endpoint) { - log_error("avdtp source: no stream_endpoint with seid %d", local_seid); - return 0; - } - - if (stream_endpoint->l2cap_media_cid == 0){ - log_error("avdtp source: no media connection for seid %d", local_seid); - return 0; - } - - uint32_t buffer_size = l2cap_get_remote_mtu_for_local_cid(stream_endpoint->l2cap_media_cid); - uint32_t packet_size = AVDTP_MEDIA_PAYLOAD_HEADER_SIZE + payload_size + 1; - if (packet_size > buffer_size) return ERROR_CODE_MEMORY_CAPACITY_EXCEEDED; - - l2cap_reserve_packet_buffer(); - uint8_t * media_packet = l2cap_get_outgoing_buffer(); - uint32_t timestamp = btstack_run_loop_get_time_ms(); - avdtp_source_setup_media_header(media_packet, marker, stream_endpoint->sequence_number, timestamp); - media_packet[AVDTP_MEDIA_PAYLOAD_HEADER_SIZE] = num_frames; // (fragmentation << 7) | (starting_packet << 6) | (last_packet << 5) | num_frames; - (void)memcpy(&media_packet[AVDTP_MEDIA_PAYLOAD_HEADER_SIZE +1], payload, payload_size); - stream_endpoint->sequence_number++; - l2cap_send_prepared(stream_endpoint->l2cap_media_cid, (uint16_t) packet_size); - return packet_size; -} - uint8_t avdtp_source_stream_send_media_payload_rtp(uint16_t avdtp_cid, uint8_t local_seid, uint8_t marker, const uint8_t * payload, uint16_t payload_size){ UNUSED(avdtp_cid); diff --git a/src/classic/avdtp_source.h b/src/classic/avdtp_source.h index cdd52dc22..30688aa61 100644 --- a/src/classic/avdtp_source.h +++ b/src/classic/avdtp_source.h @@ -257,19 +257,6 @@ uint8_t avdtp_source_stream_send_media_packet(uint16_t avdtp_cid, uint8_t local_ */ uint8_t avdtp_source_stream_send_media_payload_rtp(uint16_t avdtp_cid, uint8_t local_seid, uint8_t marker, const uint8_t * payload, uint16_t size); -/** - * @brief Send media payload including RTP header and the SBC media header - * @deprecated Please use avdtp_source_stream_send_media_payload_rtp - * @param avdtp_cid AVDTP channel identifier. - * @param local_seid ID of a local stream endpoint. - * @param storage - * @param num_bytes_to_copy - * @param num_frames - * @param marker - * @return max_media_payload_size_without_media_header - */ -int avdtp_source_stream_send_media_payload(uint16_t avdtp_cid, uint8_t local_seid, const uint8_t * payload, uint16_t payload_size, uint8_t num_frames, uint8_t marker); - /** * @brief Request to send a media packet. Packet can be then sent on reception of AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW event. * @param avdtp_cid AVDTP channel identifier.