Commit Graph

9958 Commits

Author SHA1 Message Date
TreeHugger Robot
386e8ba090 Merge "media: polish EncoderProfiles" into sc-dev 2021-04-22 18:03:17 +00:00
Eric Laurent
d703642add Merge changes Iaa920c07,I4eb8046a into sc-dev
* changes:
  HwAudioSource: wrong native handle check
  AudioSystem: startAudioSource: ensure port handle initialized
2021-04-22 14:14:49 +00:00
Francois Gaffie
5253a31c7a HwAudioSource: wrong native handle check
Playing status of audio source is checked using the native handler
not 0.
However, if AudioSystem#startAudioSource fails, the native handler
returned is not 0, but an error code.
In fact AudioPolicyManager sets the PORT to NONE (0) and sets an error
status.
JNI layer transforms the failure status into a native handler returned
to the caller.

Bug: 186088557
Test: make

Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Iaa920c073885c2556a93a1b5ae23467fa6ffad4f
2021-04-22 11:24:52 +02:00
Lajos Molnar
4ef563a2a5 media: polish EncoderProfiles
Made inner classes private.
Added IntDef annotations (also to related CamcorderProfiles methods).
Deprecated CamcorderProfiles.get methods.

Bug: 184714224
Test: atest CamcorderProfileTest
Change-Id: Ibbacb7d3c5f3558f82c109bf36a64f6a3e369b31
2021-04-21 22:20:37 -07:00
Nate Myren
08635fe057 AudioManager: add API for mode listener
New API to add/remove a listener for changes to the audio
mode (see existing AudioManager.getMode() API).

Bug: 184891081
Test: atest android.media.cts.AudioModeListenerTest
Change-Id: I0be07d577c7497066b61a1573752343227605fd7
2021-04-21 20:19:46 -07:00
Andy Hung
7f4e3745ae Merge "Audio: Add ENCODING_DRA" into sc-dev 2021-04-21 22:08:43 +00:00
Eric Laurent
21d375cdb6 Merge "AudioRecord: Allow to share capture history." into sc-dev 2021-04-21 17:03:28 +00:00
Andy Hung
e1bfbd683b Merge "MediaFormat: Update constants for MPEG-H codecs" am: ca57ecee1b am: 3d46fe5294 am: f286036ab3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680925

Change-Id: I68b1d8518691cb7858a29de7675384d3792e1b1a
2021-04-21 16:15:34 +00:00
Andy Hung
f286036ab3 Merge "MediaFormat: Update constants for MPEG-H codecs" am: ca57ecee1b am: 3d46fe5294
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680925

Change-Id: Ia10684622673a6a9875aebc85667be794a958d0a
2021-04-21 16:01:31 +00:00
Andy Hung
ca57ecee1b Merge "MediaFormat: Update constants for MPEG-H codecs" 2021-04-21 15:21:01 +00:00
Eric Laurent
c670e06157 AudioRecord: Allow to share capture history.
Add the possibility for privileged applications to
share part of their audio capture history with another app.

A privileged app with permission CAPTURE_AUDIO_HOTWORD can share part of
its recent capture history on a given AudioRecord with the following
steps:
1) Specify the maximum time in the past that will be available for other
apps by calling setMaxSharedAudioHistoryMillis() on the AudioRecord.Builder
when creating the AudioRecord
2) Start recording and determine where the other app should start
capturing in the past.
3) Call AudioRecord.shareAudioHistory() with the package name of the app the history
will be shared with and the intended start time for this app's capture relative to
this AudioRecord's start time.
4) Communicate the MediaSyncEvent returned by shareAudioHistory() to the other app
5) The other app will use the MediaSyncEvent when creating its AudioRecord by calling
setSharedAudioEvent() on the AudioRecord.Builder.
6) Only after the other app has started capturing can this app stop capturing and
release its AudioRecord.

Bug: 183705547
Test: regression on capture use cases

