mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 13:46:59 +00:00
81 lines
3.2 KiB
C++
Generated
81 lines
3.2 KiB
C++
Generated
///
|
|
/// JHybridOmniPlayerFactorySpec.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#include "JHybridOmniPlayerFactorySpec.hpp"
|
|
|
|
// Forward declaration of `HybridOmniPlayerSpec` to properly resolve imports.
|
|
namespace margelo::nitro::omni { class HybridOmniPlayerSpec; }
|
|
// Forward declaration of `Source` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Source; }
|
|
// Forward declaration of `VideoSrc` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct VideoSrc; }
|
|
// Forward declaration of `Subtitle` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Subtitle; }
|
|
// Forward declaration of `Metadata` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Metadata; }
|
|
// Forward declaration of `MixAudioMode` to properly resolve imports.
|
|
namespace margelo::nitro::omni { enum class MixAudioMode; }
|
|
|
|
#include <memory>
|
|
#include "HybridOmniPlayerSpec.hpp"
|
|
#include "JHybridOmniPlayerSpec.hpp"
|
|
#include "Source.hpp"
|
|
#include "JSource.hpp"
|
|
#include "VideoSrc.hpp"
|
|
#include <vector>
|
|
#include "JVideoSrc.hpp"
|
|
#include <string>
|
|
#include <optional>
|
|
#include <unordered_map>
|
|
#include "Subtitle.hpp"
|
|
#include "JSubtitle.hpp"
|
|
#include "Metadata.hpp"
|
|
#include "JMetadata.hpp"
|
|
#include "MixAudioMode.hpp"
|
|
#include "JMixAudioMode.hpp"
|
|
|
|
namespace margelo::nitro::omni {
|
|
|
|
std::shared_ptr<JHybridOmniPlayerFactorySpec> JHybridOmniPlayerFactorySpec::JavaPart::getJHybridOmniPlayerFactorySpec() {
|
|
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
auto castHybridObject = std::dynamic_pointer_cast<JHybridOmniPlayerFactorySpec>(hybridObject);
|
|
if (castHybridObject == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to downcast JHybridObject to JHybridOmniPlayerFactorySpec!");
|
|
}
|
|
return castHybridObject;
|
|
}
|
|
|
|
jni::local_ref<JHybridOmniPlayerFactorySpec::CxxPart::jhybriddata> JHybridOmniPlayerFactorySpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
return makeCxxInstance(jThis);
|
|
}
|
|
|
|
std::shared_ptr<JHybridObject> JHybridOmniPlayerFactorySpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
auto castJavaPart = jni::dynamic_ref_cast<JHybridOmniPlayerFactorySpec::JavaPart>(javaPart);
|
|
if (castJavaPart == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridOmniPlayerFactorySpec::JavaPart!");
|
|
}
|
|
return std::make_shared<JHybridOmniPlayerFactorySpec>(castJavaPart);
|
|
}
|
|
|
|
void JHybridOmniPlayerFactorySpec::CxxPart::registerNatives() {
|
|
registerHybrid({
|
|
makeNativeMethod("initHybrid", JHybridOmniPlayerFactorySpec::CxxPart::initHybrid),
|
|
});
|
|
}
|
|
|
|
// Properties
|
|
|
|
|
|
// Methods
|
|
std::shared_ptr<HybridOmniPlayerSpec> JHybridOmniPlayerFactorySpec::createPlayer(const Source& props) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHybridOmniPlayerSpec::JavaPart>(jni::alias_ref<JSource> /* props */)>("createPlayer");
|
|
auto __result = method(_javaPart, JSource::fromCpp(props));
|
|
return __result->getJHybridOmniPlayerSpec();
|
|
}
|
|
|
|
} // namespace margelo::nitro::omni
|