a2dp/avdtp: mark capabilities as const

This commit is contained in:
Matthias Ringwald 2021-02-16 11:07:35 +01:00
parent 2cfd07fa7f
commit 3e6cf58192
10 changed files with 18 additions and 17 deletions

View File

@ -171,8 +171,8 @@ void a2dp_sink_deinit(void){
}
avdtp_stream_endpoint_t * a2dp_sink_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len){
const uint8_t *codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len){
avdtp_stream_endpoint_t * local_stream_endpoint = avdtp_sink_create_stream_endpoint(AVDTP_SINK, media_type);
if (!local_stream_endpoint){
return NULL;

View File

@ -81,9 +81,9 @@ void a2dp_sink_init(void);
*
* @return local_stream_endpoint
*/
avdtp_stream_endpoint_t * a2dp_sink_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len);
avdtp_stream_endpoint_t * a2dp_sink_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
const uint8_t *codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len);
/**
* @brief Unregister stream endpoint and free it's memory

View File

@ -690,8 +690,8 @@ void a2dp_source_deinit(void){
}
avdtp_stream_endpoint_t * a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len){
const uint8_t *codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len){
avdtp_stream_endpoint_t * stream_endpoint = avdtp_source_create_stream_endpoint(AVDTP_SOURCE, media_type);
if (!stream_endpoint){
return NULL;

View File

@ -81,9 +81,9 @@ void a2dp_source_init(void);
*
* @return local_stream_endpoint
*/
avdtp_stream_endpoint_t * a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len);
avdtp_stream_endpoint_t * a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
const uint8_t *codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len);
/**
* @brief Unregister stream endpoint and free it's memory

View File

@ -384,7 +384,7 @@ void avdtp_register_header_compression_category(avdtp_stream_endpoint_t * stream
stream_endpoint->sep.capabilities.header_compression.recovery = recovery;
}
void avdtp_register_media_codec_category(avdtp_stream_endpoint_t * stream_endpoint, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len){
void avdtp_register_media_codec_category(avdtp_stream_endpoint_t * stream_endpoint, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len){
if (!stream_endpoint){
log_error("Stream endpoint with given seid is not registered.");
return;
@ -393,7 +393,8 @@ void avdtp_register_media_codec_category(avdtp_stream_endpoint_t * stream_endpoi
stream_endpoint->sep.registered_service_categories = bitmap;
stream_endpoint->sep.capabilities.media_codec.media_type = media_type;
stream_endpoint->sep.capabilities.media_codec.media_codec_type = media_codec_type;
stream_endpoint->sep.capabilities.media_codec.media_codec_information = media_codec_info;
// @todo should be stored in struct as const
stream_endpoint->sep.capabilities.media_codec.media_codec_information = (uint8_t*) media_codec_info;
stream_endpoint->sep.capabilities.media_codec.media_codec_information_len = media_codec_info_len;
}

View File

@ -614,7 +614,7 @@ void avdtp_register_delay_reporting_category(avdtp_stream_endpoint_t * stream_en
void avdtp_register_recovery_category(avdtp_stream_endpoint_t * stream_endpoint, uint8_t maximum_recovery_window_size, uint8_t maximum_number_media_packets);
void avdtp_register_content_protection_category(avdtp_stream_endpoint_t * stream_endpoint, uint16_t cp_type, const uint8_t * cp_type_value, uint8_t cp_type_value_len);
void avdtp_register_header_compression_category(avdtp_stream_endpoint_t * stream_endpoint, uint8_t back_ch, uint8_t media, uint8_t recovery);
void avdtp_register_media_codec_category(avdtp_stream_endpoint_t * stream_endpoint, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len);
void avdtp_register_media_codec_category(avdtp_stream_endpoint_t * stream_endpoint, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len);
void avdtp_register_multiplexing_category(avdtp_stream_endpoint_t * stream_endpoint, uint8_t fragmentation);
// sink only

View File

@ -82,7 +82,7 @@ void avdtp_sink_register_header_compression_category(uint8_t seid, uint8_t back_
avdtp_register_header_compression_category(stream_endpoint, back_ch, media, recovery);
}
void avdtp_sink_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len){
void avdtp_sink_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len){
avdtp_stream_endpoint_t * stream_endpoint = avdtp_get_stream_endpoint_for_seid(seid);
avdtp_register_media_codec_category(stream_endpoint, media_type, media_codec_type, media_codec_info, media_codec_info_len);
}

View File

@ -77,7 +77,7 @@ void avdtp_sink_register_recovery_category(uint8_t seid, uint8_t maximum_recover
void avdtp_sink_register_header_compression_category(uint8_t seid, uint8_t back_ch, uint8_t media, uint8_t recovery);
void avdtp_sink_register_multiplexing_category(uint8_t seid, uint8_t fragmentation);
void avdtp_sink_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len);
void avdtp_sink_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len);
void avdtp_sink_register_content_protection_category(uint8_t seid, uint16_t cp_type, const uint8_t * cp_type_value, uint8_t cp_type_value_len);
/**

View File

@ -84,7 +84,7 @@ void avdtp_source_register_header_compression_category(uint8_t seid, uint8_t bac
avdtp_register_header_compression_category(stream_endpoint, back_ch, media, recovery);
}
void avdtp_source_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len){
void avdtp_source_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len){
avdtp_stream_endpoint_t * stream_endpoint = avdtp_get_stream_endpoint_for_seid(seid);
avdtp_register_media_codec_category(stream_endpoint, media_type, media_codec_type, media_codec_info, media_codec_info_len);
}

View File

@ -107,7 +107,7 @@ void avdtp_source_register_header_compression_category(uint8_t seid, uint8_t bac
* @param media_codec_info
* @param media_codec_info_len
*/
void avdtp_source_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, uint8_t * media_codec_info, uint16_t media_codec_info_len);
void avdtp_source_register_media_codec_category(uint8_t seid, avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type, const uint8_t *media_codec_info, uint16_t media_codec_info_len);
/**
* @brief Register multiplexing category with local stream endpoint identified by seid