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

#pragma once

#include <NitroModules/JHybridObject.hpp>
#include <fbjni/fbjni.h>
#include "HybridVideoPlayerSourceFactorySpec.hpp"




namespace margelo::nitro::video {

  using namespace facebook;

  class JHybridVideoPlayerSourceFactorySpec: public jni::HybridClass<JHybridVideoPlayerSourceFactorySpec, JHybridObject>,
                                             public virtual HybridVideoPlayerSourceFactorySpec {
  public:
    static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/HybridVideoPlayerSourceFactorySpec;";
    static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
    static void registerNatives();

  protected:
    // C++ constructor (called from Java via `initHybrid()`)
    explicit JHybridVideoPlayerSourceFactorySpec(jni::alias_ref<jhybridobject> jThis) :
      HybridObject(HybridVideoPlayerSourceFactorySpec::TAG),
      HybridBase(jThis),
      _javaPart(jni::make_global(jThis)) {}

  public:
    ~JHybridVideoPlayerSourceFactorySpec() override {
      // Hermes GC can destroy JS objects on a non-JNI Thread.
      jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
    }

  public:
    size_t getExternalMemorySize() noexcept override;
    void dispose() noexcept override;

  public:
    inline const jni::global_ref<JHybridVideoPlayerSourceFactorySpec::javaobject>& getJavaPart() const noexcept {
      return _javaPart;
    }

  public:
    // Properties
    

  public:
    // Methods
    std::shared_ptr<HybridVideoPlayerSourceSpec> fromUri(const std::string& uri) override;
    std::shared_ptr<HybridVideoPlayerSourceSpec> fromVideoConfig(const NativeVideoConfig& config) override;

  private:
    friend HybridBase;
    using HybridBase::HybridBase;
    jni::global_ref<JHybridVideoPlayerSourceFactorySpec::javaobject> _javaPart;
  };

} // namespace margelo::nitro::video
