Commit c867861
authored
[AN-765] Support for runtime Audio Usage Switching for HiFi Audio Playback (#63)
* Exposed method in JavaaudioDeviceModule to switch between Stereo and Mono playout
* Removed call to native layer to get the bufbufferSizeFactor. Use default of bufferSizeFactor = 1.0 while switching b/w mono and stereo
* Make setChannelConfigurationAndUsage thread safe by calling a thread safe method initPlayoutThreadSafe which does not have any thread checking logic
* Make setChannelConfigurationAndUsage thread safe by calling a thread safe method initPlayoutThreadSafe which does not have any thread checking logic
* If playout is currently active, it will be stopped and automatically restarted with the new configuration.
* Remove unnecessary check in WebRtcAudioTrack which was preventing audioAttribute to be updated.
* Refactored to change only the usage and contentType of AudioTrack Audio Attribute when it is changed from the app
* Avoids unnecessary work when usage hasn't changed -no-op if usage is the same
* Removed un-necessary null checks and improved comments1 parent 9db66cf commit c867861
File tree
3 files changed
+118
-9
lines changed- sdk/android
- api/org/webrtc/audio
- src
- java/org/webrtc/audio
- jni/audio_device
3 files changed
+118
-9
lines changedLines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
455 | 472 | | |
456 | 473 | | |
457 | 474 | | |
| |||
Lines changed: 98 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
198 | 203 | | |
199 | 204 | | |
200 | 205 | | |
201 | | - | |
202 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
| |||
285 | 298 | | |
286 | 299 | | |
287 | 300 | | |
288 | | - | |
289 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
290 | 305 | | |
291 | 306 | | |
292 | 307 | | |
| |||
319 | 334 | | |
320 | 335 | | |
321 | 336 | | |
322 | | - | |
323 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
324 | 341 | | |
325 | 342 | | |
326 | 343 | | |
| |||
556 | 573 | | |
557 | 574 | | |
558 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
559 | 651 | | |
560 | 652 | | |
561 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
0 commit comments