Merge "media: propagate profiles to EncoderProfiles" into sc-dev

This commit is contained in:
Lajos Molnar
2021-05-07 15:02:15 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 5 deletions

View File

@@ -304,7 +304,7 @@ public final class EncoderProfiles
} else if (codec == MediaRecorder.AudioEncoder.AAC_ELD) { } else if (codec == MediaRecorder.AudioEncoder.AAC_ELD) {
return MediaCodecInfo.CodecProfileLevel.AACObjectELD; return MediaCodecInfo.CodecProfileLevel.AACObjectELD;
} }
return 0; return profile;
} }
@@ -313,17 +313,20 @@ public final class EncoderProfiles
int codec, int codec,
int channels, int channels,
int sampleRate, int sampleRate,
int bitrate) { int bitrate,
int profile) {
this.codec = codec; this.codec = codec;
this.channels = channels; this.channels = channels;
this.sampleRate = sampleRate; this.sampleRate = sampleRate;
this.bitrate = bitrate; this.bitrate = bitrate;
this.profile = profile;
} }
private int codec; private int codec;
private int channels; private int channels;
private int sampleRate; private int sampleRate;
private int bitrate; private int bitrate;
private int profile; // this contains the profile if codec itself does not
} }
private int durationSecs; private int durationSecs;

View File

@@ -255,7 +255,7 @@ android_media_MediaProfiles_native_get_camcorder_profiles(JNIEnv *env, jobject /
jclass audioProfileClazz = env->FindClass("android/media/EncoderProfiles$AudioProfile"); jclass audioProfileClazz = env->FindClass("android/media/EncoderProfiles$AudioProfile");
jmethodID audioProfileConstructorMethodID = jmethodID audioProfileConstructorMethodID =
env->GetMethodID(audioProfileClazz, "<init>", "(IIII)V"); env->GetMethodID(audioProfileClazz, "<init>", "(IIIII)V");
jobjectArray videoCodecs = (jobjectArray)env->NewObjectArray( jobjectArray videoCodecs = (jobjectArray)env->NewObjectArray(
cp->getVideoCodecs().size(), videoProfileClazz, nullptr); cp->getVideoCodecs().size(), videoProfileClazz, nullptr);
@@ -269,7 +269,7 @@ android_media_MediaProfiles_native_get_camcorder_profiles(JNIEnv *env, jobject /
vc->getFrameHeight(), vc->getFrameHeight(),
vc->getFrameRate(), vc->getFrameRate(),
vc->getBitrate(), vc->getBitrate(),
-1 /* profile */); vc->getProfile());
env->SetObjectArrayElement(videoCodecs, i++, videoCodec); env->SetObjectArrayElement(videoCodecs, i++, videoCodec);
} }
} }
@@ -289,7 +289,8 @@ android_media_MediaProfiles_native_get_camcorder_profiles(JNIEnv *env, jobject /
ac->getCodec(), ac->getCodec(),
ac->getChannels(), ac->getChannels(),
ac->getSampleRate(), ac->getSampleRate(),
ac->getBitrate()); ac->getBitrate(),
ac->getProfile());
env->SetObjectArrayElement(audioCodecs, i++, audioCodec); env->SetObjectArrayElement(audioCodecs, i++, audioCodec);
} }