a2dp: improve a2dp sink codec data flushing

Let codec decides when rtp packet need to be sent (terminated by MTU size in most case).
LDAC encoding loop can now be terminated by reading if frame_num is written, no 'frame_count' updating is needed.
RTP payload fragmentation can now be implemented more easily based on this.
This commit is contained in:
Huang-Huang Bao 2021-03-31 17:50:15 +08:00 committed by Wim Taymans
parent 7b9792ffab
commit 5c93f780cf
6 changed files with 56 additions and 170 deletions

View file

@ -371,7 +371,6 @@ struct a2dp_codec {
int (*update_props) (void *data, void *props);
int (*get_block_size) (void *data);
int (*get_num_blocks) (void *data);
int (*abr_process) (void *data, size_t unsent);
@ -380,7 +379,7 @@ struct a2dp_codec {
int (*encode) (void *data,
const void *src, size_t src_size,
void *dst, size_t dst_size,
size_t *dst_out);
size_t *dst_out, int *need_flush);
int (*start_decode) (void *data,
const void *src, size_t src_size, uint16_t *seqnum, uint32_t *timestamp);