Skip to content

Commit

Permalink
Merge ad97f66 into a4a73d8
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Jan 31, 2015
2 parents a4a73d8 + ad97f66 commit 45b073f
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 187 deletions.
10 changes: 5 additions & 5 deletions logutils.h
Expand Up @@ -38,13 +38,13 @@
#define INFO(S, ...) ((void) FALSE)
#define WARN(S, ...) ((void) FALSE)
#define ERROR(S, ...) ((void) FALSE)
#endif//DEBUG
#endif //DEBUG
#if ENABLE_ASSESSMENT
extern guint assess_number;
#define ASSESS(name, ...) (g_string_append_printf (desc, "! assess n=%d name="#name " ", assess_number++, ##__VA_ARGS__))
#else
#define ASSESS(name, ...) ((void) FALSE);
#endif//ENABLE_ASSESSMENT
#define LOW_RES_W 300 /* 100 */ /* 160 */ /* 320 */
#define LOW_RES_H 200 /* 56 */ /* 120 */ /* 240 */
#endif//__LOG_UTILS_H__
#endif //ENABLE_ASSESSMENT
#define LOW_RES_W 300 /* 100 */ /* 160 */ /* 320 */
#define LOW_RES_H 200 /* 56 */ /* 120 */ /* 240 */
#endif //__LOG_UTILS_H__
9 changes: 4 additions & 5 deletions plugins/gstassess.h
Expand Up @@ -24,7 +24,6 @@
#include <gst/base/gstbasetransform.h>

G_BEGIN_DECLS

#define GST_TYPE_ASSESS \
(gst_assess_get_type ())
#define GST_ASSESS(obj) \
Expand All @@ -35,14 +34,14 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ASSESS))
#define GST_IS_ASSESS_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ASSESS))

typedef struct _GstAssess GstAssess;
typedef struct _GstAssessClass GstAssessClass;

