Merge "Add OPUS encoding to the framework"
This commit is contained in:
@@ -23479,6 +23479,7 @@ package android.media {
|
|||||||
field public static final int ENCODING_IEC61937 = 13; // 0xd
|
field public static final int ENCODING_IEC61937 = 13; // 0xd
|
||||||
field public static final int ENCODING_INVALID = 0; // 0x0
|
field public static final int ENCODING_INVALID = 0; // 0x0
|
||||||
field public static final int ENCODING_MP3 = 9; // 0x9
|
field public static final int ENCODING_MP3 = 9; // 0x9
|
||||||
|
field public static final int ENCODING_OPUS = 20; // 0x14
|
||||||
field public static final int ENCODING_PCM_16BIT = 2; // 0x2
|
field public static final int ENCODING_PCM_16BIT = 2; // 0x2
|
||||||
field public static final int ENCODING_PCM_8BIT = 3; // 0x3
|
field public static final int ENCODING_PCM_8BIT = 3; // 0x3
|
||||||
field public static final int ENCODING_PCM_FLOAT = 4; // 0x4
|
field public static final int ENCODING_PCM_FLOAT = 4; // 0x4
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#define ENCODING_AC4 17
|
#define ENCODING_AC4 17
|
||||||
#define ENCODING_E_AC3_JOC 18
|
#define ENCODING_E_AC3_JOC 18
|
||||||
#define ENCODING_DOLBY_MAT 19
|
#define ENCODING_DOLBY_MAT 19
|
||||||
|
#define ENCODING_OPUS 20
|
||||||
|
|
||||||
#define ENCODING_INVALID 0
|
#define ENCODING_INVALID 0
|
||||||
#define ENCODING_DEFAULT 1
|
#define ENCODING_DEFAULT 1
|
||||||
@@ -88,6 +89,8 @@ static inline audio_format_t audioFormatToNative(int audioFormat)
|
|||||||
return AUDIO_FORMAT_DEFAULT;
|
return AUDIO_FORMAT_DEFAULT;
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
return AUDIO_FORMAT_MAT;
|
return AUDIO_FORMAT_MAT;
|
||||||
|
case ENCODING_OPUS:
|
||||||
|
return AUDIO_FORMAT_OPUS;
|
||||||
default:
|
default:
|
||||||
return AUDIO_FORMAT_INVALID;
|
return AUDIO_FORMAT_INVALID;
|
||||||
}
|
}
|
||||||
@@ -142,6 +145,8 @@ static inline int audioFormatFromNative(audio_format_t nativeFormat)
|
|||||||
case AUDIO_FORMAT_MAT_2_0:
|
case AUDIO_FORMAT_MAT_2_0:
|
||||||
case AUDIO_FORMAT_MAT_2_1:
|
case AUDIO_FORMAT_MAT_2_1:
|
||||||
return ENCODING_DOLBY_MAT;
|
return ENCODING_DOLBY_MAT;
|
||||||
|
case AUDIO_FORMAT_OPUS:
|
||||||
|
return ENCODING_OPUS;
|
||||||
case AUDIO_FORMAT_DEFAULT:
|
case AUDIO_FORMAT_DEFAULT:
|
||||||
return ENCODING_DEFAULT;
|
return ENCODING_DEFAULT;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -281,6 +281,8 @@ public final class AudioFormat implements Parcelable {
|
|||||||
* metadata (object audio) over HDMI (e.g. Dolby Atmos content).
|
* metadata (object audio) over HDMI (e.g. Dolby Atmos content).
|
||||||
**/
|
**/
|
||||||
public static final int ENCODING_DOLBY_MAT = 19;
|
public static final int ENCODING_DOLBY_MAT = 19;
|
||||||
|
/** Audio data format: OPUS compressed. */
|
||||||
|
public static final int ENCODING_OPUS = 20;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public static String toLogFriendlyEncoding(int enc) {
|
public static String toLogFriendlyEncoding(int enc) {
|
||||||
@@ -323,6 +325,8 @@ public final class AudioFormat implements Parcelable {
|
|||||||
return "ENCODING_E_AC3_JOC";
|
return "ENCODING_E_AC3_JOC";
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
return "ENCODING_DOLBY_MAT";
|
return "ENCODING_DOLBY_MAT";
|
||||||
|
case ENCODING_OPUS:
|
||||||
|
return "ENCODING_OPUS";
|
||||||
default :
|
default :
|
||||||
return "invalid encoding " + enc;
|
return "invalid encoding " + enc;
|
||||||
}
|
}
|
||||||
@@ -548,6 +552,7 @@ public final class AudioFormat implements Parcelable {
|
|||||||
case ENCODING_AC4:
|
case ENCODING_AC4:
|
||||||
case ENCODING_E_AC3_JOC:
|
case ENCODING_E_AC3_JOC:
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
|
case ENCODING_OPUS:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -576,6 +581,7 @@ public final class AudioFormat implements Parcelable {
|
|||||||
case ENCODING_AC4:
|
case ENCODING_AC4:
|
||||||
case ENCODING_E_AC3_JOC:
|
case ENCODING_E_AC3_JOC:
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
|
case ENCODING_OPUS:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -607,6 +613,7 @@ public final class AudioFormat implements Parcelable {
|
|||||||
case ENCODING_AC4:
|
case ENCODING_AC4:
|
||||||
case ENCODING_E_AC3_JOC:
|
case ENCODING_E_AC3_JOC:
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
|
case ENCODING_OPUS:
|
||||||
return false;
|
return false;
|
||||||
case ENCODING_INVALID:
|
case ENCODING_INVALID:
|
||||||
default:
|
default:
|
||||||
@@ -638,6 +645,7 @@ public final class AudioFormat implements Parcelable {
|
|||||||
case ENCODING_AC4:
|
case ENCODING_AC4:
|
||||||
case ENCODING_E_AC3_JOC:
|
case ENCODING_E_AC3_JOC:
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
|
case ENCODING_OPUS:
|
||||||
return false;
|
return false;
|
||||||
case ENCODING_INVALID:
|
case ENCODING_INVALID:
|
||||||
default:
|
default:
|
||||||
@@ -917,6 +925,7 @@ public final class AudioFormat implements Parcelable {
|
|||||||
case ENCODING_AC4:
|
case ENCODING_AC4:
|
||||||
case ENCODING_E_AC3_JOC:
|
case ENCODING_E_AC3_JOC:
|
||||||
case ENCODING_DOLBY_MAT:
|
case ENCODING_DOLBY_MAT:
|
||||||
|
case ENCODING_OPUS:
|
||||||
mEncoding = encoding;
|
mEncoding = encoding;
|
||||||
break;
|
break;
|
||||||
case ENCODING_INVALID:
|
case ENCODING_INVALID:
|
||||||
@@ -1136,7 +1145,8 @@ public final class AudioFormat implements Parcelable {
|
|||||||
ENCODING_AAC_XHE,
|
ENCODING_AAC_XHE,
|
||||||
ENCODING_AC4,
|
ENCODING_AC4,
|
||||||
ENCODING_E_AC3_JOC,
|
ENCODING_E_AC3_JOC,
|
||||||
ENCODING_DOLBY_MAT }
|
ENCODING_DOLBY_MAT,
|
||||||
|
ENCODING_OPUS }
|
||||||
)
|
)
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface Encoding {}
|
public @interface Encoding {}
|
||||||
|
|||||||
Reference in New Issue
Block a user