|
|
@ -34,7 +34,11 @@
|
|
|
|
#include <tdemenubar.h>
|
|
|
|
#include <tdemenubar.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_GSTREAMER_1
|
|
|
|
|
|
|
|
#include <gst/video/videooverlay.h>
|
|
|
|
|
|
|
|
#else
|
|
|
|
#include <gst/interfaces/xoverlay.h>
|
|
|
|
#include <gst/interfaces/xoverlay.h>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "video.h"
|
|
|
|
#include "video.h"
|
|
|
|
|
|
|
|
|
|
|
@ -67,9 +71,15 @@ void VideoWindow::setPlaybin( GstElement *play )
|
|
|
|
|
|
|
|
|
|
|
|
VideoWindow::~VideoWindow()
|
|
|
|
VideoWindow::~VideoWindow()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef HAVE_GSTREAMER_1
|
|
|
|
|
|
|
|
if ( m_element && GST_IS_VIDEO_OVERLAY(m_element) ) {
|
|
|
|
|
|
|
|
gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY(m_element), 0 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
if ( m_element && GST_IS_X_OVERLAY(m_element) ) {
|
|
|
|
if ( m_element && GST_IS_X_OVERLAY(m_element) ) {
|
|
|
|
gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(m_element), 0 );
|
|
|
|
gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(m_element), 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
gst_object_unref( GST_OBJECT(m_element) );
|
|
|
|
gst_object_unref( GST_OBJECT(m_element) );
|
|
|
|
kdDebug() << "VideoWindow: destructed" << endl;
|
|
|
|
kdDebug() << "VideoWindow: destructed" << endl;
|
|
|
@ -80,10 +90,17 @@ VideoWindow::~VideoWindow()
|
|
|
|
void VideoWindow::refresh()
|
|
|
|
void VideoWindow::refresh()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* expose overlay */
|
|
|
|
/* expose overlay */
|
|
|
|
|
|
|
|
#ifdef HAVE_GSTREAMER_1
|
|
|
|
|
|
|
|
if ( m_element && GST_IS_VIDEO_OVERLAY(m_element) ) {
|
|
|
|
|
|
|
|
gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY (m_element), winId() );
|
|
|
|
|
|
|
|
gst_video_overlay_expose( GST_VIDEO_OVERLAY (m_element) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
if ( m_element && GST_IS_X_OVERLAY(m_element) ) {
|
|
|
|
if ( m_element && GST_IS_X_OVERLAY(m_element) ) {
|
|
|
|
gst_x_overlay_set_xwindow_id( GST_X_OVERLAY (m_element), winId() );
|
|
|
|
gst_x_overlay_set_xwindow_id( GST_X_OVERLAY (m_element), winId() );
|
|
|
|
gst_x_overlay_expose( GST_X_OVERLAY (m_element) );
|
|
|
|
gst_x_overlay_expose( GST_X_OVERLAY (m_element) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -165,7 +182,13 @@ void VideoWindow::newState()
|
|
|
|
if ( !g_strcasecmp(val->value_nick, "video") ) {
|
|
|
|
if ( !g_strcasecmp(val->value_nick, "video") ) {
|
|
|
|
GstCaps *caps;
|
|
|
|
GstCaps *caps;
|
|
|
|
g_object_get( info, "object", &pad, NULL );
|
|
|
|
g_object_get( info, "object", &pad, NULL );
|
|
|
|
if ( (caps=gst_pad_get_negotiated_caps(pad)) ) {
|
|
|
|
if (
|
|
|
|
|
|
|
|
#ifdef HAVE_GSTREAMER_1
|
|
|
|
|
|
|
|
(caps=gst_pad_get_current_caps(pad))
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
(caps=gst_pad_get_negotiated_caps(pad))
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
) {
|
|
|
|
newCapsset( caps );
|
|
|
|
newCapsset( caps );
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|