"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srcs/api-java/cpp/RawPropertyJNI.cpp" between
heif-3.6.0.tar.gz and heif-3.6.1.tar.gz

About: HEIF (High Efficiency Image File Format) is a visual media container format for images and image sequences (MPEG-standard). This HEIF engine demonstrates its powerful features and capabilities (under Nokia HEIF license).

RawPropertyJNI.cpp  (heif-3.6.0):RawPropertyJNI.cpp  (heif-3.6.1)
skipping to change at line 24 skipping to change at line 24
#include <jni.h> #include <jni.h>
#include "Helpers.h" #include "Helpers.h"
#include "RawProperty.h" #include "RawProperty.h"
#define CLASS_NAME RawProperty #define CLASS_NAME RawProperty
extern "C" extern "C"
{ {
JNI_METHOD(jstring, getRawTypeNative) JNI_METHOD(jstring, getRawTypeNative)
{ {
auto *instance = (HEIFPP::RawProperty *) getNativeHandle(env, self); auto* instance = (HEIFPP::RawProperty*) getNativeHandle(env, self);
return env->NewStringUTF(instance->rawType().value); return env->NewStringUTF(instance->rawType().value);
} }
JNI_METHOD_ARG(jlong, createContextNative, jobject javaHEIF) JNI_METHOD_ARG(jlong, createContextNative, jobject javaHEIF)
{ {
UNUSED(self); UNUSED(self);
NATIVE_HEIF(nativeHeif, javaHEIF); NATIVE_HEIF(nativeHeif, javaHEIF);
auto *nativeObject = new HEIFPP::RawProperty(nativeHeif); auto* nativeObject = new HEIFPP::RawProperty(nativeHeif);
return reinterpret_cast<jlong>(nativeObject); return reinterpret_cast<jlong>(nativeObject);
} }
JNI_METHOD(void, destroyContextNative) JNI_METHOD(void, destroyContextNative)
{ {
NATIVE_SELF; NATIVE_SELF;
setNativeHandle(env, self, 0); setNativeHandle(env, self, 0);
delete nativeSelf; delete nativeSelf;
} }
JNI_METHOD(jobject, getDataNative) JNI_METHOD(jobject, getDataNative)
{ {
NATIVE_SELF; NATIVE_SELF;
const uint8_t *data; const uint8_t* data;
uint64_t length; uint64_t length;
nativeSelf->getData(data, length); nativeSelf->getData(data, length);
return env->NewDirectByteBuffer(const_cast<uint8_t *>(data), static_cast <jlong>(length)); return env->NewDirectByteBuffer(const_cast<uint8_t*>(data), static_cast< jlong>(length));
} }
JNI_METHOD_ARG(void, setDataNative, jbyteArray data) JNI_METHOD_ARG(void, setDataNative, jbyteArray data)
{ {
NATIVE_SELF; NATIVE_SELF;
jbyte *nativeData = env->GetByteArrayElements(data, nullptr); jbyte* nativeData = env->GetByteArrayElements(data, nullptr);
nativeSelf->setData((uint8_t *) (nativeData), static_cast<uint64_t>(env- nativeSelf->setData((uint8_t*) (nativeData), static_cast<uint64_t>(env->
>GetArrayLength(data))); GetArrayLength(data)));
env->ReleaseByteArrayElements(data, nativeData, 0); env->ReleaseByteArrayElements(data, nativeData, 0);
} }
JNI_METHOD_ARG(void, setRawTypeNative, jstring type) JNI_METHOD_ARG(void, setRawTypeNative, jstring type)
{ {
NATIVE_SELF; NATIVE_SELF;
const char *nativeType = env->GetStringUTFChars(type, nullptr); const char* nativeType = env->GetStringUTFChars(type, nullptr);
HEIFPP::Result error = nativeSelf->setRawType(HEIF::FourCC(nativeType), false); HEIFPP::Result error = nativeSelf->setRawType(HEIF::FourCC(nativeType), false);
env->ReleaseStringUTFChars(type, nativeType); env->ReleaseStringUTFChars(type, nativeType);
CHECK_ERROR(error, "Setting raw type failed"); CHECK_ERROR(error, "Setting raw type failed");
} }
} }
 End of changes. 6 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)