13#ifndef OPENSHOT_SCREENCAPTUREREADER_H
14#define OPENSHOT_SCREENCAPTUREREADER_H
51 std::map<std::string, std::string>
options;
73 virtual std::shared_ptr<openshot::Frame>
GetFrame(int64_t number) = 0;
81 void Close()
override;
85 std::shared_ptr<openshot::Frame>
GetFrame(int64_t number)
override;
87 std::string
Name()
override {
return "ScreenCaptureReader"; };
88 std::string
Json()
const override;
89 void SetJson(
const std::string value)
override;
95 void AddSystemAudio(std::shared_ptr<openshot::Frame> frame, int64_t output_frame_number);
103 void ValidateSettings()
const;
106 std::string InputFormatName()
const;
107 std::string InputName()
const;
108 std::shared_ptr<openshot::Frame> DecodeNextFrame(int64_t number);
109 bool UsesFFmpegDevice()
const;
110 bool UsesWaylandPortal()
const;
115 std::unique_ptr<CaptureBackendReader> backend_reader;
118 void* backend_module =
nullptr;
124 AVFormatContext* format_context;
125 AVCodecContext* codec_context;
126 AVFrame* source_frame;
129 SwsContext* sws_context;
130 std::atomic<bool> close_requested;
131 bool manual_system_audio =
false;
133 class SystemAudioCapture;
134 std::unique_ptr<SystemAudioCapture> system_audio;
Header file for FFmpegUtilities.
Header file for ReaderBase class.
All cache managers in libopenshot are based on this CacheBase class.
This class represents a fraction.
This abstract class is the base class, used by all readers in libopenshot.
virtual openshot::CaptureReaderStats GetStats() const =0
virtual std::shared_ptr< openshot::Frame > GetFrame(int64_t number)=0
virtual ~CaptureBackendReader()=default
virtual bool IsOpen() const =0
void SetJson(const std::string value) override
Load JSON string into this object.
bool IsOpen() override
Determine if reader is open or closed.
~ScreenCaptureReader() override
void RequestClose()
Signal FFmpeg capture reads to stop; the opening thread must call Close().
openshot::CaptureReaderStats GetStats() const
std::string Name() override
Return the type name of the class.
void Close() override
Close the reader (and any resources it was consuming)
static ScreenCaptureBackend DefaultBackend()
static bool IsBackendSupported(ScreenCaptureBackend backend)
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
void AddSystemAudio(std::shared_ptr< openshot::Frame > frame, int64_t output_frame_number)
Json::Value JsonValue() const override
Generate Json::Value for this object.
std::shared_ptr< openshot::Frame > GetFrame(int64_t number) override
ScreenCaptureSettings GetSettings() const
std::string Json() const override
Generate JSON string of this object.
void Open() override
Open the reader (and start consuming resources, such as images or video files)
CacheBase * GetCache() override
Get the cache object used by this reader (note: not all readers use cache)
static bool IsSystemAudioSupported(ScreenCaptureBackend backend)
This namespace is the default namespace for all code in the openshot library.
@ SCREEN_CAPTURE_MAC_AVFOUNDATION
@ SCREEN_CAPTURE_WINDOWS_GDI
std::map< std::string, std::string > options
ScreenCaptureBackend backend