On Tue, 2012-08-14 at 22:22 +0200, Dos Santos, Oliveira wrote: > Hi everybody, > > > > I need some help to compile gstreamermm-0.10.10 for MinGW32/64. I’m on > Fedora 17 – x86_64 – with kernel 3.5.1-1. > > > > I followed the usual way to compile for MinGW; > > > > I fix some errors before this one ( in wrap.cc ) but this... i don’t > know how to correct that... I try some stuff without success > especially with pkgconfig path. > Could you say (or provide a patch for) what you fixed?
> > > >mingw32-configure (with and without the pkgconfig path) > > >make... and error ... > > > > That’s my output (the interesting part, I can provide the output of > the configure part) > > > > make: *** [all] Error 2 > > depbase=`echo media_player_gtkmm/player_window.o | sed 's|[^/]* > $|.deps/&|;s|\.o$||'`;\ > > i686-w64-mingw32-g++ -DHAVE_CONFIG_H -I.. -I../gstreamer > -mms-bitfields > -I/usr/i686-w64-mingw32/sys-root/mingw/include/giomm-2.4 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/giomm-2.4/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/glibmm-2.4 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/glibmm-2.4/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/sigc++-2.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/sigc++-2.0/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/libxml++-2.6 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/libxml++-2.6/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/libxml2 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/gstreamer-0.10 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/gtkmm-3.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/gtkmm-3.0/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/atkmm-1.6 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/pangomm-1.4 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/pangomm-1.4/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/gtk-3.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/cairomm-1.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/cairomm-1.0/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/gdk-pixbuf-2.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/gdkmm-3.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/lib/gdkmm-3.0/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/atk-1.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/pango-1.0 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/cairo > -I/usr/i686-w64-mingw32/sys-root/mingw/include/pixman-1 > -I/usr/i686-w64-mingw32/sys-root/mingw/include > -I/usr/i686-w64-mingw32/sys-root/mingw/include/freetype2 > -I/usr/i686-w64-mingw32/sys-root/mingw/include/libpng15 -Wall -O2 > -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions > --param=ssp-buffer-size=4 -MT media_player_gtkmm/player_window.o -MD > -MP -MF $depbase.Tpo -c -o media_player_gtkmm/player_window.o > media_player_gtkmm/player_window.cc &&\ > > mv -f $depbase.Tpo $depbase.Po > > media_player_gtkmm/player_window.cc:27:22: fatal error: gdk/gdkx.h: No > such file or directory > > compilation terminated. > > make[2]: *** [media_player_gtkmm/player_window.o] Error 1 > > make[2]: Leaving directory > `/home/dossantos/App/gstreamermm-0.10.10/examples' > > make[1]: *** [all-recursive] Error 1 > > make[1]: Leaving directory `/home/dossantos/App/gstreamermm-0.10.10' > > make: *** [all] Error 2 > > > > > > Anyone has an idea ? Just a tips to try again :P The problem is that the media player example was written mostly for the Linux platform because that is the main platform for which gstreamermm has been developed. I tweaked the example a little and maybe it can compile under windows with the tweaks. Could you try the attached patch and see if it helps? > > > > Thanks > > > > DSO > > > ______________________________________________________________________ > > ************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. > If you have received this email in error, please notify the system > manager. This footnote also confirms that this email message has been > swept by the mailgateway > ************************************************** > > _______________________________________________ > gtkmm-list mailing list > [email protected] > https://mail.gnome.org/mailman/listinfo/gtkmm-list -- José
>From 1b92757df2cf1180c5acb25fa88f4598afcaa885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alburquerque?= <[email protected]> Date: Wed, 15 Aug 2012 23:06:58 -0400 Subject: [PATCH] Examples: Fix the media player example for MinGW. * examples/media_player_gtkmm/main.cc: * examples/media_player_gtkmm/player_window.cc: * examples/media_player_gtkmm/player_window.h: Modify the code to not use the XImageSink plugin (which is is specific to the Linux Platform). Also include gdk/gdkwin32.h instead of gdk/gdkx.h when compiling for the Windows platform. --- ChangeLog | 11 ++++ examples/media_player_gtkmm/main.cc | 18 +----- examples/media_player_gtkmm/player_window.cc | 76 +++++++++++++++----------- examples/media_player_gtkmm/player_window.h | 7 +-- 4 files changed, 58 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33a35c8..a739ecc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-08-15 José Alburquerque <[email protected]> + + Examples: Fix the media player example for MinGW. + + * examples/media_player_gtkmm/main.cc: + * examples/media_player_gtkmm/player_window.cc: + * examples/media_player_gtkmm/player_window.h: Modify the code to not + use the XImageSink plugin (which is is specific to the Linux + Platform). Also include gdk/gdkwin32.h instead of gdk/gdkx.h when + compiling for the Windows platform. + 2012-07-30 José Alburquerque <[email protected]> Object: Add getter methods for the GMutex lock member. diff --git a/examples/media_player_gtkmm/main.cc b/examples/media_player_gtkmm/main.cc index b52b9fa..4df0f8d 100644 --- a/examples/media_player_gtkmm/main.cc +++ b/examples/media_player_gtkmm/main.cc @@ -19,12 +19,9 @@ #include <gtkmm/main.h> #include <gstreamermm/init.h> #include <gstreamermm/element.h> -#include <gstreamermm/pad.h> -#include <gstreamermm/pipeline.h> // Plug-ins: #include <gstreamermm/playbin2.h> -#include <gstreamermm/ximagesink.h> #include <iostream> #include "player_window.h" @@ -46,21 +43,8 @@ int main(int argc, char** argv) return 1; } - // Create a video sink where video (if any) will be drawn: - Glib::RefPtr<Gst::XImageSink> video_sink = - Gst::XImageSink::create("ximagesink"); - if(!video_sink) - { - std::cerr << "The ximagesink could not be created." << std::endl; - return 1; - } - - // Set the playbin's video-sink property so that our video sink is used - // for video display: - playbin->property_video_sink() = video_sink; - //Create our player window and give it the pipeline and video sink: - PlayerWindow mainWindow(playbin, video_sink); + PlayerWindow mainWindow(playbin); kit.run(mainWindow); // Clean up nicely: diff --git a/examples/media_player_gtkmm/player_window.cc b/examples/media_player_gtkmm/player_window.cc index 37b467d..719594f 100644 --- a/examples/media_player_gtkmm/player_window.cc +++ b/examples/media_player_gtkmm/player_window.cc @@ -18,7 +18,14 @@ #include <gtkmm/stock.h> #include <gtkmm/filechooserdialog.h> + +#ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> +#endif +#ifdef GDK_WINDOWING_WIN32 +#include <gdk/gdkwin32.h> +#endif + #include <gstreamermm/bus.h> #include <gstreamermm/caps.h> #include <gstreamermm/clock.h> @@ -36,8 +43,7 @@ #include <iomanip> #include "player_window.h" -PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin2>& playbin, - const Glib::RefPtr<Gst::Element>& video_sink) +PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin2>& playbin) : m_vbox(false, 6), m_progress_label("000:00:00.000000000 / 000:00:00.000000000"), m_play_button(Gtk::Stock::MEDIA_PLAY), @@ -108,8 +114,10 @@ PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin2>& playbin, m_rewind_button.set_sensitive(false); m_forward_button.set_sensitive(false); - m_play_bin = playbin; - m_video_sink = video_sink; + m_playbin = playbin; + + m_playbin->signal_video_changed().connect( + sigc::mem_fun(*this, &PlayerWindow::on_video_changed) ); show_all_children(); m_pause_button.hide(); @@ -120,7 +128,12 @@ void PlayerWindow::on_video_area_realize() // When the video area (the drawing area) is realized, Get its X Window // ID and save it for when the Gst::XOverlay is ready to accept an ID in // which to draw the video. +#ifdef GDK_WINDOWING_X11 m_x_window_id = GDK_WINDOW_XID(m_video_area.get_window()->gobj()); +#endif +#ifdef GDK_WINDOWING_WIN32 + m_x_window_id = GDK_WINDOW_HWND(m_video_area.get_window()->gobj()); +#endif } // This function is used to receive asynchronous messages from mainPipeline's @@ -183,6 +196,20 @@ bool PlayerWindow::on_bus_message(const Glib::RefPtr<Gst::Bus>& /* bus */, return true; } +void PlayerWindow::on_video_changed() +{ + Glib::RefPtr<Gst::Pad> pad = m_playbin->get_video_pad(0); + if(pad) + { + // Add a buffer probe to the video sink pad which will be removed after + // the first buffer is received in the on_video_pad_got_buffer method. + // When the first buffer arrives, the video size can be extracted. + m_pad_probe_id = pad->add_buffer_probe( + sigc::mem_fun(*this, &PlayerWindow::on_video_pad_got_buffer)); + std::cout << "There is no pad available." << std::endl; + } +} + bool PlayerWindow::on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObject>& data) { @@ -236,7 +263,7 @@ void PlayerWindow::on_button_play() sigc::mem_fun(*this, &PlayerWindow::on_timeout), 200); // set the pipeline to play mode: - m_play_bin->set_state(Gst::STATE_PLAYING); + m_playbin->set_state(Gst::STATE_PLAYING); } void PlayerWindow::on_button_pause() @@ -251,7 +278,7 @@ void PlayerWindow::on_button_pause() m_timeout_connection.disconnect(); // Set the pipeline to pause mode: - m_play_bin->set_state(Gst::STATE_PAUSED); + m_playbin->set_state(Gst::STATE_PAUSED); } void PlayerWindow::on_button_stop() @@ -271,27 +298,18 @@ void PlayerWindow::on_button_stop() m_timeout_connection.disconnect(); // Set the pipeline to inactive mode: - m_play_bin->set_state(Gst::STATE_NULL); + m_playbin->set_state(Gst::STATE_NULL); // Reset the display: display_label_progress(0, m_duration); m_progress_scale.set_value(0); - - // Remove video sink pad buffer probe if after playing, probe id is - // not zero (means probe was not removed because media had no video and - // video_pad_got_buffer method never got a chance to remove probe) - if(m_pad_probe_id != 0) - { - m_video_sink->get_static_pad("sink")->remove_buffer_probe(m_pad_probe_id); - m_pad_probe_id = 0; - } } bool PlayerWindow::on_scale_value_changed(Gtk::ScrollType /* type_not_used */, double value) { const gint64 newPos = gint64(value * m_duration); - if(m_play_bin->seek(Gst::FORMAT_TIME, Gst::SEEK_FLAG_FLUSH, newPos)) + if(m_playbin->seek(Gst::FORMAT_TIME, Gst::SEEK_FLAG_FLUSH, newPos)) { display_label_progress(newPos, m_duration); return true; @@ -310,11 +328,11 @@ void PlayerWindow::on_button_rewind() gint64 pos = 0; Gst::Format fmt = Gst::FORMAT_TIME; - if(m_play_bin->query_position(fmt, pos)) + if(m_playbin->query_position(fmt, pos)) { gint64 newPos = (pos > skipAmount) ? (pos - skipAmount) : 0; - if(m_play_bin->seek(Gst::FORMAT_TIME, Gst::SEEK_FLAG_FLUSH, newPos)) + if(m_playbin->seek(Gst::FORMAT_TIME, Gst::SEEK_FLAG_FLUSH, newPos)) { m_progress_scale.set_value(double(newPos) / m_duration); display_label_progress(newPos, m_duration); @@ -332,7 +350,7 @@ void PlayerWindow::on_button_forward() Glib::RefPtr<Gst::Query> query = Gst::QueryPosition::create(fmt); - if(m_play_bin->query(query)) + if(m_playbin->query(query)) { Glib::RefPtr<Gst::QueryPosition> posQuery = Glib::RefPtr<Gst::QueryPosition>::cast_dynamic(query); @@ -349,7 +367,7 @@ void PlayerWindow::on_button_forward() Glib::RefPtr<Gst::EventSeek> seekEvent = Glib::RefPtr<Gst::EventSeek>::cast_dynamic(event); - if(Glib::RefPtr<Gst::Element>::cast_static(m_play_bin)->send_event(event)) + if(Glib::RefPtr<Gst::Element>::cast_static(m_playbin)->send_event(event)) { m_progress_scale.set_value(double(newPos) / m_duration); display_label_progress(newPos, m_duration); @@ -376,20 +394,12 @@ void PlayerWindow::on_button_open() working_dir = chooser.get_current_folder(); // Set uri property on the playbin. - m_play_bin->property_uri() = chooser.get_uri(); + m_playbin->property_uri() = chooser.get_uri(); // Resize m_video_area and window to minimum when opening a file m_video_area.set_size_request(0, 0); resize(1, 1); - // Add buffer probe to video sink pad when file is opened which will - // be removed after first buffer is received in on_video_pad_got_buffer - // method (if there's video). When first buffer arrives, video - // size can be extracted. If there's no video, probe will be - // removed when media stops in on_button_stop method - m_pad_probe_id = m_video_sink->get_static_pad("sink")->add_buffer_probe( - sigc::mem_fun(*this, &PlayerWindow::on_video_pad_got_buffer)); - set_title( Glib::filename_display_basename(chooser.get_filename()) ); m_play_button.set_sensitive(); @@ -402,8 +412,8 @@ bool PlayerWindow::on_timeout() Gst::Format fmt = Gst::FORMAT_TIME; gint64 pos = 0; - if(m_play_bin->query_position(fmt, pos) - && m_play_bin->query_duration(fmt, m_duration)) + if(m_playbin->query_position(fmt, pos) + && m_playbin->query_duration(fmt, m_duration)) { m_progress_scale.set_value(double(pos) / m_duration); display_label_progress(pos, m_duration); @@ -434,5 +444,5 @@ void PlayerWindow::display_label_progress(gint64 pos, gint64 len) PlayerWindow::~PlayerWindow() { - m_play_bin->get_bus()->remove_watch(m_watch_id); + m_playbin->get_bus()->remove_watch(m_watch_id); } diff --git a/examples/media_player_gtkmm/player_window.h b/examples/media_player_gtkmm/player_window.h index aeaf17e..b93e16a 100644 --- a/examples/media_player_gtkmm/player_window.h +++ b/examples/media_player_gtkmm/player_window.h @@ -35,9 +35,8 @@ class PlayerWindow : public Gtk::Window public: /** * @param playbin The pipeline that can play media files. - * @param video_sink The video sink to use to display stream video (if any). */ - PlayerWindow(const Glib::RefPtr<Gst::PlayBin2>& playbin, const Glib::RefPtr<Gst::Element>& video_sink); + PlayerWindow(const Glib::RefPtr<Gst::PlayBin2>& playbin); virtual ~PlayerWindow(); protected: @@ -46,6 +45,7 @@ protected: void on_video_area_realize(); void on_bus_message_sync(const Glib::RefPtr<Gst::Message>& message); bool on_bus_message(const Glib::RefPtr<Gst::Bus>& bus, const Glib::RefPtr<Gst::Message>& message); + void on_video_changed(); bool on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::MiniObject>& buffer); void on_button_play(); @@ -72,8 +72,7 @@ protected: Gtk::Button m_forward_button; Gtk::Button m_open_button; - Glib::RefPtr<Gst::PlayBin2> m_play_bin; - Glib::RefPtr<Gst::Element> m_video_sink; + Glib::RefPtr<Gst::PlayBin2> m_playbin; sigc::connection m_timeout_connection; guint m_watch_id; gint64 m_duration; -- 1.7.9.5
_______________________________________________ gtkmm-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/gtkmm-list
