[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/rc.cpp libbase/rc.h lib...
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/rc.cpp libbase/rc.h lib... |
Date: |
Wed, 20 Feb 2008 19:04:00 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Bastiaan Jacques <bjacques> 08/02/20 19:03:59
Modified files:
. : ChangeLog
libbase : rc.cpp rc.h
libmedia : Makefile.am
libmedia/gst : SoundGst.cpp SoundGst.h gstflvdemux.c
server/asobj : NetStreamGst.cpp
Added files:
libmedia/gst : GstUtil.cpp GstUtil.h gnash_gst_version.h
Removed files:
libmedia/gst : gstappbuffer.c gstappbuffer.h
Log message:
* libbase/rc.{cpp,h}: Add a configuration item for the gstreamer
audiosink. It is possible to use a pipeline in the configuration
option similar to gst-launch. Implementation by Sean McNamara
<address@hidden> (committed with some small modifications).
* libmedia/gst/GstUtil.{cpp,h}: Static Gstreamer utility class.
* libmedia/gst/SoundGst.cpp: Use the configuration audio output
pipeline.
* server/asobj/NetStreamGst.cpp: Likewise, and don't attempt to
load
the flvdemux element, since it's loaded statically.
* libmedia/gst/gstflvdemux.c: Make sure that the element name
doesn't
conflict with an existing flvdemux.
* libmedia/gst/gnash_gst_version.h: Utility macros for dealing
with
Gstreamer versions. Unused for now.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5709&r2=1.5710
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.h?cvsroot=gnash&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/Makefile.am?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/SoundGst.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/SoundGst.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/gstflvdemux.c?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/GstUtil.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/GstUtil.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/gnash_gst_version.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/gstappbuffer.c?cvsroot=gnash&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/gstappbuffer.h?cvsroot=gnash&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.79&r2=1.80
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5709
retrieving revision 1.5710
diff -u -b -r1.5709 -r1.5710
--- ChangeLog 20 Feb 2008 17:43:17 -0000 1.5709
+++ ChangeLog 20 Feb 2008 19:03:57 -0000 1.5710
@@ -1,3 +1,19 @@
+2008-02-20 Bastiaan Jacques <address@hidden>
+
+ * libbase/rc.{cpp,h}: Add a configuration item for the gstreamer
+ audiosink. It is possible to use a pipeline in the configuration
+ option similar to gst-launch. Implementation by Sean McNamara
+ <address@hidden> (committed with some small modifications).
+ * libmedia/gst/GstUtil.{cpp,h}: Static Gstreamer utility class.
+ * libmedia/gst/SoundGst.cpp: Use the configuration audio output
+ pipeline.
+ * server/asobj/NetStreamGst.cpp: Likewise, and don't attempt to load
+ the flvdemux element, since it's loaded statically.
+ * libmedia/gst/gstflvdemux.c: Make sure that the element name doesn't
+ conflict with an existing flvdemux.
+ * libmedia/gst/gnash_gst_version.h: Utility macros for dealing with
+ Gstreamer versions. Unused for now.
+
2008-02-20 Sandro Santilli <address@hidden>
* server/vm/ASHandlers.cpp (CommonGetUrl): revert the
Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- libbase/rc.cpp 19 Feb 2008 08:04:28 -0000 1.62
+++ libbase/rc.cpp 20 Feb 2008 19:03:57 -0000 1.63
@@ -417,6 +417,11 @@
continue;
}
+ if(noCaseCompare(variable, "GSTAudioSink")) {
+ _gstaudiosink = value;
+ continue;
+ }
+
if (noCaseCompare(variable, "flashSystemOS")) {
_flashSystemOS = value;
continue;
@@ -626,6 +631,7 @@
cmd << "flashSystemOS " << _flashSystemOS << endl <<
cmd << "flashVersionString " << _flashVersionString << endl <<
cmd << "urlOpenerFormat " << _urlOpenerFormat << endl <<
+ cmd << "GSTAudioSink " << _gstaudiosink << endl <<
cmd << "SOLSafeDir " << _solsandbox << endl;
// Lists. These can't be handled very well at the moment. The main
@@ -754,6 +760,11 @@
if (_flashVersionString.size()) {
cerr << "\tFlash Version String is: " << _flashVersionString << endl;
}
+
+ if(!_gstaudiosink.empty()) {
+ cerr << "\tGST Audio Sink is: " << _gstaudiosink << endl;
+ }
+
cerr << "\tWhitelist: ";
writeList (_whitelist, cerr);
Index: libbase/rc.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- libbase/rc.h 19 Feb 2008 08:04:28 -0000 1.45
+++ libbase/rc.h 20 Feb 2008 19:03:58 -0000 1.46
@@ -170,6 +170,9 @@
const std::string& getFlashSystemManufacturer() const { return
_flashSystemManufacturer; }
void setFlashSystemManufacturer(std::string& value) {
_flashSystemManufacturer = value; }
+ const std::string& getGstAudioSink() const { return _gstaudiosink; }
+ void setGstAudioSink(const std::string& value) { _gstaudiosink = value; }
+
int getRetries() const { return _retries; }
void setRetries(int x) { _retries = x; }
@@ -242,6 +245,9 @@
/// String to pass as $version in Actionscript
std::string _flashVersionString;
+ /// String representing the first GStreamer audio output pipeline to try
+ std::string _gstaudiosink;
+
/// String to pass as System.capabilities.os
/// in Actionscript. If empty, leaves detection
/// to System.cpp (default).
Index: libmedia/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/libmedia/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- libmedia/Makefile.am 8 Feb 2008 15:27:30 -0000 1.12
+++ libmedia/Makefile.am 20 Feb 2008 19:03:58 -0000 1.13
@@ -100,10 +100,10 @@
libgnashmedia_la_SOURCES += \
gst/VideoDecoderGst.cpp \
gst/AudioDecoderGst.cpp \
- gst/gstappbuffer.c \
gst/gstappsink.c \
gst/gstappsrc.c \
gst/SoundHandlerGst.cpp \
+ gst/GstUtil.cpp \
gst/SoundGst.cpp \
gst/MediaDecoderGst.cpp \
gst/gstflvdemux.c \
@@ -111,17 +111,18 @@
gst/gstbuffersrc.c
noinst_HEADERS += \
- gst/gstappbuffer.h \
gst/AudioDecoderGst.h \
gst/VideoDecoderGst.h \
gst/gstappsink.h \
gst/gstappsrc.h \
gst/SoundHandlerGst.h \
+ gst/GstUtil.h \
gst/SoundGst.h \
gst/MediaDecoderGst.h \
gst/gstflvdemux.h \
gst/gstflvparse.h \
- gst/gstbuffersrc.h
+ gst/gstbuffersrc.h \
+ gst/gnash_gst_version.h
libgnashmedia_la_CPPFLAGS += \
$(GSTREAMER_CFLAGS)
Index: libmedia/gst/SoundGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/SoundGst.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libmedia/gst/SoundGst.cpp 12 Feb 2008 11:54:42 -0000 1.7
+++ libmedia/gst/SoundGst.cpp 20 Feb 2008 19:03:58 -0000 1.8
@@ -46,6 +46,7 @@
// * Implement "envelopes" (not so easy)
#include "SoundGst.h"
+#include "GstUtil.h"
#include <iostream>
#include "log.h"
#include "AudioDecoderNellymoser.h"
@@ -437,7 +438,11 @@
_volume = gst_element_factory_make ("volume", NULL);
- GstElement* audiosink = gst_element_factory_make ("autoaudiosink", NULL);
+ GstElement* audiosink = GstUtil::get_audiosink_element();
+
+ if(!audiosink) {
+ log_error(_("Failed to make a valid audio sink."));
+ }
gboolean success;
if (decoder) {
@@ -546,8 +551,6 @@
}
-
-
} // namespace media
} // namespace gnash
Index: libmedia/gst/SoundGst.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/SoundGst.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libmedia/gst/SoundGst.h 8 Feb 2008 15:27:31 -0000 1.1
+++ libmedia/gst/SoundGst.h 20 Feb 2008 19:03:58 -0000 1.2
@@ -74,8 +74,6 @@
void handleMessage (GstMessage *message);
-
-
bool needDecoder();
void setLoopCount(int count);
Index: libmedia/gst/gstflvdemux.c
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/gstflvdemux.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libmedia/gst/gstflvdemux.c 22 Jan 2008 04:24:14 -0000 1.4
+++ libmedia/gst/gstflvdemux.c 20 Feb 2008 19:03:59 -0000 1.5
@@ -1190,9 +1190,9 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
- GST_DEBUG_CATEGORY_INIT (flvdemux_debug, "flvdemux", 0, "FLV demuxer");
+ GST_DEBUG_CATEGORY_INIT (flvdemux_debug, "gnash_flvdemux", 0, "FLV demuxer");
- if (!gst_element_register (plugin, "flvdemux", GST_RANK_PRIMARY,
+ if (!gst_element_register (plugin, "gnash_flvdemux", GST_RANK_PRIMARY+1,
gst_flv_demux_get_type ()))
return FALSE;
@@ -1200,5 +1200,5 @@
}
GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR,
- "flvdemux", "Element demuxing FLV stream",
+ "gnash_flvdemux", "Element demuxing FLV stream",
plugin_init, VERSION, "LGPL", "Gnash's internal copy of flvdemux", "Gnash")
Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- server/asobj/NetStreamGst.cpp 19 Feb 2008 19:20:55 -0000 1.79
+++ server/asobj/NetStreamGst.cpp 20 Feb 2008 19:03:59 -0000 1.80
@@ -28,6 +28,7 @@
#include "Object.h"
#include "gstflvdemux.h"
#include <gst/gstelement.h>
+#include <GstUtil.h>
// video -> ffmpegcolorspace ->
capsfilter -> fakesink
@@ -49,20 +50,6 @@
_videobin = gst_bin_new(NULL);
- // Figure out if flvdemux is present on the system. If not load the one from
- // the Gnash tree.
- GstElementFactory* factory = gst_element_factory_find ("flvdemux");
- if (!factory) {
- if (!gst_element_register (NULL, "flvdemux", GST_RANK_PRIMARY,
- gst_flv_demux_get_type ())) {
- log_error("Failed to register our own FLV demuxer. FLV playback may not "
- "work.");
- }
- } else {
- gst_object_unref(GST_OBJECT(factory));
- }
-
-
// Setup general decoders
_dataqueue = gst_element_factory_make ("queue", "gnash_dataqueue");
g_signal_connect (_dataqueue, "underrun", G_CALLBACK
(NetStreamGst::queue_underrun_cb), this);
@@ -134,8 +121,14 @@
GstElement* audioconvert = gst_element_factory_make ("audioconvert", NULL);
GstElement* audiosink;
+
if (get_sound_handler()) {
- audiosink = gst_element_factory_make ("autoaudiosink", NULL);
+
+ audiosink = gnash::media::GstUtil::get_audiosink_element();
+
+ if(!audiosink) {
+ log_error(_("Failed to make a valid audio sink."));
+ }
} else {
audiosink = gst_element_factory_make ("fakesink", NULL);
}
Index: libmedia/gst/GstUtil.cpp
===================================================================
RCS file: libmedia/gst/GstUtil.cpp
diff -N libmedia/gst/GstUtil.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libmedia/gst/GstUtil.cpp 20 Feb 2008 19:03:58 -0000 1.1
@@ -0,0 +1,123 @@
+// GstUtil.cpp: Generalized Gstreamer utilities for pipeline configuration.
+//
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+/* $Id: GstUtil.cpp,v 1.1 2008/02/20 19:03:58 bjacques Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#ifdef SOUND_GST
+
+#include "GstUtil.h"
+#include "log.h"
+
+#include <gst/gst.h>
+
+using namespace boost;
+
+namespace gnash {
+namespace media {
+
+GstElement* GstUtil::get_audiosink_element()
+{
+ //MUST be static to get a numbered name for each non-trivial pipeline
created
+ static int numGnashRcSinks = 0;
+
+ /*These MAY be static for CPU optimization
+ *But, the memory cost at global scope is probably
+ *worse overall than the CPU cost at initialization time.*/
+ const std::string GNASHRCSINK = "gnashrcsink";
+ const std::string sAudioSink =
+ RcInitFile::getDefaultInstance().getGstAudioSink();
+
+ //Can't be static. One of these must be created for each call
+ GstElement* element;
+
+ if(sAudioSink.find('!') != std::string::npos) //Found a non-trivial
pipeline - bin it
+ {
+ element = gst_parse_bin_from_description(sAudioSink.c_str(), true,
NULL);
+ if(element != NULL)
+ {
+ std::ostringstream o;
+ o << numGnashRcSinks++;
+ gst_element_set_name(element, (GNASHRCSINK + o.str()).c_str());
+ }
+ }
+ else //Found a trivial pipeline that doesn't need a bin
+ {
+ element = gst_element_factory_make(sAudioSink.c_str(), NULL);
+ }
+
+ if(!element)
+ {
+ log_debug(_("Unable to retrieve a valid audio sink from ~/.gnashrc"));
+
+ element = gst_element_factory_make("autoaudiosink", NULL);
+
+ if(!element)
+ {
+ log_debug(_("Unable to retrieve a valid audio sink from
autoaudiosink"));
+
+ element = gst_element_factory_make("gconfaudiosink", NULL);
+
+ if(!element)
+ log_error(_("Unable to retrieve a valid audio sink from
gconfaudiosink\n%s"),
+ _("Sink search exhausted: you won't be able to hear
sound!"));
+ }
+ }
+
+ if(element)
+ {
+ log_debug(_("Got a non-NULL audio sink; its wrapper name is: %s"),
_(GST_ELEMENT_NAME(element)));
+ }
+
+ return element;
+}
+
+
+// FIXME: decide on a single style for this file...
+void
+GstUtil::ensure_plugin_registered(const char* name, GType type)
+{
+ GstElementFactory* factory = gst_element_factory_find (name);
+
+ if (!factory) {
+ if (!gst_element_register (NULL, name, GST_RANK_PRIMARY,
+ type)) {
+ log_error("Failed to register our plugin %s. This may inhibit media "
+ "playback.", name);
+ }
+ } else {
+ gst_object_unref(GST_OBJECT(factory));
+ }
+
+ log_debug("element %s should now be registered", name);
+}
+
+
+} // gnash.media namespace
+} // namespace gnash
+
+#endif // GST_UTIL
+
+// Local Variables:
+// mode: C++
+// End:
+
Index: libmedia/gst/GstUtil.h
===================================================================
RCS file: libmedia/gst/GstUtil.h
diff -N libmedia/gst/GstUtil.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libmedia/gst/GstUtil.h 20 Feb 2008 19:03:58 -0000 1.1
@@ -0,0 +1,79 @@
+// GstUtil.h: Generalized Gstreamer utilities for pipeline configuration.
+//
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+// $Id: GstUtil.h,v 1.1 2008/02/20 19:03:58 bjacques Exp $
+
+#ifndef _GSTUTIL_H
+#define _GSTUTIL_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "log.h"
+#include <rc.h>
+
+#include <gst/gst.h>
+#include "image.h"
+
+namespace gnash {
+namespace media {
+
+/// \brief Generalized Gstreamer utilities for pipeline configuration.
+/// WARNING: This class is not guaranteed to be thread-safe.
+class GstUtil {
+
+public:
+
+ /**
+ * \brief Returns a pointer to GstElement representing a user-configurable
+ * audio sink, or NULL if such a sink could not be created.
+ *
+ * get_audiosink_element() tries the following strategies to get an audiosink:
+ * 1. Looks into ~/.gnashrc for a pipeline description given by the property
+ * GSTAudioSink
+ * 2. If none (or invalid) is found, tries "autoaudiosink"
+ * 3. If autoaudiosink comes up blank, tries "gconfaudiosink"
+ * 4. If gconfaudiosink can't produce a non-NULL element, the method returns
+ * NULL.
+ *
+ * A pipeline description is specified in one of two ways in ~/.gnashrc:
+ * 1. A "trivial" pipeline is simply the name of an element, like "fakesink"
+ * 2. A "non-trivial" pipeline is a full sub-pipeline specification, given
+ * in a way that complies with the gst-launch manual page. The audiosink's
+ * sub-pipeline must accept x/raw-{int,float} data and feed it into a sink.
+ * The entire audiosink will be placed in a GstBin named "gnashrcsink" with
+ * a number based on the number of gnashrcsinks that have been allocated so
+ * far.
+ */
+ static GstElement* get_audiosink_element();
+
+ static void ensure_plugin_registered(const char* name, GType type);
+
+private:
+
+ GstUtil();
+ ~GstUtil();
+};
+
+} // media namespace
+} // gnash namespace
+
+
+#endif /* _GSTUTIL_H */
+
Index: libmedia/gst/gnash_gst_version.h
===================================================================
RCS file: libmedia/gst/gnash_gst_version.h
diff -N libmedia/gst/gnash_gst_version.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libmedia/gst/gnash_gst_version.h 20 Feb 2008 19:03:59 -0000 1.1
@@ -0,0 +1,53 @@
+/* GStreamer
+ * Copyright (C) 1999,2000 Erik Walthinsen <address@hidden>
+ * 2000 Wim Taymans <address@hidden>
+ *
+ * gstversion.h: Version information for GStreamer
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * NOTE: this file is derived from gst/gstversion.h. However, since no
+ * nontrivial modifications were made it does not meet the originality
+ * requirements for copyrightability of derivative works. The copyright
+ * of this file, therefore, remains with the original authors.
+ */
+
+#ifndef __GNASH_GST_VERSION_H__
+#define __GNASH_GST_VERSION_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#ifndef GST_CHECK_VERSION
+#define GST_CHECK_VERSION(major,minor,micro) \
+ (GST_VERSION_MAJOR > (major) || \
+ (GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR > (minor)) || \
+ (GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR == (minor) && \
+ GST_VERSION_MICRO >= (micro)))
+#endif
+
+#if GST_CHECK_VERSION(0,10,13)
+# define GNASH_GST_PLUGIN_DEFINE GST_PLUGIN_DEFINE
+#else
+# define GNASH_GST_PLUGIN_DEFINE GST_PLUGIN_DEFINE_STATIC
+#endif
+
+G_END_DECLS
+
+#endif /* __GNASH_GST_VERSION_H__ */
Index: libmedia/gst/gstappbuffer.c
===================================================================
RCS file: libmedia/gst/gstappbuffer.c
diff -N libmedia/gst/gstappbuffer.c
--- libmedia/gst/gstappbuffer.c 21 Jan 2008 23:10:15 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,110 +0,0 @@
-/* GStreamer
- * Copyright (C) 2007 David Schleef <address@hidden>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* $Id: gstappbuffer.c,v 1.4 2008/01/21 23:10:15 rsavoye Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include <gst/gst.h>
-#include <gst/base/gstpushsrc.h>
-
-#include <string.h>
-
-#include "gstappbuffer.h"
-
-static void gst_app_buffer_init (GstAppBuffer * buffer, gpointer g_class);
-static void gst_app_buffer_class_init (gpointer g_class, gpointer class_data);
-static void gst_app_buffer_finalize (GstAppBuffer * buffer);
-
-static GstBufferClass *parent_class;
-
-GType
-gst_app_buffer_get_type (void)
-{
- static GType _gst_app_buffer_type;
-
- if (G_UNLIKELY (_gst_app_buffer_type == 0)) {
- static const GTypeInfo app_buffer_info = {
- sizeof (GstBufferClass),
- NULL,
- NULL,
- gst_app_buffer_class_init,
- NULL,
- NULL,
- sizeof (GstAppBuffer),
- 0,
- (GInstanceInitFunc) gst_app_buffer_init,
- NULL
- };
- _gst_app_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
- "GstAppBuffer", &app_buffer_info, 0);
- }
- return _gst_app_buffer_type;
-}
-
-static void
-gst_app_buffer_init (GstAppBuffer * buffer, gpointer g_class)
-{
- UNUSEDPAR(buffer);
- UNUSEDPAR(g_class);
-}
-
-static void
-gst_app_buffer_class_init (gpointer g_class, gpointer class_data)
-{
- UNUSEDPAR(class_data);
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
-
- mini_object_class->finalize =
- (GstMiniObjectFinalizeFunction) gst_app_buffer_finalize;
-
- parent_class = g_type_class_peek_parent (g_class);
-}
-
-static void
-gst_app_buffer_finalize (GstAppBuffer * buffer)
-{
- g_return_if_fail (buffer != NULL);
- g_return_if_fail (GST_IS_APP_BUFFER (buffer));
-
- if (buffer->finalize) {
- buffer->finalize (buffer->priv);
- }
-
- GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (buffer));
-}
-
-GstBuffer *
-gst_app_buffer_new (void *data, int length,
- GstAppBufferFinalizeFunc finalize, void *priv)
-{
- GstAppBuffer *buffer;
-
- buffer = (GstAppBuffer *) gst_mini_object_new (GST_TYPE_APP_BUFFER);
-
- GST_BUFFER_DATA (buffer) = data;
- GST_BUFFER_SIZE (buffer) = length;
-
- buffer->finalize = finalize;
- buffer->priv = priv;
-
- return GST_BUFFER (buffer);
-}
Index: libmedia/gst/gstappbuffer.h
===================================================================
RCS file: libmedia/gst/gstappbuffer.h
diff -N libmedia/gst/gstappbuffer.h
--- libmedia/gst/gstappbuffer.h 4 Oct 2007 09:37:50 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,68 +0,0 @@
-/* GStreamer
- * Copyright (C) 2007 David Schleef <address@hidden>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* $Id: gstappbuffer.h,v 1.3 2007/10/04 09:37:50 tgc Exp $ */
-
-#ifndef _GST_APP_BUFFER_H_
-#define _GST_APP_BUFFER_H_
-
-#include <gst/gst.h>
-
-#define UNUSEDPAR(x) { x = x; }
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_APP_BUFFER \
- (gst_app_buffer_get_type())
-#define GST_APP_BUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_BUFFER,GstAppBuffer))
-#define GST_APP_BUFFER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_BUFFER,GstAppBufferClass))
-#define GST_IS_APP_BUFFER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_BUFFER))
-#define GST_IS_APP_BUFFER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_BUFFER))
-
-typedef struct _GstAppBuffer GstAppBuffer;
-typedef struct _GstAppBufferClass GstAppBufferClass;
-typedef void (*GstAppBufferFinalizeFunc) (void *priv);
-
-struct _GstAppBuffer
-{
- GstBuffer buffer;
-
- /*< private >*/
- GstAppBufferFinalizeFunc finalize;
- void *priv;
-};
-
-struct _GstAppBufferClass
-{
- GstBufferClass buffer_class;
-};
-
-GType gst_app_buffer_get_type(void);
-
-GstBuffer *gst_app_buffer_new (void *data, int length,
- GstAppBufferFinalizeFunc finalize, void *priv);
-
-G_END_DECLS
-
-#endif
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libbase/rc.cpp libbase/rc.h lib...,
Bastiaan Jacques <=