[gstreamermm] Use anonymous namespaces and extern "C" where appropriate.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gstreamermm] Use anonymous namespaces and extern "C" where appropriate.
- Date: Thu, 15 Oct 2009 04:33:46 +0000 (UTC)
commit d7bf7368ae2b417b3a8c81fc964762d36739675e
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Wed Oct 14 23:28:54 2009 -0400
Use anonymous namespaces and extern "C" where appropriate.
* gstreamer/src/audioclock.ccg:
* gstreamer/src/bus.ccg:
* gstreamer/src/clock.ccg:
* gstreamer/src/element.ccg:
* gstreamer/src/element.hg:
* gstreamer/src/filter.ccg:
* gstreamer/src/index.ccg:
* gstreamer/src/pad.ccg:
* gstreamer/src/plugin.ccg:
* gstreamer/src/registry.ccg:
* gstreamer/src/structure.ccg:
* gstreamer/src/task.ccg:
* gstreamer/src/taskpool.ccg: Use anonymous namespaces and extern "C"
declarations of functions that could be called from C as Daniel's
previous commits have exemplified. The other changes (like using
existing C++ API, using characters instead of strings for single
characters, etc.) are also clear. Though, as Daniel suggested, I
might need to go on irc once in a while to get input from him on
things I might not understand there when he's available.
* gstreamer/src/ringbuffer.ccg:
* gstreamer/src/taglist.ccg:
* gstreamer/src/typefind.ccg:
* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: whitespace.
ChangeLog | 30 ++++++++++++++++++++
gstreamer/src/audioclock.ccg | 10 ++++++
gstreamer/src/bus.ccg | 10 ++++++
gstreamer/src/clock.ccg | 10 ++++++
gstreamer/src/element.ccg | 5 +++
gstreamer/src/element.hg | 1 +
gstreamer/src/filter.ccg | 10 ++++++
gstreamer/src/index.ccg | 10 ++++++
gstreamer/src/pad.ccg | 10 ++++++
gstreamer/src/plugin.ccg | 10 ++++++
gstreamer/src/registry.ccg | 10 ++++++
gstreamer/src/ringbuffer.ccg | 2 +
gstreamer/src/structure.ccg | 10 ++++++
gstreamer/src/taglist.ccg | 2 +
gstreamer/src/task.ccg | 7 ++++-
gstreamer/src/taskpool.ccg | 10 ++++++
gstreamer/src/typefind.ccg | 2 +
.../extra_defs_gen/generate_plugin_gmmproc_file.cc | 3 +-
18 files changed, 150 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f40ec88..e2a7d2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2009-10-14 José Alburquerque <jaalburqu svn gnome org>
+
+ Use anonymous namespaces and extern "C" where appropriate.
+
+ * gstreamer/src/audioclock.ccg:
+ * gstreamer/src/bus.ccg:
+ * gstreamer/src/clock.ccg:
+ * gstreamer/src/element.ccg:
+ * gstreamer/src/element.hg:
+ * gstreamer/src/filter.ccg:
+ * gstreamer/src/index.ccg:
+ * gstreamer/src/pad.ccg:
+ * gstreamer/src/plugin.ccg:
+ * gstreamer/src/registry.ccg:
+ * gstreamer/src/structure.ccg:
+ * gstreamer/src/task.ccg:
+ * gstreamer/src/taskpool.ccg: Use anonymous namespaces and extern "C"
+ declarations of functions that could be called from C as Daniel's
+ previous commits have exemplified. The other changes (like using
+ existing C++ API, using characters instead of strings for single
+ characters, etc.) are also clear. Though, as Daniel suggested, I
+ might need to go on irc once in a while to get input from him on
+ things I might not understand there when he's available.
+
+
+ * gstreamer/src/ringbuffer.ccg:
+ * gstreamer/src/taglist.ccg:
+ * gstreamer/src/typefind.ccg:
+ * tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: whitespace.
+
2009-10-06 Daniel Elstner <daniel kitta gmail com>
Replace ':' with $PATH_SEPARATOR for portability
diff --git a/gstreamer/src/audioclock.ccg b/gstreamer/src/audioclock.ccg
index ff569ea..e254757 100644
--- a/gstreamer/src/audioclock.ccg
+++ b/gstreamer/src/audioclock.ccg
@@ -21,6 +21,12 @@
_PINCLUDE(gstreamermm/private/systemclock_p.h)
+namespace
+{
+
+extern "C"
+{
+
static GstClockTime AudioClock_GetTime_gstreamermm_callback(GstClock* clock, void* data)
{
Gst::AudioClock::SlotGetTime* the_slot = static_cast<Gst::AudioClock::SlotGetTime*>(data);
@@ -41,6 +47,10 @@ static GstClockTime AudioClock_GetTime_gstreamermm_callback(GstClock* clock, voi
return 0; // arbitrary value
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/bus.ccg b/gstreamer/src/bus.ccg
index f463ecb..d846eb1 100644
--- a/gstreamer/src/bus.ccg
+++ b/gstreamer/src/bus.ccg
@@ -21,6 +21,12 @@
_PINCLUDE(glibmm/private/object_p.h)
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static gboolean Bus_Message_gstreamermm_callback(GstBus* bus, GstMessage* message, void* data)
{
Gst::Bus::SlotMessage* the_slot = static_cast<Gst::Bus::SlotMessage*>(data);
@@ -66,6 +72,10 @@ static GstBusSyncReply Bus_Message_Sync_gstreamermm_callback(GstBus* bus, GstMes
return GST_BUS_PASS;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/clock.ccg b/gstreamer/src/clock.ccg
index 3f07548..4a333b8 100644
--- a/gstreamer/src/clock.ccg
+++ b/gstreamer/src/clock.ccg
@@ -21,6 +21,12 @@
_PINCLUDE(glibmm/private/object_p.h)
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime time, GstClockID id, void* data)
{
Gst::ClockID::SlotClock* the_slot = static_cast<Gst::ClockID::SlotClock*>(data);
@@ -46,6 +52,10 @@ static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime
return false;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/element.ccg b/gstreamer/src/element.ccg
index d93613a..5bb430a 100644
--- a/gstreamer/src/element.ccg
+++ b/gstreamer/src/element.ccg
@@ -41,11 +41,16 @@ _PINCLUDE(gstreamermm/private/object_p.h)
namespace Gst
{
+extern "C"
+{
+
void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data, GObject*)
{
delete static_cast<Gst::Element*>(data);
}
+} // extern "C"
+
namespace Enums
{
diff --git a/gstreamer/src/element.hg b/gstreamer/src/element.hg
index 19fe9af..d7ff04a 100644
--- a/gstreamer/src/element.hg
+++ b/gstreamer/src/element.hg
@@ -486,6 +486,7 @@ private:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
+extern "C"
void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data, GObject* where_the_object_was);
template <class T_Interface>
diff --git a/gstreamer/src/filter.ccg b/gstreamer/src/filter.ccg
index b945550..2edadca 100644
--- a/gstreamer/src/filter.ccg
+++ b/gstreamer/src/filter.ccg
@@ -19,6 +19,12 @@
#include <gst/gstfilter.h>
+namespace
+{
+
+extern "C"
+{
+
static gboolean Filter_Filter_gstreamermm_callback(void* obj, void* data)
{
Gst::Filter::SlotFilter* the_slot = static_cast<Gst::Filter::SlotFilter*>(data);
@@ -40,6 +46,10 @@ static gboolean Filter_Filter_gstreamermm_callback(void* obj, void* data)
return false;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/index.ccg b/gstreamer/src/index.ccg
index 264925f..ac4e6b4 100644
--- a/gstreamer/src/index.ccg
+++ b/gstreamer/src/index.ccg
@@ -20,6 +20,12 @@
#include <gst/gstenumtypes.h>
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static gboolean Index_Filter_gstreamermm_callback(GstIndex* index, GstIndexEntry* entry, void* data)
{
Gst::Index::SlotFilter * the_slot =
@@ -83,6 +89,10 @@ static void Index_Resolver_gstreamermm_callback_destroy(void* data)
delete static_cast<Gst::Index::SlotResolver*>(data);
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/pad.ccg b/gstreamer/src/pad.ccg
index 982cd51..490ed7c 100644
--- a/gstreamer/src/pad.ccg
+++ b/gstreamer/src/pad.ccg
@@ -29,6 +29,12 @@
_PINCLUDE(glibmm/private/object_p.h)
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static void Pad_Block_gstreamermm_callback(GstPad* pad, gboolean blocked, void* data)
{
Gst::Pad::SlotBlock * the_slot = static_cast<Gst::Pad::SlotBlock*>(data);
@@ -76,6 +82,10 @@ static void Pad_Data_gstreamermm_callback_disconnect(void* data)
delete the_slot;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/plugin.ccg b/gstreamer/src/plugin.ccg
index 2c30764..1c8713a 100644
--- a/gstreamer/src/plugin.ccg
+++ b/gstreamer/src/plugin.ccg
@@ -21,6 +21,12 @@
#include <gstreamermm/structure.h>
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
gboolean Plugin_Init_gstreamermm_callback(GstPlugin* plugin, void* data)
{
Gst::Plugin::SlotInit* the_slot = static_cast<Gst::Plugin::SlotInit*>(data);
@@ -44,6 +50,10 @@ gboolean Plugin_Init_gstreamermm_callback(GstPlugin* plugin, void* data)
return false;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/registry.ccg b/gstreamer/src/registry.ccg
index 7d41466..8f0e83b 100644
--- a/gstreamer/src/registry.ccg
+++ b/gstreamer/src/registry.ccg
@@ -22,6 +22,12 @@
#include <gstreamermm/plugin.h>
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static gboolean Registry_Plugin_Filter_gstreamermm_callback(GstPlugin* plugin, void* data)
{
Gst::Plugin::SlotFilter* the_slot = static_cast<Gst::Plugin::SlotFilter*>(data);
@@ -64,6 +70,10 @@ static gboolean Registry_PluginFeature_Filter_gstreamermm_callback(GstPluginFeat
return false;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/ringbuffer.ccg b/gstreamer/src/ringbuffer.ccg
index c8f8907..5b1345f 100644
--- a/gstreamer/src/ringbuffer.ccg
+++ b/gstreamer/src/ringbuffer.ccg
@@ -23,6 +23,7 @@ _PINCLUDE(gstreamermm/private/object_p.h)
namespace
{
+
extern "C"
{
@@ -46,6 +47,7 @@ static void RingBuffer_Fill_gstreamermm_callback(GstRingBuffer*, guint8* data, g
}
} // extern "C"
+
} // anonymous namespace
namespace Gst
diff --git a/gstreamer/src/structure.ccg b/gstreamer/src/structure.ccg
index d5578c1..e739023 100644
--- a/gstreamer/src/structure.ccg
+++ b/gstreamer/src/structure.ccg
@@ -22,6 +22,9 @@
#include <gstreamermm/value.h>
#include <gstreamermm/miniobject.h>
+namespace
+{
+
static Glib::ustring quark_to_ustring(GQuark quark)
{
const gchar* pch = g_quark_to_string(quark);
@@ -32,6 +35,9 @@ static Glib::ustring quark_to_ustring(GQuark quark)
return str;
}
+extern "C"
+{
+
static gboolean
Structure_Foreach_gstreamermm_callback(GQuark field_id, const GValue *value, void* data)
{
@@ -75,6 +81,10 @@ Structure_Map_gstreamermm_callback(GQuark field_id, GValue *value, void* data)
return false;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/taglist.ccg b/gstreamer/src/taglist.ccg
index 4915547..0e4708d 100644
--- a/gstreamer/src/taglist.ccg
+++ b/gstreamer/src/taglist.ccg
@@ -21,6 +21,7 @@
namespace
{
+
extern "C"
{
@@ -43,6 +44,7 @@ static void TagList_foreach_gstreamermm_callback(const GstTagList*, const char *
}
} // extern "C"
+
} // anonymous namespace
namespace Gst
diff --git a/gstreamer/src/task.ccg b/gstreamer/src/task.ccg
index 1d5dbc1..ab1c445 100644
--- a/gstreamer/src/task.ccg
+++ b/gstreamer/src/task.ccg
@@ -32,7 +32,8 @@ struct TaskThreadCallbacks
Gst::Task::SlotLeave* slot_leave;
};
-} // Anonymous namespace
+extern "C"
+{
static void Task_Task_gstreamermm_callback(void* data)
{
@@ -98,6 +99,10 @@ static void Task_Callbacks_gstreamermm_callback_destroy(void* data)
delete callbacks;
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/taskpool.ccg b/gstreamer/src/taskpool.ccg
index 3d4976c..80b8b09 100644
--- a/gstreamer/src/taskpool.ccg
+++ b/gstreamer/src/taskpool.ccg
@@ -20,6 +20,12 @@
#include <gst/gstenumtypes.h>
_PINCLUDE(gstreamermm/private/object_p.h)
+namespace
+{
+
+extern "C"
+{
+
static void TaskPool_Push_gstreamermm_callback(void* data)
{
Gst::TaskPool::SlotPush* the_slot = static_cast<Gst::TaskPool::SlotPush*>(data);
@@ -39,6 +45,10 @@ static void TaskPool_Push_gstreamermm_callback(void* data)
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+} // extern "C"
+
+} // anonymous namespace
+
namespace Gst
{
diff --git a/gstreamer/src/typefind.ccg b/gstreamer/src/typefind.ccg
index a741b95..6d08e84 100644
--- a/gstreamer/src/typefind.ccg
+++ b/gstreamer/src/typefind.ccg
@@ -24,6 +24,7 @@
namespace
{
+
extern "C"
{
@@ -51,6 +52,7 @@ static void TypeFind_Find_gstreamermm_callback_destroy(void* data)
}
} // extern "C"
+
} // anonymous namespace
namespace Gst
diff --git a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
index 8f02f57..c33a44f 100644
--- a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
+++ b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
@@ -405,7 +405,8 @@ static std::string get_signal_wrap_statements(std::string& includeMacroCalls,
enumGTypeFunctionDefinitions +=
"_PLUGIN_ENUM_GET_TYPE_FUNC(" + paramCType + ')';
- cEnumDefinitions += get_c_enum_definition_macro(paramGType, paramCType);
+ cEnumDefinitions +=
+ get_c_enum_definition_macro(paramGType, paramCType);
}
if(gst_type_is_a_pointer(paramGType))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]