/// /// ReactNativeVideo-Swift-Cxx-Bridge.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #include "ReactNativeVideo-Swift-Cxx-Bridge.hpp" // Include C++ implementation defined types #include "HybridVideoPlayerEventEmitterSpecSwift.hpp" #include "HybridVideoPlayerFactorySpecSwift.hpp" #include "HybridVideoPlayerSourceFactorySpecSwift.hpp" #include "HybridVideoPlayerSourceSpecSwift.hpp" #include "HybridVideoPlayerSpecSwift.hpp" #include "HybridVideoViewViewManagerFactorySpecSwift.hpp" #include "HybridVideoViewViewManagerSpecSwift.hpp" #include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp" #include namespace margelo::nitro::video::bridge::swift { // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoPlayerSourceSpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoPlayerEventEmitterSpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::function Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)]() mutable -> void { swiftClosure.call(); }; } // pragma MARK: std::function Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { swiftClosure.call(error); }; } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoPlayerSpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoPlayerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoPlayerFactorySpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::function Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_bool::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](bool hasAudioFocus) mutable -> void { swiftClosure.call(hasAudioFocus); }; } // pragma MARK: std::function Func_void_BandwidthData create_Func_void_BandwidthData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_BandwidthData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const BandwidthData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_onLoadData create_Func_void_onLoadData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onLoadData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onLoadData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_onLoadStartData create_Func_void_onLoadStartData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onLoadStartData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onLoadStartData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_onPlaybackStateChangeData create_Func_void_onPlaybackStateChangeData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onPlaybackStateChangeData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onPlaybackStateChangeData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_double::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](double rate) mutable -> void { swiftClosure.call(rate); }; } // pragma MARK: std::function Func_void_onProgressData create_Func_void_onProgressData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onProgressData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onProgressData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_VideoPlayerStatus create_Func_void_VideoPlayerStatus(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_VideoPlayerStatus::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](VideoPlayerStatus status) mutable -> void { swiftClosure.call(static_cast(status)); }; } // pragma MARK: std::function Func_void_TimedMetadata create_Func_void_TimedMetadata(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_TimedMetadata::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const TimedMetadata& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function& /* data */)> Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::vector& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function>& /* track */)> Func_void_std__optional_std__variant_nitro__NullType__TextTrack__ create_Func_void_std__optional_std__variant_nitro__NullType__TextTrack__(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__optional_std__variant_nitro__NullType__TextTrack__::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::optional>& track) mutable -> void { swiftClosure.call(track); }; } // pragma MARK: std::function Func_void_onVolumeChangeData create_Func_void_onVolumeChangeData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onVolumeChangeData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onVolumeChangeData& data) mutable -> void { swiftClosure.call(data); }; } // pragma MARK: std::function Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__string::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void { swiftClosure.call(result); }; } // pragma MARK: std::function>>>(const OnGetLicensePayload& /* payload */)> Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const OnGetLicensePayload& payload) mutable -> std::shared_ptr>>> { auto __result = swiftClosure.call(payload); return __result; }; } // pragma MARK: std::function>& /* result */)> Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__shared_ptr_Promise_std__string__::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr>& result) mutable -> void { swiftClosure.call(result); }; } // pragma MARK: std::function Func_void_VideoInformation create_Func_void_VideoInformation(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_VideoInformation::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const VideoInformation& result) mutable -> void { swiftClosure.call(result); }; } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoPlayerSourceFactorySpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoViewViewManagerSpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } // pragma MARK: std::shared_ptr std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { throw std::runtime_error("Class \"HybridVideoViewViewManagerFactorySpec\" is not implemented in Swift!"); } #endif ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); return swiftPart.toUnsafe(); } } // namespace margelo::nitro::video::bridge::swift