"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srcs/api-java/cpp/AuxiliaryPropertyJNI.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).

AuxiliaryPropertyJNI.cpp  (heif-3.6.0):AuxiliaryPropertyJNI.cpp  (heif-3.6.1)
skipping to change at line 28 skipping to change at line 28
#include "Helpers.h" #include "Helpers.h"
#define CLASS_NAME AuxiliaryProperty #define CLASS_NAME AuxiliaryProperty
extern "C" extern "C"
{ {
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::AuxiliaryProperty(nativeHeif); auto* nativeObject = new HEIFPP::AuxiliaryProperty(nativeHeif);
return reinterpret_cast<jlong>(nativeObject); return reinterpret_cast<jlong>(nativeObject);
} }
JNI_METHOD_ARG(void, setTypeNative, jstring javaString) JNI_METHOD_ARG(void, setTypeNative, jstring javaString)
{ {
NATIVE_SELF; NATIVE_SELF;
const char *nativeString = env->GetStringUTFChars(javaString, nullptr); const char* nativeString = env->GetStringUTFChars(javaString, nullptr);
nativeSelf->auxType(nativeString); nativeSelf->auxType(nativeString);
env->ReleaseStringUTFChars(javaString, nativeString); env->ReleaseStringUTFChars(javaString, nativeString);
} }
JNI_METHOD(jstring, getTypeNative) JNI_METHOD(jstring, getTypeNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return env->NewStringUTF(nativeSelf->auxType().data()); return env->NewStringUTF(nativeSelf->auxType().data());
} }
JNI_METHOD_ARG(void, setSubTypeNative, jbyteArray subType) JNI_METHOD_ARG(void, setSubTypeNative, jbyteArray subType)
{ {
NATIVE_SELF; NATIVE_SELF;
jbyte *nativeData = env->GetByteArrayElements(subType, nullptr); jbyte* nativeData = env->GetByteArrayElements(subType, nullptr);
auto dataSize = static_cast<uint32_t>(env->GetArrayLength(subType)); auto dataSize = static_cast<uint32_t>(env->GetArrayLength(subType));
std::vector<uint8_t> dataAsVector; std::vector<uint8_t> dataAsVector;
dataAsVector.reserve(dataSize); dataAsVector.reserve(dataSize);
dataAsVector.assign(nativeData, nativeData + dataSize); dataAsVector.assign(nativeData, nativeData + dataSize);
nativeSelf->subType(dataAsVector); nativeSelf->subType(dataAsVector);
env->ReleaseByteArrayElements(subType, nativeData, 0); env->ReleaseByteArrayElements(subType, nativeData, 0);
} }
JNI_METHOD(jobject, getSubTypeNative) JNI_METHOD(jobject, getSubTypeNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return env->NewDirectByteBuffer(const_cast<uint8_t *>(nativeSelf->subTyp e().data()), return env->NewDirectByteBuffer(const_cast<uint8_t*>(nativeSelf->subType ().data()),
static_cast<jlong>(nativeSelf->subType() .size())); static_cast<jlong>(nativeSelf->subType() .size()));
} }
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

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