|
OpenShot Library | libopenshot
0.7.0
|
Go to the documentation of this file.
13 #ifndef OPENSHOT_SCREENCAPTUREREADER_H
14 #define OPENSHOT_SCREENCAPTUREREADER_H
51 std::map<std::string, std::string>
options;
70 virtual void Open() = 0;
71 virtual void Close() = 0;
72 virtual bool IsOpen()
const = 0;
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;
119 AVFormatContext* format_context;
120 AVCodecContext* codec_context;
121 AVFrame* source_frame;
124 SwsContext* sws_context;
125 std::atomic<bool> close_requested;
126 bool manual_system_audio =
false;
128 class SystemAudioCapture;
129 std::unique_ptr<SystemAudioCapture> system_audio;
Header file for FFmpegUtilities.
ScreenCaptureReader(const ScreenCaptureSettings &settings)
void SetJson(const std::string value) override
Load JSON string into this object.
This namespace is the default namespace for all code in the openshot library.
This class represents a fraction.
bool IsOpen() override
Determine if reader is open or closed.
std::string Json() const override
Generate JSON string of this object.
@ SCREEN_CAPTURE_MAC_AVFOUNDATION
virtual bool IsOpen() const =0
All cache managers in libopenshot are based on this CacheBase class.
std::shared_ptr< openshot::Frame > GetFrame(int64_t number) override
ScreenCaptureSettings GetSettings() const
~ScreenCaptureReader() override
static bool IsSystemAudioSupported(ScreenCaptureBackend backend)
Json::Value JsonValue() const override
Generate Json::Value for this object.
static ScreenCaptureBackend DefaultBackend()
ScreenCaptureBackend backend
Header file for ReaderBase class.
std::map< std::string, std::string > options
openshot::CaptureReaderStats GetStats() const
CacheBase * GetCache() override
Get the cache object used by this reader (note: not all readers use cache)
static bool IsBackendSupported(ScreenCaptureBackend backend)
This abstract class is the base class, used by all readers in libopenshot.
std::string Name() override
Return the type name of the class.
virtual std::shared_ptr< openshot::Frame > GetFrame(int64_t number)=0
virtual ~CaptureBackendReader()=default
void Open() override
Open the reader (and start consuming resources, such as images or video files)
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)
virtual openshot::CaptureReaderStats GetStats() const =0
@ SCREEN_CAPTURE_WINDOWS_GDI
void Close() override
Close the reader (and any resources it was consuming)