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

Commit 39029b29 authored by Ashok Bhat's avatar Ashok Bhat Committed by David Butcher
Browse files

Make YuvToJpegEncoder more JNI compliant



Minor changes have been done to conform with standard
JNI practice (e.g. use of jint instead of int in JNI
function prototypes)

Change-Id: I4015138921cc18ecae52daaa6710b3c9efd68e87
Signed-off-by: default avatarAshok Bhat <ashok.bhat@arm.com>
Signed-off-by: default avatarMarcus Oakland <marcus.oakland@arm.com>
parent 868173a5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -217,8 +217,8 @@ void Yuv422IToJpegEncoder::configSamplingFactors(jpeg_compress_struct* cinfo) {
///////////////////////////////////////////////////////////////////////////////

static jboolean YuvImage_compressToJpeg(JNIEnv* env, jobject, jbyteArray inYuv,
        int format, int width, int height, jintArray offsets,
        jintArray strides, int jpegQuality, jobject jstream,
        jint format, jint width, jint height, jintArray offsets,
        jintArray strides, jint jpegQuality, jobject jstream,
        jbyteArray jstorage) {
    jbyte* yuv = env->GetByteArrayElements(inYuv, NULL);
    SkWStream* strm = CreateJavaOutputStreamAdaptor(env, jstream, jstorage);
@@ -227,7 +227,7 @@ static jboolean YuvImage_compressToJpeg(JNIEnv* env, jobject, jbyteArray inYuv,
    jint* imgStrides = env->GetIntArrayElements(strides, NULL);
    YuvToJpegEncoder* encoder = YuvToJpegEncoder::create(format, imgStrides);
    if (encoder == NULL) {
        return false;
        return JNI_FALSE;
    }
    encoder->encode(strm, yuv, width, height, imgOffsets, jpegQuality);

@@ -235,7 +235,7 @@ static jboolean YuvImage_compressToJpeg(JNIEnv* env, jobject, jbyteArray inYuv,
    env->ReleaseByteArrayElements(inYuv, yuv, 0);
    env->ReleaseIntArrayElements(offsets, imgOffsets, 0);
    env->ReleaseIntArrayElements(strides, imgStrides, 0);
    return true;
    return JNI_TRUE;
}
///////////////////////////////////////////////////////////////////////////////