gnomemm r1942 - in gstreamermm/trunk: . examples/ogg_player_gtkmm
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1942 - in gstreamermm/trunk: . examples/ogg_player_gtkmm
- Date: Sun, 4 Jan 2009 04:10:25 +0000 (UTC)
Author: jaalburqu
Date: Sun Jan 4 04:10:25 2009
New Revision: 1942
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1942&view=rev
Log:
2009-01-03 Josà Alburquerque <jaalburqu svn gnome org>
* examples/ogg_player_gtkmm/main.cc: Modified example to use plug-ins.
I'm wondering if it wouldn't be easier if all classes and plug-ins
would be in the Gst namespace. It seems that just because there's a
packaging separation between core and base in GStreamer, it doesn't
have to "seep" into the logic of namespaces, etc. I may have to ask
on the list or get a better opinion from others with more experience.
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/examples/ogg_player_gtkmm/main.cc
Modified: gstreamermm/trunk/examples/ogg_player_gtkmm/main.cc
==============================================================================
--- gstreamermm/trunk/examples/ogg_player_gtkmm/main.cc (original)
+++ gstreamermm/trunk/examples/ogg_player_gtkmm/main.cc Sun Jan 4 04:10:25 2009
@@ -20,12 +20,18 @@
*/
#include <gtkmm/main.h>
-#include <gstreamermm/init.h>
+#include <gstreamerbasemm/init.h>
#include <gstreamermm/element.h>
-#include <gstreamermm/elementfactory.h>
#include <gstreamermm/pad.h>
#include <gstreamermm/pipeline.h>
+
+// Plug-ins
#include <gstreamermm/filesrc.h>
+#include <gstreamerbasemm/oggdemux.h>
+#include <gstreamerbasemm/vorbisdec.h>
+#include <gstreamerbasemm/audioconvert.h>
+#include <gstreamerbasemm/alsasink.h>
+
#include <iostream>
#include "player_window.h"
@@ -51,7 +57,7 @@
main (int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
- Gst::init(argc, argv);
+ GstBase::init(argc, argv);
// Create the pipeline
pipeline = Gst::Pipeline::create("audio-player");
@@ -66,7 +72,7 @@
}
// Parses the ogg streams into elementary streams (note that an ogg file may contain a video stream too)
- Glib::RefPtr<Gst::Element> parser = Gst::ElementFactory::create_element("oggdemux");
+ Glib::RefPtr<GstBase::OggDemux> parser = GstBase::OggDemux::create();
if(!parser)
{
std::cerr << "oggdemux element could not be created" << std::endl;
@@ -74,7 +80,7 @@
}
// Decodes a vorbis stream
- decoder = Gst::ElementFactory::create_element("vorbisdec");
+ decoder = GstBase::VorbisDec::create();
if(!decoder)
{
std::cerr << "vorbisdec element could not be created" << std::endl;
@@ -82,7 +88,7 @@
}
// Converts audio to a format which can be used by the next element
- Glib::RefPtr<Gst::Element> conv = Gst::ElementFactory::create_element("audioconvert");
+ Glib::RefPtr<GstBase::AudioConvert> conv = GstBase::AudioConvert::create();
if(!conv)
{
std::cerr << "audioconvert element could not be created" << std::endl;
@@ -90,7 +96,7 @@
}
// Outputs sound to an ALSA audio device
- Glib::RefPtr<Gst::Element> sink = Gst::ElementFactory::create_element("alsasink");
+ Glib::RefPtr<GstBase::AlsaSink> sink = GstBase::AlsaSink::create();
if(!sink)
{
std::cerr << "sink element could not be created" << std::endl;
@@ -135,4 +141,4 @@
pipeline->set_state(Gst::STATE_NULL);
return 0;
-}
+}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]