QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | List of all members
QGst::Ui::VideoWidget Class Reference

#include <QGst/Ui/VideoWidget>

Inherits QWidget.

Public Member Functions

 VideoWidget (QWidget *parent=0, Qt::WindowFlags f=0)
ElementPtr videoSink () const
void setVideoSink (const ElementPtr &sink)
void releaseVideoSink ()
void watchPipeline (const PipelinePtr &pipeline)
void stopPipelineWatch ()

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)

Detailed Description

A generic video widget that can embed a video sink.

This widget allows you to embed a video sink on a Qt user interface.

There are two ways of using this widget:

Nearly all the methods of this class must be called from Qt's GUI thread. Also, you cannot start or stop watching a pipeline that is in PLAYING state. Doing so may crash the widget.

This widget will always keep a strong reference to the element that it is given, whether this is a video sink or a pipeline. If you want to destroy this element or pipeline, you need to call releaseVideoSink() or stopPipelineWatch() respectively.

Autoplug video sinks such as autovideosink are not supported due to the complexity of handling them correctly. If you wish to use autovideosink, you can either set it to READY state and get its child VideoOverlay element or just watch the pipeline in which you plug it.

Definition at line 68 of file videowidget.h.

Member Function Documentation

ElementPtr QGst::Ui::VideoWidget::videoSink ( ) const

Returns the video sink element that is currently providing this widget's image, or a null ElementPtr if no sink has been set.

Definition at line 331 of file videowidget.cpp.

void QGst::Ui::VideoWidget::setVideoSink ( const ElementPtr sink)

Sets the video sink element that is going to be embedded. Any sink that implements the VideoOverlay interface will work, as well as "qtvideosink", "qtglvideosink" and "qwidgetvideosink" (or "qt5videosink", "qt5glvideosink" and "qwidget5videosink" in Qt5)

  • This method must be called from Qt's GUI thread.
  • Passing a null ElementPtr has the same effect as calling releaseVideoSink().
  • You cannot set a new sink if the previous one has not been released first.

Definition at line 336 of file videowidget.cpp.

void QGst::Ui::VideoWidget::releaseVideoSink ( )

Detaches the current video sink from the widget and drops any references to it.

This method must be called from Qt's GUI thread.

Definition at line 353 of file videowidget.cpp.

void QGst::Ui::VideoWidget::watchPipeline ( const PipelinePtr pipeline)

Starts watching a pipeline for any attached VideoOverlay sinks. If such a sink is found while the pipeline prepares itself to start playing, it is embedded to the widget.

  • This method must be called from Qt's GUI thread.
  • Passing a null PipelinePtr has the same effect as calling stopPipelineWatch().
  • You cannot start watching a new pipeline if you don't stop watching the previous one first with stopPipelineWatch().

Definition at line 368 of file videowidget.cpp.

void QGst::Ui::VideoWidget::stopPipelineWatch ( )

Stops watching a pipeline and also detaches the sink that was discovered in the pipeline, if any.

This method must be called from Qt's GUI thread.

Definition at line 381 of file videowidget.cpp.

The documentation for this class was generated from the following files: