Debian Codegraph @

examples/media_player_gtkmm/main.cc

raw symbols SCIP
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2015 The gstreamermm Development Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #include "player_window.h"
20
21 #include <gtkmm.h>
22 #include <gstreamermm.h>
23
24 #include <iostream>
25
26 int main (int argc, char **argv)
27 {
28 Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.gstreamermm.gtkmm-media-player");
29 Gst::init(argc, argv);
30
31 // playbin plays any media type, choosing an appropriate set of elements
32 // and linking them together.
33 #ifndef GSTREAMERMM_DISABLE_DEPRECATED
34 Glib::RefPtr<Gst::PlayBin> playbin = Gst::PlayBin::create("playbin");
35 #else
36 Glib::RefPtr<Gst::Element> playbin = Gst::ElementFactory::create_element("playbin");
37 #endif
38
39 if(!playbin)
40 {
41 std::cerr << "The playbin could not be created." << std::endl;
42 return 1;
43 }
44
45 //Create our player window and give it the pipeline and video sink:
46 PlayerWindow player(playbin);
47
48 return app->run(player);
49 }