Change-Id: I5beba6c1e489148a14ba86165b8ef2fdc78c802a
2021-04-21 12:00:00 +02:00
Andy Hung
fb082f6463 Audio: Add ENCODING_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
2021-04-20 19:12:59 -07:00
Kyunglyul Hyun
05df0a936c Merge "Revert^2 "Change PlaybackState#isActiveState to isActive"" into sc-dev 2021-04-21 01:56:15 +00:00
Hyundo Moon
013cf241a1 Merge changes from topic "system_mr2_media_content_control" into sc-dev
* changes:
  System MediaRouter2: Resolve API review
  Change MODIFY_AUDIO_ROUTING permission to MEDIA_CONTENT_CONTROL
2021-04-21 01:45:42 +00:00
Andy Hung
05be3db5ae Merge changes from topics "360RA channel mask", "audio channels" am: b1060eb9f5 am: d6c0a357ab am: c1b0ca6a32
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669510

Change-Id: I94aa095ed5ba59acac76a59a46acca90dd383359
2021-04-21 01:28:31 +00:00
Andy Hung
c1b0ca6a32 Merge changes from topics "360RA channel mask", "audio channels" am: b1060eb9f5 am: d6c0a357ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669510

Change-Id: I2fbce01d6817edb9ea41284f38fe2fa09d5eea79
2021-04-21 01:03:54 +00:00
Andy Hung
985bfbcc1d MediaFormat: Update constants for MPEG-H codecs
Bug: 185842397
Test: atest MediaFormatTest
Change-Id: I1f287ec9a1852a3c88ce3b3b22e8fb52add4f81c
2021-04-20 14:38:51 -07:00
Kei Murayama
209bf897de AudioFormat: Support 13ch audio layout for 360 Reality Audio
- Add definitions for the front bottom channels. The name
   of the definitions are standardized in ITU-R BS.2051-1.
 - Add definition for 13ch mask which consists of surround 5
   channels, top 5 channels and bottom 3ch channels. This
   channel mask is ideal speaker layout used by Sony 360
   Reality Audio. Virtualizer can place individual sounds in
   a 360 spherical sound field from these channels on any
   headphones.

Ignoring checkstyle warning, "'|' should be on a new line",
to keep existing codestyle.

Bug: 185100731
Test: atest AudioFormatTest
Test: Play wav with 13ch mask after OUT_CHANNEL_COUNT_MAX to 24
Change-Id: I2b4deaac740a08ae3b1b8d8453650a876e2d6206
2021-04-20 14:16:21 -07:00
Andy Hung
8008740a46 AudioFormat: Add channel mask constants for immersive 3D audio
Bug: 185842397
Test: atest AudioFormatTest
Test: atest AudioTrackTest
Change-Id: I1c85e30c65cf6681928861e7d0cc9d987e4648ce
2021-04-20 14:16:06 -07:00
Shubang Lu
c505cc19a2 Merge "TIF: Change the isForeground API to isVisible and isMainSession" into sc-dev 2021-04-20 20:19:42 +00:00
Hyundo Moon
057b4b8d46 System MediaRouter2: Resolve API review
This CL resolves API reviews on system APIs on MediaRouter2.

1) It checks permission when registering the MediaRoute2Manager
   in system server. Therefore, app cannot bypass the permission
   checks via reflection.
   The system api calls will be no-op without permission.

2) It adds @RequiresPermission annotations to related APIs.

Also, this CL changes the required permission
from MODIFY_AUDIO_ROUTING to MEDIA_CONTENT_CONTROL,
as the media routing can be applied to video, not only to audio.

Note that MediaRouter2#getInstance(Context, String)
does not throw SecurityException anymore.

Bug: 183428114
Test: atest android.media.cts.MediaRouter2Test
      atest android.media.cts.SystemMediaRouterTest
      (MediaRouter2ManagerTest is already broken, and
       that will be handled out of this CL.)
Change-Id: I55013a5b4b954ca1c8e2adb586f49f01103563db
2021-04-21 02:15:21 +09:00
Gyumin Sim
2ae2b96c61 Merge "Fix ParcelableListBinder to send empty list" into sc-dev 2021-04-20 06:01:49 +00:00
shubang
e8c3a42409 TIF: Change the isForeground API to isVisible and isMainSession
isForeground is not a good approach to indentify current channel info

And add a permission for tuned info.

Bug: 180482268
Test: atest CtsPermission2TestCases
Test: atest TvInputManagerTest#testGetCurrentTunedInfos
Change-Id: Ib1c1f2da719336ae856684e843b06f8b9b442723
2021-04-20 05:49:14 +00:00
Shubang Lu
bc6f53f0bc Merge "Media metrics APIs: changes based on API review" into sc-dev 2021-04-20 00:07:03 +00:00
Gyumin Sim
3586e3e0d4 Fix ParcelableListBinder to send empty list
Bug: 185058759
Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest
Change-Id: I9a846472d74be52e186d9e7bd5def7edbc50ad56
2021-04-20 00:27:59 +09:00
shubang
ccb090feaf Media metrics APIs: changes based on API review
1. Added the IntDef annotation for PlaybackStateEvent#getState
2. Made event construtors private go/android-api-guidelines#parcelable-creator.
3. Improved the JavaDoc of time-related methods
4. Added the JavaDoc for TrackChangeEvent#getTrackType
5. Made MediaMetricsManager final

Fix: 183940704
Fix: 185121406

Test: atest android.media.metrics.cts
Change-Id: I9f1edc23b4e78e3ebee358945ce16539b83e1830
2021-04-19 00:16:04 -07:00
Kyunglyul Hyun
b4e519caf4 Revert^2 "Change PlaybackState#isActiveState to isActive"
This reverts d077dbf438
because the issue was resolved.

Bug: 161331016
Test: m lint-check
Change-Id: Ic4a2025407caeb6d41db3b84a293dc249f77ad0b
2021-04-19 07:11:57 +00:00
jiabin
543858416a Support 8 channel IEC61937.
There is no longer a requirement for IEC61937 streams to be stereo.
For high bit-rate streams they may have 8 channels.

Test: create AudioTrack with 8 channel IEC61937
Bug: 31916412
Change-Id: I4dfd3e78041a81601d5bde47a4deaa0313066028
2021-04-16 21:58:52 +00:00
Orion Hodson
56b6ff07c3 Merge "Revert "Change PlaybackState#isActiveState to isActive"" into sc-dev 2021-04-15 15:07:24 +00:00
Kriti Dang
fd85a0c762 Merge "Removing permission requirements from surround sound setting getter APIs" into sc-dev 2021-04-15 10:52:17 +00:00
Robert Shih
054d15cd3d Merge "MediaDrm#requiresSecureDecoder: Clarify mime type handling and result" into sc-dev 2021-04-14 17:26:40 +00:00
Sahana Rao
d077dbf438 Revert "Change PlaybackState#isActiveState to isActive"
Revert "Change PlaybackState#isActiveState to isActive"

Revert submission 14124578-playbackstate_isactive

Reason for revert: b/185343312
Reverted Changes:
I4757038d6:Change PlaybackState#isActiveState to isActive
If7753e8e9:Change PlaybackState#isActiveState to isActive

Change-Id: I7c890c65ecb955860d31db6c926ad2d6ded514dc
2021-04-14 12:14:49 +00:00
Kyunglyul Hyun
90e33e72cb Merge "Change PlaybackState#isActiveState to isActive" into sc-dev 2021-04-14 03:18:06 +00:00
Kriti Dang
b7fe6a9a6f Removing permission requirements from surround sound setting getter APIs
Bug: 184044815
Test: atest AudioManagerTest
Change-Id: I86cc248b05a80bdb3ab0bee96a9ef57b9e633f2c
2021-04-13 11:21:55 +02:00
Wonsik Kim
369a920b58 Merge "MediaCodec: minor revision of APIs for vendor parameters" am: 5d41bf1b65 am: 69814e45a1 am: 50f0fc71e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673760

Change-Id: I7050200724896046e042c310f6e5f3e6431759bb
2021-04-13 04:54:57 +00:00
Wonsik Kim
50f0fc71e3 Merge "MediaCodec: minor revision of APIs for vendor parameters" am: 5d41bf1b65 am: 69814e45a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673760

Change-Id: Ic35494916ed8795a5809349f422482cb8aae00f3
2021-04-13 04:05:31 +00:00
Andy Hung
e81308eec6 Merge "audio: add device constants for HDMI EARC" into sc-dev 2021-04-13 00:01:49 +00:00
Wonsik Kim
66ee5e4b75 MediaCodec: minor revision of APIs for vendor parameters
- add hashCode() and equals() to ParameterDescriptor
- clarify documentation for subscribe/unsubscribe APIs

