Add AUDIO_ENCAPSULATION_TYPE_PCM.
Bug: 239435816 Test: atest AudioManagerTest Change-Id: I31d02ac947adbd45a8a74ce0450218f6a94ff676
This commit is contained in:
@@ -20912,6 +20912,7 @@ package android.media {
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field public static final int AUDIO_ENCAPSULATION_TYPE_IEC61937 = 1; // 0x1
|
||||
field public static final int AUDIO_ENCAPSULATION_TYPE_NONE = 0; // 0x0
|
||||
field public static final int AUDIO_ENCAPSULATION_TYPE_PCM = 2; // 0x2
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.media.AudioProfile> CREATOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace android {
|
||||
// keep these values in sync with AudioProfile.java
|
||||
#define ENCAPSULATION_TYPE_NONE 0
|
||||
#define ENCAPSULATION_TYPE_IEC61937 1
|
||||
#define ENCAPSULATION_TYPE_PCM 2
|
||||
|
||||
static inline status_t audioEncapsulationTypeFromNative(
|
||||
audio_encapsulation_type_t nEncapsulationType, int* encapsulationType) {
|
||||
@@ -36,6 +37,9 @@ static inline status_t audioEncapsulationTypeFromNative(
|
||||
case AUDIO_ENCAPSULATION_TYPE_IEC61937:
|
||||
*encapsulationType = ENCAPSULATION_TYPE_IEC61937;
|
||||
break;
|
||||
case AUDIO_ENCAPSULATION_TYPE_PCM:
|
||||
*encapsulationType = ENCAPSULATION_TYPE_PCM;
|
||||
break;
|
||||
default:
|
||||
result = BAD_VALUE;
|
||||
}
|
||||
|
||||
@@ -46,11 +46,17 @@ public class AudioProfile implements Parcelable {
|
||||
* Encapsulation format is defined in standard IEC 61937.
|
||||
*/
|
||||
public static final int AUDIO_ENCAPSULATION_TYPE_IEC61937 = 1;
|
||||
/**
|
||||
* Encapsulation format is PCM, which can be used by other formats that can be wrapped in
|
||||
* a PCM frame, such as DSD(Direct Stream Digital).
|
||||
*/
|
||||
public static final int AUDIO_ENCAPSULATION_TYPE_PCM = 2;
|
||||
|
||||
/** @hide */
|
||||
@IntDef({
|
||||
AUDIO_ENCAPSULATION_TYPE_NONE,
|
||||
AUDIO_ENCAPSULATION_TYPE_IEC61937,
|
||||
AUDIO_ENCAPSULATION_TYPE_PCM,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface EncapsulationType {}
|
||||
@@ -122,6 +128,7 @@ public class AudioProfile implements Parcelable {
|
||||
*
|
||||
* @see #AUDIO_ENCAPSULATION_TYPE_NONE
|
||||
* @see #AUDIO_ENCAPSULATION_TYPE_IEC61937
|
||||
* @see #AUDIO_ENCAPSULATION_TYPE_PCM
|
||||
*/
|
||||
public @EncapsulationType int getEncapsulationType() {
|
||||
return mEncapsulationType;
|
||||
|
||||
@@ -614,6 +614,8 @@ public class AidlConversion {
|
||||
switch (type) {
|
||||
case android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_IEC61937:
|
||||
return AudioEncapsulationType.IEC61937;
|
||||
case android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_PCM:
|
||||
return AudioEncapsulationType.PCM;
|
||||
case android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_NONE:
|
||||
default:
|
||||
return AudioEncapsulationType.NONE;
|
||||
@@ -629,6 +631,8 @@ public class AidlConversion {
|
||||
switch (type) {
|
||||
case AudioEncapsulationType.IEC61937:
|
||||
return android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_IEC61937;
|
||||
case AudioEncapsulationType.PCM:
|
||||
return android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_PCM;
|
||||
case AudioEncapsulationType.NONE:
|
||||
default:
|
||||
return android.media.AudioProfile.AUDIO_ENCAPSULATION_TYPE_NONE;
|
||||
|
||||
Reference in New Issue
Block a user