| 1 | /* gstreamermm - a C++ wrapper for gstreamer |
| 2 | * |
| 3 | * Copyright 2008 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 <gstreamermm.h>cxx . . $ `<file>/gstreamer/gstreamermm.h`/ |
| 20 | #include <glibmm/optioncontext.h> |
| 21 | #include <iostream> |
| 22 | |
| 23 | Glibcxx . . $ Glib/::OptionEntrycxx . . $ Glib/OptionEntry# make_entrycxx . . $ make_entry(198cb54dcdd3a22a).(const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& long_name, const gchar& short_name, const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& description) |
| 24 | { |
| 25 | Glibcxx . . $ Glib/::OptionEntrycxx . . $ Glib/OptionEntry# m_OptionEntrycxx . . $ Glib/OptionEntry#OptionEntry(49f6e7a06ebc5aa8).; |
| 26 | |
| 27 | if(!long_name.emptycxx . . $ Glib/ustring#empty(50ce9a9e25b4a850).()) |
| 28 | m_OptionEntry.set_long_namecxx . . $ Glib/OptionEntry#set_long_name(1ff0bff2cee2bc51).(long_name); |
| 29 | if(short_name) |
| 30 | m_OptionEntry.set_short_namecxx . . $ Glib/OptionEntry#set_short_name(3a781f7493a9de53).(short_name); |
| 31 | if(!description.emptycxx . . $ Glib/ustring#empty(50ce9a9e25b4a850).()) |
| 32 | m_OptionEntry.set_descriptioncxx . . $ Glib/OptionEntry#set_description(1ff0bff2cee2bc51).(description); |
| 33 | |
| 34 | return m_OptionEntrycxx . . $ Glib/OptionEntry#OptionEntry(d4ef931d3bb60b69).; |
| 35 | } |
| 36 | |
| 37 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char** argv) |
| 38 | { |
| 39 | bool silent = false; |
| 40 | stdcxx . . $ std/::stringcxx . . $ std/string# pathcxx . . $ std/__cxx11/basic_string#basic_string(49f6e7a06ebc5aa8).; |
| 41 | |
| 42 | Glibcxx . . $ Glib/::OptionGroupcxx . . $ Glib/OptionGroup# m_OptionGroupcxx . . $ Glib/OptionGroup#OptionGroup(f948be184e2e3cb5).("name"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9)., "description"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9)., "help description"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 43 | Glibcxx . . $ Glib/::OptionContextcxx . . $ Glib/OptionContext# m_OptionContextcxx . . $ Glib/OptionContext#OptionContext(1ff0bff2cee2bc51).("- Your application"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 44 | |
| 45 | m_OptionGroup.add_entrycxx . . $ Glib/OptionGroup#add_entry(82a211dd781d3387).(make_entrycxx . . $ make_entry(198cb54dcdd3a22a).("silent"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9)., 's', "do not output status information"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), silent); |
| 46 | m_OptionGroup.add_entry_filenamecxx . . $ Glib/OptionGroup#add_entry_filename(7365f4391a672a79).(make_entrycxx . . $ make_entry(198cb54dcdd3a22a).("output"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9)., 'o', "save xml representation of pipeline to file and exit"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), path); |
| 47 | |
| 48 | m_OptionContext.set_main_groupcxx . . $ Glib/OptionContext#set_main_group(1fb11a164371f342).(m_OptionGroup); |
| 49 | |
| 50 | Glibcxx . . $ Glib/::OptionGroupcxx . . $ Glib/OptionGroup# m_GstOptiongroup = Gstcxx . . $ Glib/OptionGroup#OptionGroup(f3768ed7fee6ab8).::get_option_groupcxx . . $ Gst/get_option_group(736c17c952ba4903).(); |
| 51 | m_OptionContext.add_groupcxx . . $ Glib/OptionContext#add_group(1fb11a164371f342).(m_GstOptiongroup); |
| 52 | |
| 53 | try |
| 54 | { |
| 55 | m_OptionContext.parsecxx . . $ Glib/OptionContext#parse(82fa2dc335b2ba4e).(argc, argv); |
| 56 | } |
| 57 | catch(const Glibcxx . . $ Glib/::OptionErrorcxx . . $ Glib/OptionError#& error) |
| 58 | { |
| 59 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Failed to initialize: " <<cxx . . $ Glib/`operator<<`(d3a65685b7328161). error.whatcxx . . $ Glib/Error#what(fff0f585954e56f3).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 60 | return 1; |
| 61 | } |
| 62 | |
| 63 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Run me with --help to see the Application options appended.\n"; |
| 64 | return 0; |
| 65 | } |