Bug: 184537653
Test: atest CtsMediaTestCases:MediaCodecTest
Change-Id: Ie98d2d29eccd94f26ecf6763ae47cee942fc08f8
2021-04-12 14:46:30 -07:00
Bhalchandra Gajare
65cadbe09f Merge "AudioAttributes: update setHotwordMode to setHotwordModeEnabled" into sc-dev 2021-04-09 19:30:52 +00:00
yuanjiahsu
00eb217258 UID mixing rule support both RECORDERS and PLAYERS mix type
Export API in AudioMixingRule#Builder to allow application specify the mix type when using UID mixing rule.

Bug: 169964607
Test: atest com.google.android.gts.audio.AudioHostTest, manual testing
Change-Id: Icf7c83f280aeec7b11aa3bc43fb31657c863e7fd
2021-04-10 00:29:29 +08:00
Kuowei Li
f898eaea10 audio: add device constants for HDMI EARC
Currently hidden.
Implementation check by grep -E -r  "HDMI_ARC|HDMI_EARC" .

Test: AudioDeviceInfoTest
Bug: 131385398
Bug: 151781316
Change-Id: I3af7e92580fb05f0723d905901b7b10759c16710
2021-04-09 09:21:53 -07:00
Christian Frank
5977b719c4 Merge "Update javadoc as instructed in b/184654824." into sc-dev 2021-04-09 14:04:54 +00:00
Kriti Dang
7e6abece7d Merge "Adding unknown constant to AudioManager ENCODED_SURROUND_OUTPUT mode constants" into sc-dev 2021-04-09 12:51:31 +00:00
Bhalchandra Gajare
ab5fedc682 AudioAttributes: update setHotwordMode to setHotwordModeEnabled
Update setHotwordMode to setHotwordModeEnabled and set/clear the hotword
mode based on the boolean flag passed to setHotwordModeEnabled. This is
to meet the API requirements. Also update the references to this API.

BUG: 180419637
Test: Able to setHotwordModeEnabled from AGSA application. Confirmed
HAL receives the flag and audioSource correctly in open_input_stream.

Change-Id: Ia01e8b5f3edaeafc9617846efc247635005456a8
2021-04-09 02:29:42 -07:00
Kyunglyul Hyun
4879480b99 Change PlaybackState#isActiveState to isActive
Rename PlaybackState#isActiveState() to #isActive()
and make it public.
This is according to API review.

This CL also includes STATE_SKIPPING_TO_QUEUE_ITEM
as an active playback state.

Bug: 184612506
Test: build successful && atest PlaybackStateTest

Change-Id: I4757038d63adc3478f19f177265ebd198fb5f424
2021-04-09 05:48:31 +00:00
Christian Frank
1ef586013e Update javadoc as instructed in b/184654824.
Bug: 184654824
Test: Javadoc

Change-Id: I6817f683f8945f26f8539645c8c92302f82e7348
(cherry picked from commit ee5a06f4ee)
2021-04-08 16:13:37 +00:00
Andy Hung
b20bc56206 Merge "Audio: Add ENCODING_DTS_UHD" into sc-dev 2021-04-08 15:49:53 +00:00
Kriti Dang
98fdb2616e Adding unknown constant to AudioManager ENCODED_SURROUND_OUTPUT mode constants
Bug: 184044740
Test: atest AudioManagerTest
Change-Id: I806df4aac6fbab5f32f66a7deac67ae8f71e3fdd
2021-04-08 15:01:55 +02:00
Robert Shih
b95a39d891 Merge "Respond to API Review comments on MediaDrm" into sc-dev 2021-04-06 21:17:47 +00:00
Andy Hung
e73976dba6 Audio: Add ENCODING_DTS_UHD
See ETSI TS 103 491 V1.2.1 (2019-05)
DTS-UHD Audio Format; Delivery of Channels,
Objects and Ambisonic Sound Fields

Test: atest AudioFormatTest
Bug: 184538197
Change-Id: I740a9ba041ad444ead5513fb3b632a78d391ab1c
2021-04-06 10:32:05 -07:00