Skip to content
Snippets Groups Projects
Commit a00df11d authored by Omer Osman's avatar Omer Osman
Browse files

Add support for Opus over A2DP

This CL provides support for IETF RFC 2012-6716 Opus as a BT A2DP codec
for source or sink devices to the AOSP BT stack. During AVDTP handshake
for A2DP, codec capabilities are negotiated between the source and sink
devices, and the connection is established accordingly. The CL provides
support for Opus codec selection through Developer Options.

The Opus codec provides a highly optimized perceptual coding
implementation, with the following core features:

* Hybrid, Music (CELT) and Speech (SILK) modes
* Scalable Bitrate from 6 - 510 kbps
* Framesizes from 2.5 - 60ms
* Support for Packet Loss Concealment
* High efficiency coding with 3 byte frames to encode silence

The core function calls for the codec are:

opus_encode (OpusEncoder *st,
            const opus_int16 *pcm,
            int frame_size,
            unsigned char *data,
            opus_int32 max_data_bytes)

opus_decode (OpusDecoder *st,
            const unsigned char *data,
            opus_int32 len,
            opus_int16 *pcm,
            int frame_size,
            int decode_fec)

The majority of this CL implements the addition of the vendor codec in
the A2DP stack, interfacing of the audio through the A2DP HAL, and codec
capability negotiation over AVDTP.

Bug: 226441860
Test: atest net_test_stack:StackA2dpTest and bds-dev sink
Tag: #feature
Ignore-AOSP-First: TM QPR1 Feature
Change-Id: I05ecf07ab01f8045166b3d2da60fc2315c743cd2
parent 29d38ad3
Loading
Showing
with 2720 additions and 10 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment