mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-08-16 02:56:22 +00:00
126 lines
4.6 KiB
C++
Generated
126 lines
4.6 KiB
C++
Generated
///
|
|
/// HybridVideoPlayerSourceSpecSwift.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#include "HybridVideoPlayerSourceSpec.hpp"
|
|
|
|
// Forward declaration of `HybridVideoPlayerSourceSpec_cxx` to properly resolve imports.
|
|
namespace ReactNativeVideo { class HybridVideoPlayerSourceSpec_cxx; }
|
|
|
|
// Forward declaration of `NativeVideoConfig` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct NativeVideoConfig; }
|
|
// Forward declaration of `NativeExternalSubtitle` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct NativeExternalSubtitle; }
|
|
// Forward declaration of `SubtitleType` to properly resolve imports.
|
|
namespace margelo::nitro::video { enum class SubtitleType; }
|
|
// Forward declaration of `NativeDrmParams` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct NativeDrmParams; }
|
|
// Forward declaration of `OnGetLicensePayload` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct OnGetLicensePayload; }
|
|
// Forward declaration of `BufferConfig` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct BufferConfig; }
|
|
// Forward declaration of `LivePlaybackParams` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct LivePlaybackParams; }
|
|
// Forward declaration of `Resolution` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct Resolution; }
|
|
// Forward declaration of `CustomVideoMetadata` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct CustomVideoMetadata; }
|
|
// Forward declaration of `VideoInformation` to properly resolve imports.
|
|
namespace margelo::nitro::video { struct VideoInformation; }
|
|
// Forward declaration of `VideoOrientation` to properly resolve imports.
|
|
namespace margelo::nitro::video { enum class VideoOrientation; }
|
|
|
|
#include <string>
|
|
#include "NativeVideoConfig.hpp"
|
|
#include "NativeExternalSubtitle.hpp"
|
|
#include <vector>
|
|
#include <optional>
|
|
#include "SubtitleType.hpp"
|
|
#include "NativeDrmParams.hpp"
|
|
#include <unordered_map>
|
|
#include <NitroModules/Promise.hpp>
|
|
#include "OnGetLicensePayload.hpp"
|
|
#include <functional>
|
|
#include "BufferConfig.hpp"
|
|
#include "LivePlaybackParams.hpp"
|
|
#include "Resolution.hpp"
|
|
#include "CustomVideoMetadata.hpp"
|
|
#include "VideoInformation.hpp"
|
|
#include "VideoOrientation.hpp"
|
|
|
|
#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
|
|
|
namespace margelo::nitro::video {
|
|
|
|
/**
|
|
* The C++ part of HybridVideoPlayerSourceSpec_cxx.swift.
|
|
*
|
|
* HybridVideoPlayerSourceSpecSwift (C++) accesses HybridVideoPlayerSourceSpec_cxx (Swift), and might
|
|
* contain some additional bridging code for C++ <> Swift interop.
|
|
*
|
|
* Since this obviously introduces an overhead, I hope at some point in
|
|
* the future, HybridVideoPlayerSourceSpec_cxx can directly inherit from the C++ class HybridVideoPlayerSourceSpec
|
|
* to simplify the whole structure and memory management.
|
|
*/
|
|
class HybridVideoPlayerSourceSpecSwift: public virtual HybridVideoPlayerSourceSpec {
|
|
public:
|
|
// Constructor from a Swift instance
|
|
explicit HybridVideoPlayerSourceSpecSwift(const ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx& swiftPart):
|
|
HybridObject(HybridVideoPlayerSourceSpec::TAG),
|
|
_swiftPart(swiftPart) { }
|
|
|
|
public:
|
|
// Get the Swift part
|
|
inline ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx& getSwiftPart() noexcept {
|
|
return _swiftPart;
|
|
}
|
|
|
|
public:
|
|
inline size_t getExternalMemorySize() noexcept override {
|
|
return _swiftPart.getMemorySize();
|
|
}
|
|
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
if (auto otherCast = std::dynamic_pointer_cast<HybridVideoPlayerSourceSpecSwift>(other)) {
|
|
return _swiftPart.equals(otherCast->_swiftPart);
|
|
}
|
|
return false;
|
|
}
|
|
void dispose() noexcept override {
|
|
_swiftPart.dispose();
|
|
}
|
|
std::string toString() override {
|
|
return _swiftPart.toString();
|
|
}
|
|
|
|
public:
|
|
// Properties
|
|
inline std::string getUri() noexcept override {
|
|
auto __result = _swiftPart.getUri();
|
|
return __result;
|
|
}
|
|
inline NativeVideoConfig getConfig() noexcept override {
|
|
return _swiftPart.getConfig();
|
|
}
|
|
|
|
public:
|
|
// Methods
|
|
inline std::shared_ptr<Promise<VideoInformation>> getAssetInformationAsync() override {
|
|
auto __result = _swiftPart.getAssetInformationAsync();
|
|
if (__result.hasError()) [[unlikely]] {
|
|
std::rethrow_exception(__result.error());
|
|
}
|
|
auto __value = std::move(__result.value());
|
|
return __value;
|
|
}
|
|
|
|
private:
|
|
ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx _swiftPart;
|
|
};
|
|
|
|
} // namespace margelo::nitro::video
|