Ticket #14976: gst1.0.patch

File gst1.0.patch, 7.6 KB (added by crisb, 5 years ago)

Patch against wxWidgets 3.0.2

  • wxWidgets-3.0.2

    old new  
    75497549        dnl So, we first check to see if 0.10 if available - if not we
    75507550        dnl try the older 0.8 version
    75517551        dnl -------------------------------------------------------------------
    7552         GST_VERSION_MAJOR=0
    7553         GST_VERSION_MINOR=10
     7552        GST_VERSION_MAJOR=1
     7553        GST_VERSION_MINOR=0
    75547554        GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
    75557555
    75567556        if test "$wxUSE_GSTREAMER8" = "no"; then
     
    75587558                [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION],
    75597559                [
    75607560                    wxUSE_GSTREAMER="yes"
    7561                     GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
     7561                    GST_LIBS="$GST_LIBS -lgstvideo-$GST_VERSION"
    75627562                ],
    75637563                [
    75647564                    AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
  • src/unix/mediactrl.cpp

    old new  
    2020#include <gst/gst.h>                // main gstreamer header
    2121
    2222// xoverlay/video stuff, gst-gconf for 0.8
    23 #if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10
     23#if GST_VERSION_MAJOR == 0 || GST_VERSION_MINOR >= 10
    2424#   include <gst/interfaces/xoverlay.h>
     25#elif GST_VERSION_MAJOR == 1
     26#   include <gst/video/videooverlay.h>
    2527#else
    2628#   include <gst/xoverlay/xoverlay.h>
    2729#   include <gst/gconf/gconf.h>        // gstreamer glib configuration
     
    203205    double          m_dRate;        // Current playback rate -
    204206                                    // see GetPlaybackRate for notes
    205207    wxLongLong      m_llPausedPos;  // Paused position - see Pause()
    206     GstXOverlay*    m_xoverlay;     // X Overlay that contains the GST video
     208    GstVideoOverlay*    m_xoverlay;     // X Overlay that contains the GST video
    207209    wxMutex         m_asynclock;    // See "discussion of internals"
    208210    class wxGStreamerMediaEventHandler* m_eventHandler; // see below
    209211
     
    284286{
    285287    // I've seen this recommended somewhere...
    286288    // TODO: Is this needed? Maybe it is just cruft...
    287     // gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(be->m_xoverlay),
     289    // gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY(be->m_xoverlay),
    288290    //                              GDK_WINDOW_XWINDOW( window ) );
    289291
    290292    // If we have actual video.....
     
    294296        // GST Doesn't redraw automatically while paused
    295297        // Plus, the video sometimes doesn't redraw when it looses focus
    296298        // or is painted over so we just tell it to redraw...
    297         gst_x_overlay_expose(be->m_xoverlay);
     299        gst_video_overlay_expose(be->m_xoverlay);
    298300    }
    299301    else
    300302    {
     
    334336    GdkWindow* window = gtk_widget_get_window(widget);
    335337    wxASSERT(window);
    336338
    337     gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(be->m_xoverlay),
     339    gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY(be->m_xoverlay),
    338340                                GDK_WINDOW_XID(window)
    339341                                );
    340342    GtkWidget* w = be->GetControl()->m_wxwindow;
     
    538540    // Pass a non-xwindowid-setting event on to the async handler where it
    539541    // belongs
    540542    if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT ||
    541         !gst_structure_has_name (message->structure, "prepare-xwindow-id"))
     543        !gst_structure_has_name (gst_message_get_structure(message), "prepare-window-handle"))
    542544    {
    543545        //
    544546        // NB: Unfortunately, the async callback can be quite
     
    552554            return GST_BUS_DROP;
    553555    }
    554556
    555     wxLogTrace(wxTRACE_GStreamer, wxT("Got prepare-xwindow-id"));
     557    wxLogTrace(wxTRACE_GStreamer, wxT("Got prepare-window-handle"));
    556558    be->SetupXOverlay();
    557559    return GST_BUS_DROP; // We handled this message - drop from the queue
    558560}
     
    680682//-----------------------------------------------------------------------------
    681683bool wxGStreamerMediaBackend::QueryVideoSizeFromPad(GstPad* pad)
    682684{
    683     const GstCaps* caps = GST_PAD_CAPS(pad);
     685    const GstCaps* caps = gst_pad_get_current_caps(pad);
    684686    if ( caps )
    685687    {
    686688        const GstStructure *s = gst_caps_get_structure (caps, 0);
     
    739741        GdkWindow* window = gtk_widget_get_window(m_ctrl->m_wxwindow);
    740742        wxASSERT(window);
    741743#endif
    742         gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(m_xoverlay),
     744        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(m_xoverlay),
    743745#ifdef __WXGTK__
    744746                        GDK_WINDOW_XID(window)
    745747#else
     
    885887bool wxGStreamerMediaBackend::TryVideoSink(GstElement* videosink)
    886888{
    887889    // Check if the video sink either is an xoverlay or might contain one...
    888     if( !GST_IS_BIN(videosink) && !GST_IS_X_OVERLAY(videosink) )
     890    if( !GST_IS_BIN(videosink) && !GST_IS_VIDEO_OVERLAY(videosink) )
    889891    {
    890892        if(G_IS_OBJECT(videosink))
    891893            g_object_unref(videosink);
     
    896898    // the x overlay enables us to put the video in our control window
    897899    // (i.e. we NEED it!) - also connect to the natural video size change event
    898900    if( GST_IS_BIN(videosink) )
    899         m_xoverlay = (GstXOverlay*)
     901        m_xoverlay = (GstVideoOverlay*)
    900902                        gst_bin_get_by_interface (GST_BIN (videosink),
    901                                                   GST_TYPE_X_OVERLAY);
     903                                                  GST_TYPE_VIDEO_OVERLAY);
    902904    else
    903         m_xoverlay = (GstXOverlay*) videosink;
     905        m_xoverlay = (GstVideoOverlay*) videosink;
    904906
    905     if ( !GST_IS_X_OVERLAY(m_xoverlay) )
     907    if ( !GST_IS_VIDEO_OVERLAY(m_xoverlay) )
    906908    {
    907909        g_object_unref(videosink);
    908910        return false;
     
    11311133    gst_bus_add_watch (gst_element_get_bus(m_playbin),
    11321134                       (GstBusFunc) gst_bus_async_callback, this);
    11331135    gst_bus_set_sync_handler(gst_element_get_bus(m_playbin),
    1134                              (GstBusSyncHandler) gst_bus_sync_callback, this);
     1136                             (GstBusSyncHandler) gst_bus_sync_callback, this, NULL);
    11351137    g_signal_connect(m_playbin, "notify::stream-info",
    11361138                     G_CALLBACK(gst_notify_stream_info_callback), this);
    11371139#endif
     
    14191421        gint64 pos;
    14201422        GstFormat fmtTime = GST_FORMAT_TIME;
    14211423
    1422         if (!wxGst_element_query_position(m_playbin, &fmtTime, &pos) ||
     1424        if (!wxGst_element_query_position(m_playbin, fmtTime, &pos) ||
    14231425            fmtTime != GST_FORMAT_TIME || pos == -1)
    14241426            return 0;
    14251427        return pos / GST_MSECOND ;
     
    14891491    gint64 length;
    14901492    GstFormat fmtTime = GST_FORMAT_TIME;
    14911493
    1492     if(!wxGst_element_query_duration(m_playbin, &fmtTime, &length) ||
     1494    if(!wxGst_element_query_duration(m_playbin, fmtTime, &length) ||
    14931495       fmtTime != GST_FORMAT_TIME || length == -1)
    14941496        return 0;
    14951497    return length / GST_MSECOND ;
     
    15121514// wxGStreamerMediaBackend::GetVideoSize
    15131515//
    15141516// Returns our cached video size from Load/gst_notify_caps_callback
    1515 // gst_x_overlay_get_desired_size also does this in 0.8...
     1517// gst_video_overlay_get_desired_size also does this in 0.8...
    15161518//-----------------------------------------------------------------------------
    15171519wxSize wxGStreamerMediaBackend::GetVideoSize() const
    15181520{
     
    15951597    gint64 length;
    15961598    GstFormat fmtBytes = GST_FORMAT_BYTES;
    15971599
    1598     if (!wxGst_element_query_duration(m_playbin, &fmtBytes, &length) ||
     1600    if (!wxGst_element_query_duration(m_playbin, fmtBytes, &length) ||
    15991601          fmtBytes != GST_FORMAT_BYTES || length == -1)
    16001602        return 0;
    16011603    return length;