mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
avdtp_source, a2dp_source: allow to send media packets without RTP header
This commit is contained in:
parent
ec9b5b0fdc
commit
5695c5cc37
@ -805,6 +805,10 @@ int a2dp_source_stream_send_media_payload(uint16_t avdtp_cid, uint8_t local_seid
|
||||
return avdtp_source_stream_send_media_payload(avdtp_cid, local_seid, storage, num_bytes_to_copy, num_frames, marker);
|
||||
}
|
||||
|
||||
uint8_t a2dp_source_stream_send_media_packet(uint16_t a2dp_cid, uint8_t local_seid, const uint8_t * packet, uint16_t size){
|
||||
return avdtp_source_stream_send_media_packet(a2dp_cid, local_seid, packet, size);
|
||||
}
|
||||
|
||||
static void avdtp_config_sbc_store(uint8_t * config, uint16_t sampling_frequency, avdtp_sbc_channel_mode_t channel_mode, uint8_t block_length, uint8_t subbands,
|
||||
avdtp_sbc_allocation_method_t allocation_method, uint8_t min_bitpool_value, uint8_t max_bitpool_value) {
|
||||
config[0] = (sampling_frequency << 4) | channel_mode;
|
||||
|
@ -174,6 +174,16 @@ int a2dp_max_media_payload_size(uint16_t a2dp_cid, uint8_t local_seid);
|
||||
*/
|
||||
int a2dp_source_stream_send_media_payload(uint16_t a2dp_cid, uint8_t local_seid, uint8_t * storage, int num_bytes_to_copy, uint8_t num_frames, uint8_t marker);
|
||||
|
||||
/**
|
||||
* @brief Send media packet
|
||||
* @param a2dp_cid A2DP channel identifyer.
|
||||
* @param local_seid ID of a local stream endpoint.
|
||||
* @param packet
|
||||
* @param size
|
||||
* @return status
|
||||
*/
|
||||
uint8_t a2dp_source_stream_send_media_packet(uint16_t a2dp_cid, uint8_t local_seid, const uint8_t * packet, uint16_t size);
|
||||
|
||||
/**
|
||||
* @brief Select and configure SBC endpoint
|
||||
* @param a2dp_cid A2DP channel identifier.
|
||||
|
@ -235,6 +235,24 @@ int avdtp_source_stream_send_media_payload(uint16_t avdtp_cid, uint8_t local_sei
|
||||
return size;
|
||||
}
|
||||
|
||||
uint8_t avdtp_source_stream_send_media_packet(uint16_t avdtp_cid, uint8_t local_seid, const uint8_t * packet, uint16_t size){
|
||||
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 ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
|
||||
if (stream_endpoint->l2cap_media_cid == 0){
|
||||
log_error("avdtp source: no media connection for seid %d", local_seid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
|
||||
return l2cap_send(stream_endpoint->l2cap_media_cid, (uint8_t*) packet, size);
|
||||
}
|
||||
|
||||
|
||||
void avdtp_source_stream_endpoint_request_can_send_now(uint16_t avdtp_cid, uint8_t local_seid){
|
||||
UNUSED(avdtp_cid);
|
||||
|
||||
|
@ -249,6 +249,16 @@ void avdtp_source_finalize_stream_endpoint(avdtp_stream_endpoint_t * stream_endp
|
||||
*/
|
||||
int avdtp_source_stream_send_media_payload(uint16_t avdtp_cid, uint8_t local_seid, uint8_t * storage, int num_bytes_to_copy, uint8_t num_frames, uint8_t marker);
|
||||
|
||||
/**
|
||||
* @brief Send media packet.
|
||||
* @param avdtp_cid AVDTP channel identifyer.
|
||||
* @param local_seid ID of a local stream endpoint.
|
||||
* @param packet
|
||||
* @param size
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avdtp_source_stream_send_media_packet(uint16_t avdtp_cid, uint8_t local_seid, const uint8_t * packet, uint16_t size);
|
||||
|
||||
/**
|
||||
* @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 identifyer.
|
||||
|
Loading…
x
Reference in New Issue
Block a user