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

Commit ebb4d530 authored by Songyue Han's avatar Songyue Han Committed by Android (Google) Code Review
Browse files

Merge "CodecCapabilities: Allow returning NULL for...

Merge "CodecCapabilities: Allow returning NULL for getAchievableFrameRatesFor() if no measurement data is published." into main
parents f0e54789 c123ba0b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -686,9 +686,14 @@ static jobject android_media_VideoCapabilities_getAchievableFrameRatesFor(JNIEnv
        return NULL;
    }

    if (!videoCaps->supports(width, height, std::nullopt)) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "unsupported size");
        return NULL;
    }

    std::optional<Range<double>> frameRates = videoCaps->getAchievableFrameRatesFor(width, height);
    if (!frameRates) {
        jniThrowException(env, "java/lang/IllegalArgumentException", "unsupported size");
        // Return NULL if the device doesn't publish data for that resolution
        return NULL;
    }
    jobject jFrameRates = convertToJavaDoubleRange(env, frameRates.value());