[gst-debugger/refactor-v1.0] refactor s/watch/hook/
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gst-debugger/refactor-v1.0] refactor s/watch/hook/
- Date: Sun, 4 Oct 2015 00:14:33 +0000 (UTC)
commit 92343bfa1e8a5a54eec84c07559997a8300e6d4c
Author: Marcin Kolny <marcin kolny gmail com>
Date: Sun Oct 4 02:14:12 2015 +0200
refactor s/watch/hook/
src/common/gstdebugger.proto | 18 ++--
src/debugserver/Makefile.am | 2 +-
src/debugserver/gstdebugserver.c | 26 +++---
src/debugserver/gstdebugserverbuffer.c | 70 +++++++-------
src/debugserver/gstdebugserverbuffer.h | 7 +-
src/debugserver/gstdebugserverhooks.c | 95 ++++++++++++++++++++
...tdebugserverwatcher.h => gstdebugserverhooks.h} | 16 ++--
src/debugserver/gstdebugserverlog.c | 60 ++++++------
src/debugserver/gstdebugserverlog.h | 7 +-
src/debugserver/gstdebugservermessage.c | 16 ++--
src/debugserver/gstdebugservermessage.h | 17 +---
src/debugserver/gstdebugserverqe.c | 76 ++++++++--------
src/debugserver/gstdebugserverqe.h | 7 +-
src/debugserver/gstdebugserverwatcher.c | 95 --------------------
src/gst-debugger/controller/command_factory.cpp | 24 +++---
src/gst-debugger/controller/command_factory.h | 4 +-
src/gst-debugger/modules/buffer_module.cpp | 10 +-
src/gst-debugger/modules/buffer_module.h | 6 +-
src/gst-debugger/modules/control_module.h | 26 +++---
src/gst-debugger/modules/event_module.cpp | 10 +-
src/gst-debugger/modules/event_module.h | 4 +-
src/gst-debugger/modules/log_module.cpp | 10 +-
src/gst-debugger/modules/log_module.h | 4 +-
src/gst-debugger/modules/message_module.cpp | 6 +-
src/gst-debugger/modules/message_module.h | 4 +-
src/gst-debugger/modules/qe_control_module.h | 2 +-
src/gst-debugger/modules/query_module.cpp | 10 +-
src/gst-debugger/modules/query_module.h | 4 +-
28 files changed, 311 insertions(+), 325 deletions(-)
---
diff --git a/src/common/gstdebugger.proto b/src/common/gstdebugger.proto
index b8ecd8a..e0dfd8c 100644
--- a/src/common/gstdebugger.proto
+++ b/src/common/gstdebugger.proto
@@ -52,26 +52,26 @@ message LogRequest {
optional string category = 3;
}
-message QueryWatchRequest {
+message QueryHookRequest {
required int32 type = 1;
}
-message BufferWatchRequest {
+message BufferHookRequest {
required bool send_data = 1;
}
-message EventWatchRequest {
+message EventHookRequest {
required int32 type = 1;
}
-message PadWatchRequest {
+message PadHookRequest {
required Action action = 1;
optional string pad = 2;
- oneof pad_watch_type {
- QueryWatchRequest query = 3;
- BufferWatchRequest buffer = 4;
- EventWatchRequest event = 5;
+ oneof pad_hook_type {
+ QueryHookRequest query = 3;
+ BufferHookRequest buffer = 4;
+ EventHookRequest event = 5;
}
}
@@ -117,7 +117,7 @@ message Command {
bool debug_categories_list = 2;
MessageRequest message = 3;
LogRequest log = 4;
- PadWatchRequest pad_watch = 5;
+ PadHookRequest pad_hook = 5;
string log_threshold = 6;
bool entire_topology = 7;
PropertyRequest property = 8;
diff --git a/src/debugserver/Makefile.am b/src/debugserver/Makefile.am
index 96c0253..159dcf0 100644
--- a/src/debugserver/Makefile.am
+++ b/src/debugserver/Makefile.am
@@ -8,7 +8,7 @@ libgstdebugserver_la_SOURCES = \
gstdebugservertypes.c gstdebugservertypes.h \
gstdebugserverqe.c gstdebugserverqe.h \
gstdebugservertopology.c gstdebugservertopology.h \
- gstdebugserverwatcher.c gstdebugserverwatcher.h \
+ gstdebugserverhooks.c gstdebugserverhooks.h \
gstdebugserverbuffer.c gstdebugserverbuffer.h
# gstdebugserverfactory.c gstdebugserverfactory.h
diff --git a/src/debugserver/gstdebugserver.c b/src/debugserver/gstdebugserver.c
index 29f90c9..9da43f4 100644
--- a/src/debugserver/gstdebugserver.c
+++ b/src/debugserver/gstdebugserver.c
@@ -344,31 +344,31 @@ gst_debugserver_tracer_get_property (GObject * object, guint prop_id,
}
}
-static void gst_debugserver_process_pad_watch (GstDebugserverTracer * self, GstDebugger__Command * command,
TcpClient * client)
+static void gst_debugserver_process_pad_hook (GstDebugserverTracer * self, GstDebugger__Command * command,
TcpClient * client)
{
- GstDebugger__PadWatchRequest *request = command->pad_watch;
+ GstDebugger__PadHookRequest *request = command->pad_hook;
GstPad *pad = gst_utils_get_pad_from_path (GST_ELEMENT_CAST (self->pipeline), request->pad);
- switch (request->pad_watch_type_case)
+ switch (request->pad_hook_type_case)
{
- case GST_DEBUGGER__PAD_WATCH_REQUEST__PAD_WATCH_TYPE_EVENT:
- if (gst_debugserver_qe_set_watch (self->event, request->action == GST_DEBUGGER__ACTION__ADD,
request->event->type, pad, request->pad, client)) {
+ case GST_DEBUGGER__PAD_HOOK_REQUEST__PAD_HOOK_TYPE_EVENT:
+ if (gst_debugserver_qe_set_hook (self->event, request->action == GST_DEBUGGER__ACTION__ADD,
request->event->type, pad, request->pad, client)) {
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
data.confirmation = command;
data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_CONFIRMATION;
gst_debugserver_tcp_send_packet (self->tcp_server, client, &data);
}
break;
- case GST_DEBUGGER__PAD_WATCH_REQUEST__PAD_WATCH_TYPE_QUERY:
- if (gst_debugserver_qe_set_watch (self->query, request->action == GST_DEBUGGER__ACTION__ADD,
request->query->type, pad, request->pad, client)) {
+ case GST_DEBUGGER__PAD_HOOK_REQUEST__PAD_HOOK_TYPE_QUERY:
+ if (gst_debugserver_qe_set_hook (self->query, request->action == GST_DEBUGGER__ACTION__ADD,
request->query->type, pad, request->pad, client)) {
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
data.confirmation = command;
data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_CONFIRMATION;
gst_debugserver_tcp_send_packet (self->tcp_server, client, &data);
}
break;
- case GST_DEBUGGER__PAD_WATCH_REQUEST__PAD_WATCH_TYPE_BUFFER:
- if (gst_debugserver_buffer_set_watch (self->buffer, request->action == GST_DEBUGGER__ACTION__ADD,
request->buffer->send_data, pad,
+ case GST_DEBUGGER__PAD_HOOK_REQUEST__PAD_HOOK_TYPE_BUFFER:
+ if (gst_debugserver_buffer_set_hook (self->buffer, request->action == GST_DEBUGGER__ACTION__ADD,
request->buffer->send_data, pad,
request->pad, client)) {
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
data.confirmation = command;
@@ -425,7 +425,7 @@ static void gst_debugserver_command_handler (GstDebugger__Command * command,
gst_debugserver_log_set_threshold (command->log_threshold);
break;
case GST_DEBUGGER__COMMAND__COMMAND_TYPE_MESSAGE:
- if (gst_debugserver_message_set_watch (self->message, client, command->message)) {
+ if (gst_debugserver_message_set_hook (self->message, client, command->message)) {
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
data.confirmation = command;
data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_CONFIRMATION;
@@ -433,7 +433,7 @@ static void gst_debugserver_command_handler (GstDebugger__Command * command,
}
break;
case GST_DEBUGGER__COMMAND__COMMAND_TYPE_LOG:
- if (gst_debugserver_log_set_watch (self->log, command->log->action == GST_DEBUGGER__ACTION__ADD,
+ if (gst_debugserver_log_set_hook (self->log, command->log->action == GST_DEBUGGER__ACTION__ADD,
command->log->level, command->log->category, client)) {
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
data.confirmation = command;
@@ -441,8 +441,8 @@ static void gst_debugserver_command_handler (GstDebugger__Command * command,
gst_debugserver_tcp_send_packet (self->tcp_server, client, &data);
}
break;
- case GST_DEBUGGER__COMMAND__COMMAND_TYPE_PAD_WATCH:
- gst_debugserver_process_pad_watch (self, command, client);
+ case GST_DEBUGGER__COMMAND__COMMAND_TYPE_PAD_HOOK:
+ gst_debugserver_process_pad_hook (self, command, client);
break;
case GST_DEBUGGER__COMMAND__COMMAND_TYPE_ENTIRE_TOPOLOGY:
gst_debugserver_topology_send_entire_topology (GST_BIN_CAST (self->pipeline), self->tcp_server, client);
diff --git a/src/debugserver/gstdebugserverbuffer.c b/src/debugserver/gstdebugserverbuffer.c
index 868fea1..a86eadb 100644
--- a/src/debugserver/gstdebugserverbuffer.c
+++ b/src/debugserver/gstdebugserverbuffer.c
@@ -25,34 +25,34 @@ typedef struct {
gboolean send_data;
GstPad * pad;
gchar * pad_path;
-} BufferWatch;
+} BufferHook;
-static BufferWatch * buffer_watch_new (gboolean send_data, GstPad * pad, gchar * pad_path)
+static BufferHook * buffer_hook_new (gboolean send_data, GstPad * pad, gchar * pad_path)
{
- BufferWatch * watch = (BufferWatch *) g_malloc (sizeof (BufferWatch));
+ BufferHook * hook = (BufferHook *) g_malloc (sizeof (BufferHook));
- watch->send_data = send_data;
- watch->pad = pad;
- watch->pad_path = g_strdup (pad_path);
+ hook->send_data = send_data;
+ hook->pad = pad;
+ hook->pad_path = g_strdup (pad_path);
- return watch;
+ return hook;
}
-static void buffer_watch_free (BufferWatch * watch)
+static void buffer_hook_free (BufferHook * hook)
{
- g_free (watch->pad_path);
- g_free (watch);
+ g_free (hook->pad_path);
+ g_free (hook);
}
-static void buffer_watch_list_free (gpointer ptr)
+static void buffer_hook_list_free (gpointer ptr)
{
- g_slist_free_full (ptr, (GDestroyNotify) buffer_watch_free);
+ g_slist_free_full (ptr, (GDestroyNotify) buffer_hook_free);
}
-static gint buffer_watch_compare (gconstpointer a, gconstpointer b)
+static gint buffer_hook_compare (gconstpointer a, gconstpointer b)
{
- BufferWatch *a1 = (BufferWatch*) a;
- BufferWatch *b1 = (BufferWatch*) b;
+ BufferHook *a1 = (BufferHook*) a;
+ BufferHook *b1 = (BufferHook*) b;
if (g_strcmp0 (a1->pad_path, b1->pad_path) == 0 || a1->pad == NULL) {
return 0;
@@ -65,7 +65,7 @@ GstDebugserverBuffer * gst_debugserver_buffer_new (void)
{
GstDebugserverBuffer *buf = (GstDebugserverBuffer*)g_malloc (sizeof(GstDebugserverBuffer));
- gst_debugserver_watcher_init (&buf->watcher, NULL, (GDestroyNotify) buffer_watch_list_free,
buffer_watch_compare);
+ gst_debugserver_hooks_init (&buf->hooks, NULL, (GDestroyNotify) buffer_hook_list_free,
buffer_hook_compare);
return buf;
}
@@ -73,37 +73,37 @@ GstDebugserverBuffer * gst_debugserver_buffer_new (void)
void gst_debugserver_buffer_free (GstDebugserverBuffer * buf)
{
gst_debugserver_buffer_clean (buf);
- gst_debugserver_watcher_deinit (&buf->watcher);
+ gst_debugserver_hooks_deinit (&buf->hooks);
g_free (buf);
}
-gboolean gst_debugserver_buffer_add_watch (GstDebugserverBuffer * buf,
+gboolean gst_debugserver_buffer_add_hook (GstDebugserverBuffer * buf,
gboolean send_data, GstPad * pad, gchar * pad_path, TcpClient * client)
{
- BufferWatch *w = buffer_watch_new (send_data, pad, pad_path);
- if (gst_debugserver_watcher_add_watch (&buf->watcher, w, client) == TRUE) {
+ BufferHook *w = buffer_hook_new (send_data, pad, pad_path);
+ if (gst_debugserver_hooks_add_hook (&buf->hooks, w, client) == TRUE) {
return TRUE;
} else {
- buffer_watch_free (w);
+ buffer_hook_free (w);
return FALSE;
}
}
-gboolean gst_debugserver_buffer_remove_watch (GstDebugserverBuffer * buf,
+gboolean gst_debugserver_buffer_remove_hook (GstDebugserverBuffer * buf,
gboolean send_data, GstPad * pad, gchar * pad_path, TcpClient * client)
{
- BufferWatch w = { send_data, pad, pad_path };
+ BufferHook w = { send_data, pad, pad_path };
- return gst_debugserver_watcher_remove_watch (&buf->watcher, &w, client);
+ return gst_debugserver_hooks_remove_hook (&buf->hooks, &w, client);
}
-gboolean gst_debugserver_buffer_set_watch (GstDebugserverBuffer * buf, gboolean enable,
+gboolean gst_debugserver_buffer_set_hook (GstDebugserverBuffer * buf, gboolean enable,
gboolean send_data, GstPad * pad, gchar * pad_path, TcpClient * client)
{
if (enable) {
- return gst_debugserver_buffer_add_watch (buf, send_data, pad, pad_path, client);
+ return gst_debugserver_buffer_add_hook (buf, send_data, pad, pad_path, client);
} else {
- return gst_debugserver_buffer_remove_watch (buf, send_data, pad, pad_path, client);
+ return gst_debugserver_buffer_remove_hook (buf, send_data, pad, pad_path, client);
}
}
@@ -116,7 +116,7 @@ void gst_debugserver_buffer_send_buffer (GstDebugserverBuffer * buffer,
GstDebugger__BufferInfo buffer_info = GST_DEBUGGER__BUFFER_INFO__INIT;
gchar *pad_path = gst_utils_get_object_path (GST_OBJECT_CAST (pad));
GSList *list = NULL;
- BufferWatch watch = { FALSE, pad, pad_path };
+ BufferHook hook = { FALSE, pad, pad_path };
gchar *buff_data = NULL;
buffer_info.dts = GST_BUFFER_DTS (gst_buffer);
@@ -136,16 +136,16 @@ void gst_debugserver_buffer_send_buffer (GstDebugserverBuffer * buffer,
gst_data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_BUFFER_INFO;
gst_data.buffer_info = &buffer_info;
- g_mutex_lock (&buffer->watcher.mutex);
- g_hash_table_iter_init (&iter, buffer->watcher.clients);
+ g_mutex_lock (&buffer->hooks.mutex);
+ g_hash_table_iter_init (&iter, buffer->hooks.clients);
while (g_hash_table_iter_next (&iter, &client, &value)) {
- list = g_slist_find_custom ((GSList*) value, &watch, buffer_watch_compare);
+ list = g_slist_find_custom ((GSList*) value, &hook, buffer_hook_compare);
if (list != NULL) {
- buffer_info.has_data = ((BufferWatch*)list->data)->send_data;
+ buffer_info.has_data = ((BufferHook*)list->data)->send_data;
gst_debugserver_tcp_send_packet (tcp_server, (TcpClient*) client, &gst_data);
}
}
- g_mutex_unlock (&buffer->watcher.mutex);
+ g_mutex_unlock (&buffer->hooks.mutex);
g_free (buff_data);
g_free (pad_path);
@@ -153,10 +153,10 @@ void gst_debugserver_buffer_send_buffer (GstDebugserverBuffer * buffer,
void gst_debugserver_buffer_remove_client (GstDebugserverBuffer * buf, TcpClient * client)
{
- g_hash_table_remove (buf->watcher.clients, client);
+ g_hash_table_remove (buf->hooks.clients, client);
}
void gst_debugserver_buffer_clean (GstDebugserverBuffer * buf)
{
- gst_debugserver_watcher_clean (&buf->watcher);
+ gst_debugserver_hooks_clean (&buf->hooks);
}
diff --git a/src/debugserver/gstdebugserverbuffer.h b/src/debugserver/gstdebugserverbuffer.h
index 72693b3..f864149 100644
--- a/src/debugserver/gstdebugserverbuffer.h
+++ b/src/debugserver/gstdebugserverbuffer.h
@@ -20,23 +20,22 @@
#ifndef __GST_DEBUGSERVER_BUFFER_H__
#define __GST_DEBUGSERVER_BUFFER_H__
-#include "gstdebugserverwatcher.h"
-
#include <gst/gst.h>
+#include "gstdebugserverhooks.h"
G_BEGIN_DECLS
typedef struct _GstDebugserverBuffer GstDebugserverBuffer;
struct _GstDebugserverBuffer {
- GstDebugserverWatcher watcher;
+ GstDebugserverHooks hooks;
};
GstDebugserverBuffer * gst_debugserver_buffer_new (void);
void gst_debugserver_buffer_free (GstDebugserverBuffer * buf);
-gboolean gst_debugserver_buffer_set_watch (GstDebugserverBuffer * buf, gboolean enable,
+gboolean gst_debugserver_buffer_set_hook (GstDebugserverBuffer * buf, gboolean enable,
gboolean send_data, GstPad * pad, gchar * pad_path, TcpClient * client);
void gst_debugserver_buffer_send_buffer (GstDebugserverBuffer * buffer,
diff --git a/src/debugserver/gstdebugserverhooks.c b/src/debugserver/gstdebugserverhooks.c
new file mode 100644
index 0000000..b971099
--- /dev/null
+++ b/src/debugserver/gstdebugserverhooks.c
@@ -0,0 +1,95 @@
+/* GStreamer
+ * Copyright (C) 2015 Marcin Kolny <marcin kolny gmail com>
+ *
+ * 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., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "gstdebugserverhooks.h"
+
+void gst_debugserver_hooks_init (GstDebugserverHooks * hooks, OkFunction ok_function,
+ GDestroyNotify hash_destroy, GCompareFunc cmp_func)
+{
+ hooks->clients = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, hash_destroy);
+ g_mutex_init (&hooks->mutex);
+ hooks->ok_function = ok_function;
+ hooks->cmp_function = cmp_func;
+}
+
+void gst_debugserver_hooks_deinit (GstDebugserverHooks * hooks)
+{
+ g_mutex_lock (&hooks->mutex);
+ g_hash_table_destroy (hooks->clients);
+ g_mutex_unlock (&hooks->mutex);
+}
+
+void gst_debugserver_hooks_clean (GstDebugserverHooks * hooks)
+{
+ g_mutex_lock (&hooks->mutex);
+ g_hash_table_remove_all (hooks->clients);
+ g_mutex_unlock (&hooks->mutex);
+}
+
+void gst_debugserver_hooks_send_data (GstDebugserverHooks * hooks, GstDebugserverTcp * tcp_server,
GstDebugger__GStreamerData * gst_data)
+{
+ GHashTableIter iter;
+ gpointer client, value;
+
+ g_mutex_lock (&hooks->mutex);
+ g_hash_table_iter_init (&iter, hooks->clients);
+ while (g_hash_table_iter_next (&iter, &client, &value)) {
+ if (hooks->ok_function (gst_data, value))
+ gst_debugserver_tcp_send_packet (tcp_server, (TcpClient*) client, gst_data);
+ }
+ g_mutex_unlock (&hooks->mutex);
+}
+
+gboolean gst_debugserver_hooks_add_hook (GstDebugserverHooks * hooks, gpointer data, TcpClient * client)
+{
+ GSList *listeners =
+ (GSList *) g_hash_table_lookup (hooks->clients, client);
+
+ if (listeners == NULL) {
+ listeners = g_slist_append (listeners, data);
+ g_hash_table_insert (hooks->clients, client, listeners);
+ return TRUE;
+ }
+
+ if (g_slist_find_custom (listeners, data, hooks->cmp_function) == NULL) {
+ listeners = g_slist_append (listeners, data);
+ g_hash_table_steal (hooks->clients, client);
+ g_hash_table_insert (hooks->clients, client, listeners);
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+gboolean gst_debugserver_hooks_remove_hook (GstDebugserverHooks * hooks,
+ gpointer data, TcpClient * client)
+{
+ GSList *listeners =
+ (GSList *) g_hash_table_lookup (hooks->clients, client);
+
+ GSList *l = g_slist_find_custom (listeners, data, hooks->cmp_function);
+ if (l == NULL) {
+ return FALSE;
+ } else {
+ listeners = g_slist_remove_link (listeners, l);
+ g_hash_table_steal (hooks->clients, client);
+ g_hash_table_insert (hooks->clients, client, listeners);
+ return TRUE;
+ }
+}
diff --git a/src/debugserver/gstdebugserverwatcher.h b/src/debugserver/gstdebugserverhooks.h
similarity index 68%
rename from src/debugserver/gstdebugserverwatcher.h
rename to src/debugserver/gstdebugserverhooks.h
index 445ad9d..1796d5f 100644
--- a/src/debugserver/gstdebugserverwatcher.h
+++ b/src/debugserver/gstdebugserverhooks.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __GST_DEBUGSERVER_WATCHER_H__
-#define __GST_DEBUGSERVER_WATCHER_H__
+#ifndef __GST_DEBUGSERVER_HOOKS_H__
+#define __GST_DEBUGSERVER_HOOKS_H__
#include "gstdebugservertcp.h"
@@ -33,18 +33,18 @@ typedef struct {
GMutex mutex;
OkFunction ok_function;
GCompareFunc cmp_function;
-} GstDebugserverWatcher;
+} GstDebugserverHooks;
-void gst_debugserver_watcher_init (GstDebugserverWatcher * watcher, OkFunction ok_function, GDestroyNotify
hash_destroy, GCompareFunc cmp_func);
+void gst_debugserver_hooks_init (GstDebugserverHooks * hooks, OkFunction ok_function, GDestroyNotify
hash_destroy, GCompareFunc cmp_func);
-void gst_debugserver_watcher_deinit (GstDebugserverWatcher * watcher);
+void gst_debugserver_hooks_deinit (GstDebugserverHooks * hooks);
-void gst_debugserver_watcher_clean (GstDebugserverWatcher * watcher);
+void gst_debugserver_hooks_clean (GstDebugserverHooks * hooks);
-gboolean gst_debugserver_watcher_add_watch (GstDebugserverWatcher * watcher,
+gboolean gst_debugserver_hooks_add_hook (GstDebugserverHooks * hooks,
gpointer data, TcpClient * client);
-gboolean gst_debugserver_watcher_remove_watch (GstDebugserverWatcher * watcher,
+gboolean gst_debugserver_hooks_remove_hook (GstDebugserverHooks * hooks,
gpointer data, TcpClient * client);
G_END_DECLS
diff --git a/src/debugserver/gstdebugserverlog.c b/src/debugserver/gstdebugserverlog.c
index 9d33fe9..df91040 100644
--- a/src/debugserver/gstdebugserverlog.c
+++ b/src/debugserver/gstdebugserverlog.c
@@ -25,32 +25,32 @@
typedef struct {
GstDebugLevel level;
gchar * category;
-} DebugWatch;
+} DebugHook;
-static DebugWatch * debug_watch_new (GstDebugLevel level, const gchar * category)
+static DebugHook * debug_hook_new (GstDebugLevel level, const gchar * category)
{
- DebugWatch * watch = (DebugWatch *) g_malloc (sizeof (DebugWatch));
+ DebugHook * hook = (DebugHook *) g_malloc (sizeof (DebugHook));
- watch->level = level;
- watch->category = g_strdup (category);
+ hook->level = level;
+ hook->category = g_strdup (category);
- return watch;
+ return hook;
}
-static void debug_watch_free (DebugWatch * watch)
+static void debug_hook_free (DebugHook * hook)
{
- g_free (watch->category);
- g_free (watch);
+ g_free (hook->category);
+ g_free (hook);
}
-static void debug_watch_list_free (gpointer ptr)
+static void debug_hook_list_free (gpointer ptr)
{
- g_slist_free_full (ptr, (GDestroyNotify) debug_watch_free);
+ g_slist_free_full (ptr, (GDestroyNotify) debug_hook_free);
}
-static gint debug_watch_compare (gconstpointer p1, gconstpointer p2)
+static gint debug_hook_compare (gconstpointer p1, gconstpointer p2)
{
- const DebugWatch *w1 = p1, *w2 = p2;
+ const DebugHook *w1 = p1, *w2 = p2;
if (w1->level >= w2->level && (w1->category == NULL ||
g_strcmp0 (w1->category, w2->category) == 0)) {
@@ -64,15 +64,15 @@ static gboolean gst_debugserver_log_ok (GstDebugger__GStreamerData* original, gp
{
GstDebugger__LogInfo* info = original->log_info;
GSList *list = new_ptr;
- DebugWatch watch = { info->level, info->category };
+ DebugHook hook = { info->level, info->category };
- return g_slist_find_custom (list, &watch, debug_watch_compare) != NULL;
+ return g_slist_find_custom (list, &hook, debug_hook_compare) != NULL;
}
GstDebugserverLog * gst_debugserver_log_new (void)
{
GstDebugserverLog *log = (GstDebugserverLog*)g_malloc (sizeof(GstDebugserverLog));
- gst_debugserver_watcher_init (&log->watcher, gst_debugserver_log_ok, (GDestroyNotify)
debug_watch_list_free, debug_watch_compare);
+ gst_debugserver_hooks_init (&log->hooks, gst_debugserver_log_ok, (GDestroyNotify) debug_hook_list_free,
debug_hook_compare);
return log;
}
@@ -80,42 +80,42 @@ GstDebugserverLog * gst_debugserver_log_new (void)
void gst_debugserver_log_free (GstDebugserverLog * log)
{
gst_debugserver_log_clean (log);
- gst_debugserver_watcher_deinit (&log->watcher);
+ gst_debugserver_hooks_deinit (&log->hooks);
g_free (log);
}
void gst_debugserver_log_clean (GstDebugserverLog * log)
{
- gst_debugserver_watcher_clean (&log->watcher);
+ gst_debugserver_hooks_clean (&log->hooks);
}
-static gboolean gst_debugserver_log_add_watch (GstDebugserverLog * log, gint level,
+static gboolean gst_debugserver_log_add_hook (GstDebugserverLog * log, gint level,
const gchar * category, TcpClient * client)
{
- DebugWatch *w = debug_watch_new (level, category);
- if (gst_debugserver_watcher_add_watch (&log->watcher, w, client) == TRUE) {
+ DebugHook *w = debug_hook_new (level, category);
+ if (gst_debugserver_hooks_add_hook (&log->hooks, w, client) == TRUE) {
return TRUE;
} else {
- debug_watch_free (w);
+ debug_hook_free (w);
return FALSE;
}
}
-static gboolean gst_debugserver_log_remove_watch (GstDebugserverLog * log,
+static gboolean gst_debugserver_log_remove_hook (GstDebugserverLog * log,
gint level, const gchar * category, TcpClient * client)
{
- DebugWatch w = { level, (gchar*)category };
+ DebugHook w = { level, (gchar*)category };
- return gst_debugserver_watcher_remove_watch (&log->watcher, &w, client);
+ return gst_debugserver_hooks_remove_hook (&log->hooks, &w, client);
}
-gboolean gst_debugserver_log_set_watch (GstDebugserverLog * log, gboolean enable,
+gboolean gst_debugserver_log_set_hook (GstDebugserverLog * log, gboolean enable,
gint level, const gchar * category, TcpClient * client)
{
if (enable) {
- return gst_debugserver_log_add_watch (log, level, category, client);
+ return gst_debugserver_log_add_hook (log, level, category, client);
} else {
- return gst_debugserver_log_remove_watch (log, level, category, client);
+ return gst_debugserver_log_remove_hook (log, level, category, client);
}
}
@@ -137,7 +137,7 @@ void gst_debugserver_log_send_log (GstDebugserverLog * log, GstDebugserverTcp *
gst_data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_LOG_INFO;
gst_data.log_info = &log_info;
- gst_debugserver_watcher_send_data (&log->watcher, tcp_server, &gst_data);
+ gst_debugserver_hooks_send_data (&log->hooks, tcp_server, &gst_data);
}
static gint
@@ -185,5 +185,5 @@ void gst_debugserver_log_set_threshold (const gchar * threshold)
void gst_debugserver_log_remove_client (GstDebugserverLog * log,
TcpClient * client)
{
- g_hash_table_remove (log->watcher.clients, client);
+ g_hash_table_remove (log->hooks.clients, client);
}
diff --git a/src/debugserver/gstdebugserverlog.h b/src/debugserver/gstdebugserverlog.h
index 1b4cbef..25c3e65 100644
--- a/src/debugserver/gstdebugserverlog.h
+++ b/src/debugserver/gstdebugserverlog.h
@@ -20,16 +20,15 @@
#ifndef __GST_DEBUGSERVER_LOG_H__
#define __GST_DEBUGSERVER_LOG_H__
-#include "gstdebugserverwatcher.h"
-
#include <gst/gst.h>
+#include "gstdebugserverhooks.h"
G_BEGIN_DECLS
typedef struct _GstDebugserverLog GstDebugserverLog;
struct _GstDebugserverLog {
- GstDebugserverWatcher watcher;
+ GstDebugserverHooks hooks;
};
GstDebugserverLog * gst_debugserver_log_new (void);
@@ -40,7 +39,7 @@ void gst_debugserver_log_send_log (GstDebugserverLog * log, GstDebugserverTcp *
GstDebugCategory * category, GstDebugLevel level, const gchar * file, const gchar * function,
gint line, GObject * object, GstDebugMessage * message);
-gboolean gst_debugserver_log_set_watch (GstDebugserverLog * log, gboolean enable, gint level,
+gboolean gst_debugserver_log_set_hook (GstDebugserverLog * log, gboolean enable, gint level,
const gchar * category, TcpClient * client);
void gst_debugserver_log_send_debug_categories (GstDebugserverTcp *tcp_server, TcpClient *client);
diff --git a/src/debugserver/gstdebugservermessage.c b/src/debugserver/gstdebugservermessage.c
index 007d3f5..cac9f8b 100644
--- a/src/debugserver/gstdebugservermessage.c
+++ b/src/debugserver/gstdebugservermessage.c
@@ -46,7 +46,7 @@ GstDebugserverMessage * gst_debugserver_message_new (void)
{
GstDebugserverMessage *msg = (GstDebugserverMessage*)g_malloc (sizeof(GstDebugserverMessage));
- gst_debugserver_watcher_init (&msg->watcher, gst_debugserver_message_ok, (GDestroyNotify) g_slist_free,
g_int_cmp);
+ gst_debugserver_hooks_init (&msg->hooks, gst_debugserver_message_ok, (GDestroyNotify) g_slist_free,
g_int_cmp);
return msg;
}
@@ -54,29 +54,29 @@ GstDebugserverMessage * gst_debugserver_message_new (void)
void gst_debugserver_message_free (GstDebugserverMessage * msg)
{
gst_debugserver_log_clean (msg);
- gst_debugserver_watcher_deinit (&msg->watcher);
+ gst_debugserver_hooks_deinit (&msg->hooks);
g_free (msg);
}
void gst_debugserver_message_clean (GstDebugserverMessage * msg)
{
- gst_debugserver_watcher_clean (&msg->watcher);
+ gst_debugserver_hooks_clean (&msg->hooks);
}
-gboolean gst_debugserver_message_set_watch (GstDebugserverMessage * msg,
+gboolean gst_debugserver_message_set_hook (GstDebugserverMessage * msg,
TcpClient * client, GstDebugger__MessageRequest * request)
{
if (request->action == GST_DEBUGGER__ACTION__ADD) {
- return gst_debugserver_watcher_add_watch (&msg->watcher, GINT_TO_POINTER (request->type), client);
+ return gst_debugserver_hooks_add_hook (&msg->hooks, GINT_TO_POINTER (request->type), client);
} else {
- return gst_debugserver_watcher_remove_watch (&msg->watcher, GINT_TO_POINTER (request->type), client);
+ return gst_debugserver_hooks_remove_hook (&msg->hooks, GINT_TO_POINTER (request->type), client);
}
}
void gst_debugserver_message_remove_client (GstDebugserverMessage * msg,
TcpClient * client)
{
- g_hash_table_remove (msg->watcher.clients, client);
+ g_hash_table_remove (msg->hooks.clients, client);
}
@@ -96,7 +96,7 @@ void gst_debugserver_message_send_message (GstDebugserverMessage * msg, GstDebug
gst_data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_MESSAGE_INFO;
gst_data.message_info = &msg_info;
- gst_debugserver_watcher_send_data (&msg->watcher, tcp_server, &gst_data);
+ gst_debugserver_hooks_send_data (&msg->hooks, tcp_server, &gst_data);
g_free (structure_data);
}
diff --git a/src/debugserver/gstdebugservermessage.h b/src/debugserver/gstdebugservermessage.h
index ae866fa..0f50542 100644
--- a/src/debugserver/gstdebugservermessage.h
+++ b/src/debugserver/gstdebugservermessage.h
@@ -21,27 +21,16 @@
#define __GST_DEBUGSERVER_MESSAGE_H__
#include "gstdebugservertcp.h"
-#include "gstdebugserverwatcher.h"
-
#include <gst/gst.h>
#include <glib.h>
+#include "gstdebugserverhooks.h"
G_BEGIN_DECLS
typedef struct _GstDebugserverMessage GstDebugserverMessage;
-typedef struct {
- GHashTable *clients;
-
- gboolean (*accept_client) (gpointer);
- void (*serialize_data) (GstDebugger__GStreamerData*);
- void (*free_data) (GstDebugger__GStreamerData*);
- void (*compare) (gpointer, gpointer);
-} Watcher;
-
-
struct _GstDebugserverMessage {
- GstDebugserverWatcher watcher;
+ GstDebugserverHooks hooks;
};
GstDebugserverMessage * gst_debugserver_message_new (void);
@@ -50,7 +39,7 @@ void gst_debugserver_message_free (GstDebugserverMessage * msg);
void gst_debugserver_message_clean (GstDebugserverMessage * msg);
-gboolean gst_debugserver_message_set_watch (GstDebugserverMessage * msg,
+gboolean gst_debugserver_message_set_hook (GstDebugserverMessage * msg,
TcpClient * client, GstDebugger__MessageRequest * request);
void gst_debugserver_message_remove_client (GstDebugserverMessage * msg,
diff --git a/src/debugserver/gstdebugserverqe.c b/src/debugserver/gstdebugserverqe.c
index 18bf830..7295e94 100644
--- a/src/debugserver/gstdebugserverqe.c
+++ b/src/debugserver/gstdebugserverqe.c
@@ -24,38 +24,38 @@
#include <string.h>
#include "../common/gst-utils.h"
-typedef struct _QEWatch {
+typedef struct _QEHook {
gint qe_type;
GstPad * pad;
gchar * pad_path;
-} QEWatch;
+} QEHook;
-static QEWatch * qe_watch_new (gint type, GstPad * pad, gchar * pad_path)
+static QEHook * qe_hook_new (gint type, GstPad * pad, gchar * pad_path)
{
- QEWatch * watch = (QEWatch *) g_malloc (sizeof (QEWatch));
+ QEHook * hook = (QEHook *) g_malloc (sizeof (QEHook));
- watch->qe_type = type;
- watch->pad = pad;
- watch->pad_path = g_strdup (pad_path);
+ hook->qe_type = type;
+ hook->pad = pad;
+ hook->pad_path = g_strdup (pad_path);
- return watch;
+ return hook;
}
-static void qe_watch_free (QEWatch * watch)
+static void qe_hook_free (QEHook * hook)
{
- g_free (watch->pad_path);
- g_free (watch);
+ g_free (hook->pad_path);
+ g_free (hook);
}
-static void qe_watch_list_free (gpointer ptr)
+static void qe_hook_list_free (gpointer ptr)
{
- g_slist_free_full (ptr, (GDestroyNotify) qe_watch_free);
+ g_slist_free_full (ptr, (GDestroyNotify) qe_hook_free);
}
-static gint qe_watch_compare (gconstpointer a, gconstpointer b)
+static gint qe_hook_compare (gconstpointer a, gconstpointer b)
{
- QEWatch *a1 = (QEWatch*) a;
- QEWatch *b1 = (QEWatch*) b;
+ QEHook *a1 = (QEHook*) a;
+ QEHook *b1 = (QEHook*) b;
if (a1->qe_type == b1->qe_type && (g_strcmp0 (a1->pad_path, b1->pad_path) == 0 || a1->pad == NULL)) {
return 0;
@@ -67,25 +67,25 @@ static gint qe_watch_compare (gconstpointer a, gconstpointer b)
static gboolean gst_debugserver_qe_ok (GstDebugger__GStreamerData* original, gpointer new_ptr)
{
GSList *list = new_ptr;
- QEWatch watch;
+ QEHook hook;
- watch.pad = NULL;
+ hook.pad = NULL;
if (original->event_info != NULL) {
- watch.qe_type = original->event_info->type;
- watch.pad_path = original->event_info->pad;
+ hook.qe_type = original->event_info->type;
+ hook.pad_path = original->event_info->pad;
} else {
- watch.qe_type = original->query_info->type;
- watch.pad_path = original->query_info->pad;
+ hook.qe_type = original->query_info->type;
+ hook.pad_path = original->query_info->pad;
}
- return g_slist_find_custom (list, &watch, qe_watch_compare) != NULL;
+ return g_slist_find_custom (list, &hook, qe_hook_compare) != NULL;
}
GstDebugserverQE * gst_debugserver_qe_new (void)
{
GstDebugserverQE *qe = (GstDebugserverQE*)g_malloc (sizeof(GstDebugserverQE));
- gst_debugserver_watcher_init (&qe->watcher, gst_debugserver_qe_ok, (GDestroyNotify) qe_watch_list_free,
qe_watch_compare);
+ gst_debugserver_hooks_init (&qe->hooks, gst_debugserver_qe_ok, (GDestroyNotify) qe_hook_list_free,
qe_hook_compare);
return qe;
}
@@ -93,37 +93,37 @@ GstDebugserverQE * gst_debugserver_qe_new (void)
void gst_debugserver_qe_free (GstDebugserverQE * qe)
{
gst_debugserver_qe_clean (qe);
- gst_debugserver_watcher_deinit (&qe->watcher);
+ gst_debugserver_hooks_deinit (&qe->hooks);
g_free (qe);
}
-static gboolean gst_debugserver_qe_add_watch (GstDebugserverQE * qe, gint type,
+static gboolean gst_debugserver_qe_add_hook (GstDebugserverQE * qe, gint type,
GstPad * pad, gchar * pad_path, TcpClient * client)
{
- QEWatch *w = qe_watch_new (type, pad, pad_path);
- if (gst_debugserver_watcher_add_watch (&qe->watcher, w, client) == TRUE) {
+ QEHook *w = qe_hook_new (type, pad, pad_path);
+ if (gst_debugserver_hooks_add_hook (&qe->hooks, w, client) == TRUE) {
return TRUE;
} else {
- qe_watch_free (w);
+ qe_hook_free (w);
return FALSE;
}
}
-static gboolean gst_debugserver_qe_remove_watch (GstDebugserverQE * qe,
+static gboolean gst_debugserver_qe_remove_hook (GstDebugserverQE * qe,
gint type, GstPad * pad, gchar * pad_path, TcpClient * client)
{
- QEWatch w = { type, pad, pad_path };
+ QEHook w = { type, pad, pad_path };
- return gst_debugserver_watcher_remove_watch (&qe->watcher, &w, client);
+ return gst_debugserver_hooks_remove_hook (&qe->hooks, &w, client);
}
-gboolean gst_debugserver_qe_set_watch (GstDebugserverQE * qe, gboolean enable,
+gboolean gst_debugserver_qe_set_hook (GstDebugserverQE * qe, gboolean enable,
gint type, GstPad * pad, gchar * pad_path, TcpClient * client)
{
if (enable) {
- return gst_debugserver_qe_add_watch (qe, type, pad, pad_path, client);
+ return gst_debugserver_qe_add_hook (qe, type, pad, pad_path, client);
} else {
- return gst_debugserver_qe_remove_watch (qe, type, pad, pad_path, client);
+ return gst_debugserver_qe_remove_hook (qe, type, pad, pad_path, client);
}
}
@@ -150,17 +150,17 @@ void gst_debugserver_qe_send_qe (GstDebugserverQE * qe, GstDebugserverTcp * tcp_
gst_data.info_type_case = GST_DEBUGGER__GSTREAMER_DATA__INFO_TYPE_QUERY_INFO;
}
- gst_debugserver_watcher_send_data (&qe->watcher, tcp_server, &gst_data);
+ gst_debugserver_hooks_send_data (&qe->hooks, tcp_server, &gst_data);
g_free (pad_path);
}
void gst_debugserver_qe_clean (GstDebugserverQE * qe)
{
- gst_debugserver_watcher_clean (&qe->watcher);
+ gst_debugserver_hooks_clean (&qe->hooks);
}
void gst_debugserver_qe_remove_client (GstDebugserverQE * qe, TcpClient * client)
{
- g_hash_table_remove (qe->watcher.clients, client);
+ g_hash_table_remove (qe->hooks.clients, client);
}
diff --git a/src/debugserver/gstdebugserverqe.h b/src/debugserver/gstdebugserverqe.h
index 8a37c3d..d314b81 100644
--- a/src/debugserver/gstdebugserverqe.h
+++ b/src/debugserver/gstdebugserverqe.h
@@ -20,23 +20,22 @@
#ifndef __GST_DEBUGSERVER_EVENT_H__
#define __GST_DEBUGSERVER_EVENT_H__
-#include "gstdebugserverwatcher.h"
-
#include <gst/gst.h>
+#include "gstdebugserverhooks.h"
G_BEGIN_DECLS
typedef struct _GstDebugserverQE GstDebugserverQE;
struct _GstDebugserverQE {
- GstDebugserverWatcher watcher;
+ GstDebugserverHooks hooks;
};
GstDebugserverQE * gst_debugserver_qe_new (void);
void gst_debugserver_qe_free (GstDebugserverQE * qe);
-gboolean gst_debugserver_qe_set_watch (GstDebugserverQE * qe, gboolean enable,
+gboolean gst_debugserver_qe_set_hook (GstDebugserverQE * qe, gboolean enable,
gint qe_type, GstPad * pad, gchar * pad_path, TcpClient * client);
void gst_debugserver_qe_send_qe (GstDebugserverQE * qe, GstDebugserverTcp * tcp_server, GstPad * pad,
GstMiniObject * obj);
diff --git a/src/gst-debugger/controller/command_factory.cpp b/src/gst-debugger/controller/command_factory.cpp
index e07d1ab..e99dda5 100644
--- a/src/gst-debugger/controller/command_factory.cpp
+++ b/src/gst-debugger/controller/command_factory.cpp
@@ -29,9 +29,9 @@ void CommandFactory::send_request_entire_topology_command()
client->send_command(cmd);
}
-GstDebugger::PadWatchRequest* CommandFactory::create_pad_watch_request(bool enable, const std::string
&pad_path)
+GstDebugger::PadHookRequest* CommandFactory::create_pad_hook_request(bool enable, const std::string
&pad_path)
{
- GstDebugger::PadWatchRequest *request = new GstDebugger::PadWatchRequest();
+ auto *request = new GstDebugger::PadHookRequest();
request->set_pad(pad_path);
request->set_action(enable ? GstDebugger::ADD : GstDebugger::REMOVE);
return request;
@@ -39,36 +39,36 @@ GstDebugger::PadWatchRequest* CommandFactory::create_pad_watch_request(bool enab
void CommandFactory::send_query_request_command(bool enable, const std::string &pad_path, int type)
{
- auto request = create_pad_watch_request(enable, pad_path);
- GstDebugger::QueryWatchRequest *ev_request = new GstDebugger::QueryWatchRequest();
+ auto request = create_pad_hook_request(enable, pad_path);
+ auto *ev_request = new GstDebugger::QueryHookRequest();
ev_request->set_type(type);
request->set_allocated_query(ev_request);
GstDebugger::Command cmd;
- cmd.set_allocated_pad_watch(request);
+ cmd.set_allocated_pad_hook(request);
client->send_command(cmd);
}
void CommandFactory::send_event_request_command(bool enable, const std::string &pad_path, int type)
{
- auto request = create_pad_watch_request(enable, pad_path);
- GstDebugger::EventWatchRequest *ev_request = new GstDebugger::EventWatchRequest();
+ auto request = create_pad_hook_request(enable, pad_path);
+ GstDebugger::EventHookRequest *ev_request = new GstDebugger::EventHookRequest();
ev_request->set_type(type);
request->set_allocated_event(ev_request);
GstDebugger::Command cmd;
- cmd.set_allocated_pad_watch(request);
+ cmd.set_allocated_pad_hook(request);
client->send_command(cmd);
}
void CommandFactory::send_buffer_request_command(bool enable, const std::string &pad_path, bool send_data)
{
- auto request = create_pad_watch_request(enable, pad_path);
- GstDebugger::BufferWatchRequest *buf_request = new GstDebugger::BufferWatchRequest();
+ auto request = create_pad_hook_request(enable, pad_path);
+ auto *buf_request = new GstDebugger::BufferHookRequest();
buf_request->set_send_data(send_data);
request->set_allocated_buffer(buf_request);
GstDebugger::Command cmd;
- cmd.set_allocated_pad_watch(request);
+ cmd.set_allocated_pad_hook(request);
client->send_command(cmd);
}
@@ -92,7 +92,7 @@ void CommandFactory::send_set_threshold_command(const std::string &threshold_lis
client->send_command(cmd);
}
-void CommandFactory::send_set_log_watch_command(bool enable, const std::string &category, int log_level)
+void CommandFactory::send_set_log_hook_command(bool enable, const std::string &category, int log_level)
{
GstDebugger::Command cmd;
GstDebugger::LogRequest *request = new GstDebugger::LogRequest();
diff --git a/src/gst-debugger/controller/command_factory.h b/src/gst-debugger/controller/command_factory.h
index a004ed8..941d1f7 100644
--- a/src/gst-debugger/controller/command_factory.h
+++ b/src/gst-debugger/controller/command_factory.h
@@ -16,7 +16,7 @@
class CommandFactory : public virtual BaseController
{
- static GstDebugger::PadWatchRequest* create_pad_watch_request(bool enable, const std::string
&pad_path);
+ static GstDebugger::PadHookRequest* create_pad_hook_request(bool enable, const std::string &pad_path);
public:
void send_property_request_command(const std::string &element_path, const std::string &property_name);
@@ -25,7 +25,7 @@ public:
void send_buffer_request_command(bool enable, const std::string &pad_path, bool send_data);
void send_message_request_command(int message_type, bool enable);
void send_set_threshold_command(const std::string &threshold_list, bool overwrite);
- void send_set_log_watch_command(bool enable, const std::string &category, int log_level);
+ void send_set_log_hook_command(bool enable, const std::string &category, int log_level);
void send_data_type_request_command(const std::string &type_name,
GstDebugger::TypeDescriptionRequest_Type type);
void send_request_debug_categories_command();
void send_request_entire_topology_command();
diff --git a/src/gst-debugger/modules/buffer_module.cpp b/src/gst-debugger/modules/buffer_module.cpp
index 4a3e6b9..94e8f6d 100644
--- a/src/gst-debugger/modules/buffer_module.cpp
+++ b/src/gst-debugger/modules/buffer_module.cpp
@@ -83,13 +83,13 @@ BufferControlModule::BufferControlModule()
hooks_tree_view->append_column("With data", hooks_model_columns.str2);
}
-void BufferControlModule::add_watch()
+void BufferControlModule::add_hook()
{
controller->send_buffer_request_command(true, controller->get_selected_pad_path(),
data_check_button->get_active());
}
-void BufferControlModule::remove_watch(const Gtk::TreeModel::Row& row)
+void BufferControlModule::remove_hook(const Gtk::TreeModel::Row& row)
{
Glib::ustring pad_path = row[hooks_model_columns.str1];
controller->send_buffer_request_command(false, pad_path,
@@ -98,10 +98,10 @@ void BufferControlModule::remove_watch(const Gtk::TreeModel::Row& row)
void BufferControlModule::confirmation_received(GstDebugger::Command* cmd)
{
- if (!cmd->has_pad_watch() || !cmd->pad_watch().has_buffer())
+ if (!cmd->has_pad_hook() || !cmd->pad_hook().has_buffer())
return;
- auto confirmation = cmd->pad_watch();
+ auto confirmation = cmd->pad_hook();
if (confirmation.action() == GstDebugger::ADD)
{
Gtk::TreeModel::Row row = *(hooks_model->append());
@@ -110,6 +110,6 @@ void BufferControlModule::confirmation_received(GstDebugger::Command* cmd)
}
else
{
- remove_hook(confirmation);
+ remove_confirmation_hook(confirmation);
}
}
diff --git a/src/gst-debugger/modules/buffer_module.h b/src/gst-debugger/modules/buffer_module.h
index afe2069..27b4439 100644
--- a/src/gst-debugger/modules/buffer_module.h
+++ b/src/gst-debugger/modules/buffer_module.h
@@ -33,13 +33,13 @@ class BufferControlModule : public ControlModule
Gtk::Label *pad_path_label;
Gtk::CheckButton *data_check_button;
- void add_watch() override;
- void remove_watch(const Gtk::TreeModel::Row& row) override;
+ void add_hook() override;
+ void remove_hook(const Gtk::TreeModel::Row& row) override;
void confirmation_received(GstDebugger::Command* cmd) override;
bool hook_is_the_same(const Gtk::TreeModel::Row& row, gconstpointer confirmation) override
{
- auto buffer = reinterpret_cast<const GstDebugger::PadWatchRequest*>(confirmation);
+ auto buffer = reinterpret_cast<const GstDebugger::PadHookRequest*>(confirmation);
return row[hooks_model_columns.str1] == buffer->pad();
}
diff --git a/src/gst-debugger/modules/control_module.h b/src/gst-debugger/modules/control_module.h
index 2e9b8aa..f9e0baa 100644
--- a/src/gst-debugger/modules/control_module.h
+++ b/src/gst-debugger/modules/control_module.h
@@ -37,8 +37,8 @@ protected:
HooksModelColumns hooks_model_columns;
Gtk::Box *main_box;
- Gtk::Button *add_watch_button;
- Gtk::Button *remove_watch_button;
+ Gtk::Button *add_hook_button;
+ Gtk::Button *remove_hook_button;
Gtk::TreeView *hooks_tree_view;
Gtk::ScrolledWindow *wnd;
@@ -50,7 +50,7 @@ protected:
}
template<typename T>
- void remove_hook(const T& confirmation)
+ void remove_confirmation_hook(const T& confirmation)
{
for (auto iter = hooks_model->children().begin();
iter != hooks_model->children().end(); ++iter)
@@ -64,8 +64,8 @@ protected:
}
virtual bool hook_is_the_same(const Gtk::TreeModel::Row& row, gconstpointer confirmation) = 0;
- virtual void add_watch() {}
- virtual void remove_watch(const Gtk::TreeModel::Row& row) {}
+ virtual void add_hook() {}
+ virtual void remove_hook(const Gtk::TreeModel::Row& row) {}
virtual void confirmation_received(GstDebugger::Command* cmd) {}
public:
@@ -73,11 +73,11 @@ public:
{
main_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
- add_watch_button = Gtk::manage(new Gtk::Button("Add watch"));
- add_watch_button->signal_clicked().connect([this] {
- add_watch();
+ add_hook_button = Gtk::manage(new Gtk::Button("Add hook"));
+ add_hook_button->signal_clicked().connect([this] {
+ add_hook();
});
- main_box->pack_start(*add_watch_button, false, true);
+ main_box->pack_start(*add_hook_button, false, true);
hooks_tree_view = Gtk::manage(new Gtk::TreeView());
wnd = Gtk::manage(new Gtk::ScrolledWindow);
@@ -86,14 +86,14 @@ public:
hooks_model = Gtk::ListStore::create(hooks_model_columns);
hooks_tree_view->set_model(hooks_model);
- remove_watch_button = Gtk::manage(new Gtk::Button("Remove watch"));
- main_box->pack_start(*remove_watch_button, false, true);
- remove_watch_button->signal_clicked().connect([this]{
+ remove_hook_button = Gtk::manage(new Gtk::Button("Remove hook"));
+ main_box->pack_start(*remove_hook_button, false, true);
+ remove_hook_button->signal_clicked().connect([this]{
auto selection = hooks_tree_view->get_selection();
if (!selection) return;
auto iter = selection->get_selected();
if (!iter) return;
- remove_watch(*iter);
+ remove_hook(*iter);
});
create_dispatcher("confirmation", sigc::mem_fun(*this, &ControlModule::confirmation_),
(GDestroyNotify)free_confirmation);
diff --git a/src/gst-debugger/modules/event_module.cpp b/src/gst-debugger/modules/event_module.cpp
index ceceba6..1703e6d 100644
--- a/src/gst-debugger/modules/event_module.cpp
+++ b/src/gst-debugger/modules/event_module.cpp
@@ -43,7 +43,7 @@ EventControlModule::EventControlModule()
{
}
-void EventControlModule::add_watch()
+void EventControlModule::add_hook()
{
auto it = types_combobox->get_active();
if (it)
@@ -53,7 +53,7 @@ void EventControlModule::add_watch()
}
}
-void EventControlModule::remove_watch(const Gtk::TreeModel::Row& row)
+void EventControlModule::remove_hook(const Gtk::TreeModel::Row& row)
{
Glib::ustring pad = row[hooks_model_columns.str2];
controller->send_event_request_command(false, pad, row[hooks_model_columns.int1]);
@@ -61,10 +61,10 @@ void EventControlModule::remove_watch(const Gtk::TreeModel::Row& row)
void EventControlModule::confirmation_received(GstDebugger::Command* cmd)
{
- if (!cmd->has_pad_watch() || !cmd->pad_watch().has_event())
+ if (!cmd->has_pad_hook() || !cmd->pad_hook().has_event())
return;
- auto confirmation = cmd->pad_watch();
+ auto confirmation = cmd->pad_hook();
if (confirmation.action() == GstDebugger::ADD)
{
Gtk::TreeModel::Row row = *(hooks_model->append());
@@ -74,6 +74,6 @@ void EventControlModule::confirmation_received(GstDebugger::Command* cmd)
}
else
{
- remove_hook(confirmation);
+ remove_confirmation_hook(confirmation);
}
}
diff --git a/src/gst-debugger/modules/event_module.h b/src/gst-debugger/modules/event_module.h
index 8cb7cc9..5bba2fa 100644
--- a/src/gst-debugger/modules/event_module.h
+++ b/src/gst-debugger/modules/event_module.h
@@ -26,8 +26,8 @@ class EventControlModule : virtual public ControlModule, public QEControlModule
{
void confirmation_received(GstDebugger::Command* cmd) override;
- void add_watch() override;
- void remove_watch(const Gtk::TreeModel::Row& row) override;
+ void add_hook() override;
+ void remove_hook(const Gtk::TreeModel::Row& row) override;
public:
EventControlModule();
diff --git a/src/gst-debugger/modules/log_module.cpp b/src/gst-debugger/modules/log_module.cpp
index 6b183d9..be8ce1f 100644
--- a/src/gst-debugger/modules/log_module.cpp
+++ b/src/gst-debugger/modules/log_module.cpp
@@ -82,17 +82,17 @@ void LogControlModule::set_controller(const std::shared_ptr<Controller> &control
});
}
-void LogControlModule::add_watch()
+void LogControlModule::add_hook()
{
- controller->send_set_log_watch_command(true, debug_categories_combobox->get_active_text(),
+ controller->send_set_log_hook_command(true, debug_categories_combobox->get_active_text(),
atoi(log_level_entry->get_text().c_str()));
}
-void LogControlModule::remove_watch(const Gtk::TreeModel::Row& row)
+void LogControlModule::remove_hook(const Gtk::TreeModel::Row& row)
{
Glib::ustring category = row[hooks_model_columns.str2];
int level = row[hooks_model_columns.int1];
- controller->send_set_log_watch_command(false, category, level);
+ controller->send_set_log_hook_command(false, category, level);
}
void LogControlModule::confirmation_received(GstDebugger::Command* cmd)
@@ -110,6 +110,6 @@ void LogControlModule::confirmation_received(GstDebugger::Command* cmd)
}
else
{
- remove_hook(confirmation);
+ remove_confirmation_hook(confirmation);
}
}
diff --git a/src/gst-debugger/modules/log_module.h b/src/gst-debugger/modules/log_module.h
index 191e8e9..706e880 100644
--- a/src/gst-debugger/modules/log_module.h
+++ b/src/gst-debugger/modules/log_module.h
@@ -29,8 +29,8 @@ class LogControlModule : public ControlModule
Gtk::Button *set_threshold_button;
Gtk::Entry *threshold_entry;
- void add_watch() override;
- void remove_watch(const Gtk::TreeModel::Row& row) override;
+ void add_hook() override;
+ void remove_hook(const Gtk::TreeModel::Row& row) override;
void confirmation_received(GstDebugger::Command* cmd) override;
bool hook_is_the_same(const Gtk::TreeModel::Row& row, gconstpointer confirmation) override
diff --git a/src/gst-debugger/modules/message_module.cpp b/src/gst-debugger/modules/message_module.cpp
index c0e8a8a..b1fd300 100644
--- a/src/gst-debugger/modules/message_module.cpp
+++ b/src/gst-debugger/modules/message_module.cpp
@@ -52,7 +52,7 @@ MessageControlModule::MessageControlModule()
hooks_tree_view->append_column("Type", hooks_model_columns.str1);
}
-void MessageControlModule::add_watch()
+void MessageControlModule::add_hook()
{
auto it = types_combobox->get_active();
if (it)
@@ -62,7 +62,7 @@ void MessageControlModule::add_watch()
}
}
-void MessageControlModule::remove_watch(const Gtk::TreeModel::Row& row)
+void MessageControlModule::remove_hook(const Gtk::TreeModel::Row& row)
{
controller->send_message_request_command(row[hooks_model_columns.int1], false);
}
@@ -108,6 +108,6 @@ void MessageControlModule::confirmation_received(GstDebugger::Command* cmd)
}
else
{
- remove_hook(confirmation);
+ remove_confirmation_hook(confirmation);
}
}
diff --git a/src/gst-debugger/modules/message_module.h b/src/gst-debugger/modules/message_module.h
index 71c5f23..fa56033 100644
--- a/src/gst-debugger/modules/message_module.h
+++ b/src/gst-debugger/modules/message_module.h
@@ -31,8 +31,8 @@ class MessageControlModule : public ControlModule
void confirmation_received(GstDebugger::Command* cmd) override;
- void add_watch() override;
- void remove_watch(const Gtk::TreeModel::Row& row) override;
+ void add_hook() override;
+ void remove_hook(const Gtk::TreeModel::Row& row) override;
bool hook_is_the_same(const Gtk::TreeModel::Row& row, gconstpointer confirmation) override
{
diff --git a/src/gst-debugger/modules/qe_control_module.h b/src/gst-debugger/modules/qe_control_module.h
index 07b2d14..591e1bd 100644
--- a/src/gst-debugger/modules/qe_control_module.h
+++ b/src/gst-debugger/modules/qe_control_module.h
@@ -23,7 +23,7 @@ protected:
bool hook_is_the_same(const Gtk::TreeModel::Row& row, gconstpointer confirmation) override
{
- auto pad = reinterpret_cast<const GstDebugger::PadWatchRequest*>(confirmation);
+ auto pad = reinterpret_cast<const GstDebugger::PadHookRequest*>(confirmation);
return row[hooks_model_columns.int1] == pad->event().type() && row[hooks_model_columns.str2]
== pad->pad();
}
diff --git a/src/gst-debugger/modules/query_module.cpp b/src/gst-debugger/modules/query_module.cpp
index de4bcd9..a5ae619 100644
--- a/src/gst-debugger/modules/query_module.cpp
+++ b/src/gst-debugger/modules/query_module.cpp
@@ -37,7 +37,7 @@ QueryControlModule::QueryControlModule()
{
}
-void QueryControlModule::add_watch()
+void QueryControlModule::add_hook()
{
auto it = types_combobox->get_active();
if (it)
@@ -47,7 +47,7 @@ void QueryControlModule::add_watch()
}
}
-void QueryControlModule::remove_watch(const Gtk::TreeModel::Row& row)
+void QueryControlModule::remove_hook(const Gtk::TreeModel::Row& row)
{
Glib::ustring pad = row[hooks_model_columns.str2];
controller->send_query_request_command(false, pad, row[hooks_model_columns.int1]);
@@ -55,10 +55,10 @@ void QueryControlModule::remove_watch(const Gtk::TreeModel::Row& row)
void QueryControlModule::confirmation_received(GstDebugger::Command* cmd)
{
- if (!cmd->has_pad_watch() || !cmd->pad_watch().has_query())
+ if (!cmd->has_pad_hook() || !cmd->pad_hook().has_query())
return;
- auto confirmation = cmd->pad_watch();
+ auto confirmation = cmd->pad_hook();
if (confirmation.action() == GstDebugger::ADD)
{
Gtk::TreeModel::Row row = *(hooks_model->append());
@@ -68,6 +68,6 @@ void QueryControlModule::confirmation_received(GstDebugger::Command* cmd)
}
else
{
- remove_hook(confirmation);
+ remove_confirmation_hook(confirmation);
}
}
diff --git a/src/gst-debugger/modules/query_module.h b/src/gst-debugger/modules/query_module.h
index 35c698a..24c6818 100644
--- a/src/gst-debugger/modules/query_module.h
+++ b/src/gst-debugger/modules/query_module.h
@@ -26,8 +26,8 @@ class QueryControlModule : virtual public ControlModule, public QEControlModule
{
void confirmation_received(GstDebugger::Command* cmd) override;
- void add_watch() override;
- void remove_watch(const Gtk::TreeModel::Row& row) override;
+ void add_hook() override;
+ void remove_hook(const Gtk::TreeModel::Row& row) override;
public:
QueryControlModule();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]