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) {
return MediaCodecInfo.CodecProfileLevel.AACObjectELD;
}
return 0;
return profile;
}
@@ -313,17 +313,20 @@ public final class EncoderProfiles
int codec,
int channels,
int sampleRate,
int bitrate) {
int bitrate,
int profile) {
this.codec = codec;
this.channels = channels;
this.sampleRate = sampleRate;
this.bitrate = bitrate;
this.profile = profile;
}
private int codec;
private int channels;
private int sampleRate;
private int bitrate;
private int profile; // this contains the profile if codec itself does not
}
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");
jmethodID audioProfileConstructorMethodID =
env->GetMethodID(audioProfileClazz, "<init>", "(IIII)V");
env->GetMethodID(audioProfileClazz, "<init>", "(IIIII)V");
jobjectArray videoCodecs = (jobjectArray)env->NewObjectArray(
cp->getVideoCodecs().size(), videoProfileClazz, nullptr);
@@ -269,7 +269,7 @@ android_media_MediaProfiles_native_get_camcorder_profiles(JNIEnv *env, jobject /
vc->getFrameHeight(),
vc->getFrameRate(),
vc->getBitrate(),
-1 /* profile */);
vc->getProfile());
env->SetObjectArrayElement(videoCodecs, i++, videoCodec);
}
}
@@ -289,7 +289,8 @@ android_media_MediaProfiles_native_get_camcorder_profiles(JNIEnv *env, jobject /
ac->getCodec(),
ac->getChannels(),
ac->getSampleRate(),
ac->getBitrate());
ac->getBitrate(),
ac->getProfile());
env->SetObjectArrayElement(audioCodecs, i++, audioCodec);
}