13#ifndef OPENSHOT_CAMERACAPTUREREADER_H
14#define OPENSHOT_CAMERACAPTUREREADER_H
48 std::map<std::string, std::string>
options;
57 void Close()
override;
61 std::shared_ptr<openshot::Frame>
GetFrame(int64_t number)
override;
62 bool IsOpen()
override {
return reader && reader->IsOpen(); };
63 std::string
Name()
override {
return "CameraCaptureReader"; };
64 std::string
Json()
const override;
65 void SetJson(
const std::string value)
override;
83 void ValidateSettings()
const;
88 std::unique_ptr<ScreenCaptureReader> reader;
Header file for Audio Device Info struct.
Header file for live screen capture readers.
All cache managers in libopenshot are based on this CacheBase class.
void Open() override
Open the reader (and start consuming resources, such as images or video files)
Json::Value JsonValue() const override
Generate Json::Value for this object.
void Close() override
Close the reader (and any resources it was consuming)
static bool IsBackendSupported(CameraCaptureBackend backend)
static AudioDeviceList GetDeviceNames(CameraCaptureBackend backend=CAMERA_CAPTURE_AUTO)
void RequestClose()
Request cancellation without releasing camera resources on the caller's thread.
CameraCaptureReader(const CameraCaptureSettings &settings)
std::string Json() const override
Generate JSON string of this object.
CacheBase * GetCache() override
Get the cache object used by this reader (note: not all readers use cache)
openshot::CaptureReaderStats GetStats() const
std::shared_ptr< openshot::Frame > GetFrame(int64_t number) override
static std::vector< CameraCaptureMode > GetDeviceModes(const std::string &device, CameraCaptureBackend backend=CAMERA_CAPTURE_AUTO)
std::string Name() override
Return the type name of the class.
~CameraCaptureReader() override
static CameraCaptureBackend DefaultBackend()
bool IsOpen() override
Determine if reader is open or closed.
void SetJson(const std::string value) override
Load JSON string into this object.
CameraCaptureSettings GetSettings() const
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
This class represents a fraction.
This abstract class is the base class, used by all readers in libopenshot.
This namespace is the default namespace for all code in the openshot library.
@ CAMERA_CAPTURE_WINDOWS_DSHOW
@ CAMERA_CAPTURE_MAC_AVFOUNDATION
std::vector< std::pair< std::string, std::string > > AudioDeviceList
A supported capture combination, with an FFmpeg input format name.
std::map< std::string, std::string > options
CameraCaptureBackend backend