14#include <egt/detail/meta.h>
15#include <egt/signal.h>
16#include <egt/window.h>
52 std::unique_ptr<detail::GstDecoderImpl> m_video_impl;
99 const std::string& uri,
124 void do_draw()
override
144 EGT_NODISCARD std::string
media()
const
225 void scale(
float hscale,
float vscale)
override;
227 using Window::resize;
248 friend class detail::GstDecoderImpl;
249 friend class detail::GstAppSinkImpl;
253 void deserialize(
Serializer::Properties& props);
Drawing interface for 2D graphics.
Definition painter.h:45
Abstract base serializer class.
Definition serialize.h:34
std::list< std::tuple< std::string, std::string, Serializer::Attributes > > Properties
Definition serialize.h:47
A VideoWindow is a widget to decode video and render it to a screen.
Definition video.h:45
EGT_NODISCARD bool playing() const
Check is video in play state.
SignalW on_state_changed
Invoked when the state of the player changes.
Definition video.h:70
bool play()
Play the video.
EGT_NODISCARD bool has_audio() const
check for audio is supported.
EGT_NODISCARD int64_t duration() const
Get the total duration of the video.
VideoWindow(Serializer::Properties &props)
Construct a video window.
Definition video.h:108
bool volume(int volume)
Adjust volume of the video being played.
VideoWindow(const Rect &rect={}, PixelFormat format=PixelFormat::xrgb8888, WindowHint hint=WindowHint::overlay)
Create a video window to decode video and render it to a screen.
bool pause()
Pause the video.
EGT_NODISCARD int volume() const
Get the volume value for the video being played.
EGT_NODISCARD bool loopback() const
Get loop-back state.
~VideoWindow() noexcept override
VideoWindow(const Rect &rect, const std::string &uri, PixelFormat format=PixelFormat::xrgb8888, WindowHint hint=WindowHint::overlay)
Create a video window to decode video and render it to a screen.
void draw(Painter &painter, const Rect &rect) override
Draw the widget.
SignalW< const std::string & > on_error
Invoked when an error occurs.
Definition video.h:64
SignalW< int64_t > on_position_changed
Event signal.
Definition video.h:61
EGT_NODISCARD int64_t position() const
Get the current position of the video being played.
void gst_custom_pipeline(const std::string &pipeline_desc)
bool seek(int64_t pos)
Seek to a position.
SignalW on_eos
Invoked on end of stream.
Definition video.h:67
VideoWindow(Serializer::Properties &props, bool is_derived)
EGT_NODISCARD std::string media() const
get the media file used of video playback.
Definition video.h:144
void resize(const Size &s) override
Resize the widget.
VideoWindow(const VideoWindow &)=delete
void serialize(Serializer &serializer) const override
Serialize the widget to the specified serializer.
VideoWindow & operator=(const VideoWindow &)=delete
VideoWindow(VideoWindow &&) noexcept
void loopback(bool enable)
Enable/disable continues loop-back mode of the video being played.
void scale(float hscale, float vscale) override
Set the scale of the widget.
bool media(const std::string &uri)
Initialize gstreamer pipeline for specified media file.
A Window is a Widget that handles drawing to a Screen.
Definition window.h:47
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24