diff options
author | Sanchayan Maity <sanchayan@asymptotic.io> | 2022-02-21 10:15:11 +0530 |
---|---|---|
committer | Sanchayan Maity <sanchayan@asymptotic.io> | 2022-02-21 12:15:47 +0530 |
commit | 516c691f69a5e7d8213ff941c12740a7088f85cf (patch) | |
tree | 6b46ab0ba1b02b8bb5c18ba342f8db299bf50b27 /src | |
parent | 9f0a18b290de3e93812fbb7666f6377acf1e96e7 (diff) | |
download | pulseaudio-516c691f69a5e7d8213ff941c12740a7088f85cf.tar.gz |
bluetooth: Rename rtp_sbc_payload to rtp_payload
Now that we use RTP payload structure for LDAC as well, rename
rtp_sbc_payload to rtp_payload. PipeWire also uses the same naming.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/689>
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/bluetooth/a2dp-codec-ldac-gst.c | 4 | ||||
-rw-r--r-- | src/modules/bluetooth/a2dp-codec-sbc.c | 12 | ||||
-rw-r--r-- | src/modules/bluetooth/rtp.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/bluetooth/a2dp-codec-ldac-gst.c b/src/modules/bluetooth/a2dp-codec-ldac-gst.c index 836ae37e9..a5e937aa9 100644 --- a/src/modules/bluetooth/a2dp-codec-ldac-gst.c +++ b/src/modules/bluetooth/a2dp-codec-ldac-gst.c @@ -403,7 +403,7 @@ static size_t reduce_encoder_bitrate(void *codec_info, size_t write_link_mtu) { static size_t encode_buffer(void *codec_info, uint32_t timestamp, const uint8_t *input_buffer, size_t input_size, uint8_t *output_buffer, size_t output_size, size_t *processed) { struct gst_info *info = (struct gst_info *) codec_info; struct rtp_header *header; - struct rtp_sbc_payload *payload; + struct rtp_payload *payload; size_t written; if (PA_UNLIKELY(output_size < sizeof(*header) + sizeof(*payload))) { @@ -423,7 +423,7 @@ static size_t encode_buffer(void *codec_info, uint32_t timestamp, const uint8_t header->sequence_number = htons(info->seq_num++); header->timestamp = htonl(timestamp); header->ssrc = htonl(1); - payload = (struct rtp_sbc_payload*) (output_buffer + sizeof(*header)); + payload = (struct rtp_payload*) (output_buffer + sizeof(*header)); payload->frame_count = get_ldac_num_frames(codec_info, info->codec_type); written += sizeof(*header) + sizeof(*payload); } diff --git a/src/modules/bluetooth/a2dp-codec-sbc.c b/src/modules/bluetooth/a2dp-codec-sbc.c index 5095a1b3c..d768075a0 100644 --- a/src/modules/bluetooth/a2dp-codec-sbc.c +++ b/src/modules/bluetooth/a2dp-codec-sbc.c @@ -704,7 +704,7 @@ static int reset(void *codec_info) { static size_t get_block_size(void *codec_info, size_t link_mtu) { struct sbc_info *sbc_info = (struct sbc_info *) codec_info; - size_t rtp_size = sizeof(struct rtp_header) + sizeof(struct rtp_sbc_payload); + size_t rtp_size = sizeof(struct rtp_header) + sizeof(struct rtp_payload); size_t frame_count = (link_mtu - rtp_size) / sbc_info->frame_length; /* frame_count is only 4 bit number */ @@ -716,7 +716,7 @@ static size_t get_block_size(void *codec_info, size_t link_mtu) { static size_t get_encoded_block_size(void *codec_info, size_t input_size) { struct sbc_info *sbc_info = (struct sbc_info *) codec_info; - size_t rtp_size = sizeof(struct rtp_header) + sizeof(struct rtp_sbc_payload); + size_t rtp_size = sizeof(struct rtp_header) + sizeof(struct rtp_payload); /* input size should be aligned to codec input block size */ pa_assert_fp(input_size % sbc_info->codesize == 0); @@ -753,14 +753,14 @@ static size_t increase_encoder_bitrate(void *codec_info, size_t write_link_mtu) static size_t encode_buffer(void *codec_info, uint32_t timestamp, const uint8_t *input_buffer, size_t input_size, uint8_t *output_buffer, size_t output_size, size_t *processed) { struct sbc_info *sbc_info = (struct sbc_info *) codec_info; struct rtp_header *header; - struct rtp_sbc_payload *payload; + struct rtp_payload *payload; uint8_t *d; const uint8_t *p; size_t to_write, to_encode; uint8_t frame_count; header = (struct rtp_header*) output_buffer; - payload = (struct rtp_sbc_payload*) (output_buffer + sizeof(*header)); + payload = (struct rtp_payload*) (output_buffer + sizeof(*header)); frame_count = 0; @@ -836,14 +836,14 @@ static size_t decode_buffer(void *codec_info, const uint8_t *input_buffer, size_ struct sbc_info *sbc_info = (struct sbc_info *) codec_info; struct rtp_header *header; - struct rtp_sbc_payload *payload; + struct rtp_payload *payload; const uint8_t *p; uint8_t *d; size_t to_write, to_decode; uint8_t frame_count; header = (struct rtp_header *) input_buffer; - payload = (struct rtp_sbc_payload*) (input_buffer + sizeof(*header)); + payload = (struct rtp_payload*) (input_buffer + sizeof(*header)); frame_count = payload->frame_count; diff --git a/src/modules/bluetooth/rtp.h b/src/modules/bluetooth/rtp.h index 813d9e390..d72c08526 100644 --- a/src/modules/bluetooth/rtp.h +++ b/src/modules/bluetooth/rtp.h @@ -41,7 +41,7 @@ struct rtp_header { uint32_t csrc[0]; } __attribute__ ((packed)); -struct rtp_sbc_payload { +struct rtp_payload { uint8_t frame_count:4; uint8_t rfa0:1; uint8_t is_last_fragment:1; @@ -67,7 +67,7 @@ struct rtp_header { uint32_t csrc[0]; } __attribute__ ((packed)); -struct rtp_sbc_payload { +struct rtp_payload { uint8_t is_fragmented:1; uint8_t is_first_fragment:1; uint8_t is_last_fragment:1; |