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;
83 std::shared_ptr<openshot::Frame>
GetFrame(int64_t number)
override;
85 std::string
Name()
override {
return "ScreenCaptureReader"; };
86 std::string
Json()
const override;
87 void SetJson(
const std::string value)
override;
93 void AddSystemAudio(std::shared_ptr<openshot::Frame> frame, int64_t output_frame_number);
101 void ValidateSettings()
const;
104 std::string InputFormatName()
const;
105 std::string InputName()
const;
106 std::shared_ptr<openshot::Frame> DecodeNextFrame(int64_t number);
107 bool UsesFFmpegDevice()
const;
108 bool UsesWaylandPortal()
const;
113 std::unique_ptr<CaptureBackendReader> backend_reader;
116 void* backend_module =
nullptr;
122 AVFormatContext* format_context;
123 AVCodecContext* codec_context;
124 AVFrame* source_frame;
127 SwsContext* sws_context;
128 std::atomic<bool> close_requested;
129 bool manual_system_audio =
false;
131 class SystemAudioCapture;
132 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
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)
ScreenCaptureReader(const ScreenCaptureSettings &settings)
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)
CacheBase * GetCache() override
Get the cache object used by this reader (note: not all readers use cache)
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)
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