///
/// JHybridVideoPlayerFactorySpec.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#include "JHybridVideoPlayerFactorySpec.hpp"

// Forward declaration of `HybridVideoPlayerSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSpec; }
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }

#include <memory>
#include "HybridVideoPlayerSpec.hpp"
#include "JHybridVideoPlayerSpec.hpp"
#include "HybridVideoPlayerSourceSpec.hpp"
#include "JHybridVideoPlayerSourceSpec.hpp"

namespace margelo::nitro::video {

  jni::local_ref<JHybridVideoPlayerFactorySpec::jhybriddata> JHybridVideoPlayerFactorySpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  void JHybridVideoPlayerFactorySpec::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridVideoPlayerFactorySpec::initHybrid),
    });
  }

  size_t JHybridVideoPlayerFactorySpec::getExternalMemorySize() noexcept {
    static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
    return method(_javaPart);
  }

  void JHybridVideoPlayerFactorySpec::dispose() noexcept {
    static const auto method = javaClassStatic()->getMethod<void()>("dispose");
    method(_javaPart);
  }

  // Properties
  

  // Methods
  std::shared_ptr<HybridVideoPlayerSpec> JHybridVideoPlayerFactorySpec::createPlayer(const std::shared_ptr<HybridVideoPlayerSourceSpec>& source) {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JHybridVideoPlayerSpec::javaobject>(jni::alias_ref<JHybridVideoPlayerSourceSpec::javaobject> /* source */)>("createPlayer");
    auto __result = method(_javaPart, std::dynamic_pointer_cast<JHybridVideoPlayerSourceSpec>(source)->getJavaPart());
    return __result->cthis()->shared_cast<JHybridVideoPlayerSpec>();
  }

} // namespace margelo::nitro::video
