// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from mynteye_types.djinni

#include "NativeStreamRequest.hpp"  // my header
#include "Marshal.hpp"
#include "NativeFormat.hpp"

namespace djinni_generated {

NativeStreamRequest::NativeStreamRequest() = default;

NativeStreamRequest::~NativeStreamRequest() = default;

auto NativeStreamRequest::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
    const auto& data = ::djinni::JniClass<NativeStreamRequest>::get();
    auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.index)),
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.width)),
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.height)),
                                                           ::djinni::get(::djinni_generated::NativeFormat::fromCpp(jniEnv, c.format)),
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.fps)))};
    ::djinni::jniExceptionCheck(jniEnv);
    return r;
}

auto NativeStreamRequest::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 6);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeStreamRequest>::get();
    return {::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mIndex)),
            ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mWidth)),
            ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mHeight)),
            ::djinni_generated::NativeFormat::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mFormat)),
            ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mFps))};
}

}  // namespace djinni_generated
