Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fa6d3a8 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

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

parents 714f840a 16ceab17
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;
+4 −3
Original line number Diff line number Diff line
@@ -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);
        }