/**
* @brief Helper class for assessment.
*/
struct _GstAssess {
struct _GstAssess
{
GstBaseTransform base;
GMutex lock;

Expand All @@ -55,12 +54,12 @@ struct _GstAssess {
/**
* @brief GstAssessClass
*/
struct _GstAssessClass {
struct _GstAssessClass
{
GstBaseTransformClass base_class;
};

GType gst_assess_get_type (void);

G_END_DECLS

#endif //__GST_ASSESS_H__
16 changes: 8 additions & 8 deletions plugins/gstconvbin.h
Expand Up @@ -24,7 +24,6 @@
#include <gst/gstbin.h>

G_BEGIN_DECLS

#define GST_TYPE_CONV_BIN \
(gst_conv_bin_get_type ())
#define GST_CONV_BIN(obj) \
Expand All @@ -35,35 +34,36 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj),GST_TYPE_CONV_BIN))
#define GST_IS_CONV_BIN_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass),GST_TYPE_CONV_BIN))

typedef struct _GstConvBin GstConvBin;
typedef struct _GstConvBinClass GstConvBinClass;

typedef enum {
typedef enum
{
GST_CONV_BIN_PAD_FLAG_GHOSTED = (GST_BIN_FLAG_LAST << 1),
GST_CONV_BIN_PAD_FLAG_LAST = (GST_BIN_FLAG_LAST << 2),
} GstConvBinFlags;

/**
* @deprecated
*/
struct _GstConvBin {
struct _GstConvBin
{
GstBin base;

GMutex lock;
gchar * converter;
gchar * autosink;
gchar *converter;
gchar *autosink;
};

/**
* @deprecated
*/
struct _GstConvBinClass {
struct _GstConvBinClass
{
GstBinClass base_class;
};

GType gst_conv_bin_get_type (void);

G_END_DECLS

#endif //__GST_CONV_BIN_H__
12 changes: 6 additions & 6 deletions plugins/gstswitch.h
Expand Up @@ -24,7 +24,6 @@
#include <gst/gstbin.h>

G_BEGIN_DECLS

#define GST_TYPE_SWITCH \
(gst_switch_get_type ())
#define GST_SWITCH(obj) \
Expand All @@ -35,18 +34,19 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SWITCH))
#define GST_IS_SWITCH_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SWITCH))

typedef struct _GstSwitch GstSwitch;
typedef struct _GstSwitchClass GstSwitchClass;

typedef enum {
typedef enum
{
GST_SWITCH_FLAG_LAST = (GST_BIN_FLAG_LAST << 2)
} GstSwitchFlags;

/**
* @deprecated
*/
struct _GstSwitch {
struct _GstSwitch
{
GstBin base;
GMutex lock;
gchar *cases_string;
Expand All @@ -55,12 +55,12 @@ struct _GstSwitch {
/**
* @deprecated
*/
struct _GstSwitchClass {
struct _GstSwitchClass
{
GstBinClass base_class;
};

GType gst_switch_get_type (void);

G_END_DECLS

#endif //__GST_SWITCH_H__
26 changes: 13 additions & 13 deletions plugins/gsttcpmixsrc.h
Expand Up @@ -25,7 +25,6 @@
#include <gio/gio.h>

G_BEGIN_DECLS

#define GST_TYPE_TCP_MIX_SRC \
(gst_tcp_mix_src_get_type())
#define GST_TCP_MIX_SRC(obj) \
Expand All @@ -36,43 +35,45 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TCP_MIX_SRC))
#define GST_IS_TCP_MIX_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TCP_MIX_SRC))

typedef struct _GstTCPMixSrc GstTCPMixSrc;
typedef struct _GstTCPMixSrcClass GstTCPMixSrcClass;

typedef enum {
GST_TCP_MIX_SRC_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_TCP_MIX_SRC_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2)
typedef enum
{
GST_TCP_MIX_SRC_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_TCP_MIX_SRC_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2)
} GstTCPMixSrcFlags;

/**
* @deprecated
*/
struct _GstTCPMixSrc {
struct _GstTCPMixSrc
{
GstElement base;

gchar *host;
int server_port;
int bound_port; /* currently bound-to port, or 0 */ /* ATOMIC */
int mode; /* stream working mode for disconnection */
int fill; /* fill type for disconnected stream */
int bound_port; /* currently bound-to port, or 0 *//* ATOMIC */
int mode; /* stream working mode for disconnection */
int fill; /* fill type for disconnected stream */

GCancellable *cancellable;
GSocket *server_socket;

GMutex acceptor_mutex;

GThread *acceptor;
gchar * autosink;
gchar *autosink;
};

/**
* @deprecated
*/
struct _GstTCPMixSrcClass {
struct _GstTCPMixSrcClass
{
GstElementClass base_class;

void (*new_client) (GstElement *element, GstPad *pad);
void (*new_client) (GstElement * element, GstPad * pad);
};

/**
Expand All @@ -81,5 +82,4 @@ struct _GstTCPMixSrcClass {
GType gst_tcp_mix_src_get_type (void);

G_END_DECLS

#endif //__GST_TCP_MIX_SRC_H__
9 changes: 5 additions & 4 deletions tests/test_switch_server.c
Expand Up @@ -328,7 +328,7 @@ child_quit (GPid pid, gint status, gpointer data)
INFO ("quit %d", pid);
{
g_mutex_lock (&children_lock);
children = g_list_remove (children, (gconstpointer) GINT_TO_POINTER(pid));
children = g_list_remove (children, (gconstpointer) GINT_TO_POINTER (pid));
g_mutex_unlock (&children_lock);
}

Expand Down Expand Up @@ -447,7 +447,7 @@ launch (const gchar * name, ...)

if (ok) {
g_mutex_lock (&children_lock);
children = g_list_append (children, (gpointer) GINT_TO_POINTER(pid));
children = g_list_append (children, (gpointer) GINT_TO_POINTER (pid));
g_mutex_unlock (&children_lock);
}

Expand Down Expand Up @@ -1032,7 +1032,8 @@ testclient_run (gpointer data)
client->mainloop = g_main_loop_new (NULL, TRUE);

connect_ok =
gst_switch_client_connect (GST_SWITCH_CLIENT (client), CLIENT_ROLE_UI, "tcp:host=127.0.0.1,port=5000");
gst_switch_client_connect (GST_SWITCH_CLIENT (client), CLIENT_ROLE_UI,
"tcp:host=127.0.0.1,port=5000");
g_assert (connect_ok);

client->compose_port0 =
Expand Down Expand Up @@ -2369,7 +2370,7 @@ kill_children (void)
GList *child = NULL;
g_mutex_lock (&children_lock);
for (child = children; child; child = g_list_next (child)) {
GPid pid = (GPid) GPOINTER_TO_INT(child->data);
GPid pid = (GPid) GPOINTER_TO_INT (child->data);
//INFO ("kill %d", pid);
kill (pid, SIGKILL);
children = g_list_remove_link (children, child);
Expand Down
15 changes: 7 additions & 8 deletions tools/gio/gsocketinputstream.h
Expand Up @@ -22,7 +22,6 @@
#include <gio/gsocket.h>

G_BEGIN_DECLS

#define G_TYPE_SOCKET_INPUT_STREAM (_g_socket_input_stream_get_type ())
#define G_SOCKET_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
G_TYPE_SOCKET_INPUT_STREAM, GSocketInputStreamX))
Expand All @@ -34,10 +33,9 @@ G_BEGIN_DECLS
G_TYPE_SOCKET_INPUT_STREAM))
#define G_SOCKET_INPUT_STREAM_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
G_TYPE_SOCKET_INPUT_STREAM, GSocketInputStreamXClass))

typedef struct _GSocketInputStreamXPrivate GSocketInputStreamXPrivate;
typedef struct _GSocketInputStreamXClass GSocketInputStreamXClass;
typedef struct _GSocketInputStreamX GSocketInputStreamX;
typedef struct _GSocketInputStreamXPrivate GSocketInputStreamXPrivate;
typedef struct _GSocketInputStreamXClass GSocketInputStreamXClass;
typedef struct _GSocketInputStreamX GSocketInputStreamX;

/**
* @brief Upward comatible with GSocketInputStreamClass
Expand All @@ -56,10 +54,11 @@ struct _GSocketInputStreamX
GSocketInputStreamXPrivate *priv;
};

GType _g_socket_input_stream_get_type (void) G_GNUC_CONST;
GSocketInputStreamX * _g_socket_input_stream_new (GSocket *socket);
GType
_g_socket_input_stream_get_type (void)
G_GNUC_CONST;
GSocketInputStreamX *_g_socket_input_stream_new (GSocket * socket);

G_END_DECLS

#undef __GIO_GIO_H_INSIDE__
#endif //__G_SOCKET_INPUT_STREAM_H__
11 changes: 5 additions & 6 deletions tools/gstaudiovisual.c
Expand Up @@ -238,13 +238,12 @@ gst_audio_visual_get_pipeline_string (GstAudioVisual * visual)

desc = g_string_new ("");

g_string_append_printf (
desc, "tcpclientsrc name=source port=%d ", visual->port);
g_string_append_printf (desc, "tcpclientsrc name=source port=%d ",
visual->port);
g_string_append_printf (desc, "! gdpdepay ! tee name=a\n");

if (visual->active) {
g_string_append_printf (
desc,
g_string_append_printf (desc,
"a. ! queue ! audioconvert ! level name=level message=true !"
" autoaudiosink name=play sync=false\n");
}
Expand All @@ -257,7 +256,7 @@ gst_audio_visual_get_pipeline_string (GstAudioVisual * visual)
g_string_append_printf (desc, "! videoconvert ");
g_string_append_printf (desc, "! xvimagesink name=visual sync=false ");

INFO("Audio preview: %s", desc->str);
INFO ("Audio preview: %s", desc->str);

return desc;
}
Expand Down Expand Up @@ -350,7 +349,7 @@ gst_audio_visual_message (GstAudioVisual * visual, GstMessage * message)
gdouble v = 0.0;
channels = va->len;
for (i = 0; i < channels; ++i) {
value = g_array_index (va, GValue*, i);
value = g_array_index (va, GValue *, i);
rms_dB = g_value_get_double (value);

/* converting from dB to normal gives us a value between 0.0 and 1.0
Expand Down
24 changes: 12 additions & 12 deletions tools/gstaudiovisual.h
Expand Up @@ -46,20 +46,20 @@ typedef struct _GstAudioVisualClass GstAudioVisualClass;
*/
struct _GstAudioVisual
{
GstWorker base; /*!< the parent object */
GstWorker base; /*!< the parent object */

gint port; /*!< the port number */
gulong handle; /*!< the X window handle for displaying the audio visualization */
gboolean active; /*!< TRUE if the audio is active. A active audio will be sinked to
* the real hardware speaker, e.g. ALSA
**/
gint port; /*!< the port number */
gulong handle; /*!< the X window handle for displaying the audio visualization */
gboolean active; /*!< TRUE if the audio is active. A active audio will be sinked to
* the real hardware speaker, e.g. ALSA
**/

gboolean renewing; /*!< Used by GstSwitchUI. */
gboolean renewing; /*!< Used by GstSwitchUI. */

GMutex endtime_lock; /*!< the lock for %endtime */
GstClockTime endtime; /*!< the endtime of the last audio sample */
GMutex value_lock; /*!< the lock for %value */
gdouble value; /*!< the value of the last audio sample */
GMutex endtime_lock; /*!< the lock for %endtime */
GstClockTime endtime; /*!< the endtime of the last audio sample */
GMutex value_lock; /*!< the lock for %value */
gdouble value; /*!< the value of the last audio sample */
};

/**
Expand All @@ -69,7 +69,7 @@ struct _GstAudioVisual
*/
struct _GstAudioVisualClass
{
GstWorkerClass base_class; /*!< the parent class */
GstWorkerClass base_class; /*!< the parent class */
};

GType gst_audio_visual_get_type (void);
Expand Down

0 comments on commit 45b073f

Please sign in to comment.