Skip to content

Commit

Permalink
Merge pull request #246 from RidgeRun/feature/add-libgstd-control-pip…
Browse files Browse the repository at this point in the history
…eline-functions
  • Loading branch information
Joseda8 committed Sep 23, 2021
2 parents acd7eb9 + 7b19f65 commit dff1906
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion libgstd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ libgstd_@GSTD_API_VERSION@_la_SOURCES = \
gstd_socket.c \
gstd_unix.c \
gstd_signal_list.c \
../gstd/gstd_log.c
gstd_log.c

libgstd_@GSTD_API_VERSION@_la_CFLAGS = \
$(GST_CFLAGS) \
Expand Down
27 changes: 15 additions & 12 deletions gstd/gstd_log.c → libgstd/gstd_log.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* GStreamer Daemon - Gst Launch under steroids
* Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com)
* Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -34,20 +34,21 @@ GST_DEBUG_CATEGORY (gstd_debug);
#define GSTD_DEBUG_PREFIX "gstd"
#define GSTD_DEBUG_LEVEL "WARNING"

static void
gstd_log_proxy (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object,
GstDebugMessage * message, gpointer user_data) G_GNUC_NO_INSTRUMENT;

static const gchar *gstd_log_get_gstd_default (void);
static const gchar *gstd_log_get_gst_default (void);
static gchar *gstd_log_get_filename (const gchar * filename,
const gchar * default_filename);

static FILE *_gstdlog = NULL;
static FILE *_gstlog = NULL;
static gchar *gstd_filename;
static gchar *gst_filename;
static void
gstd_log_proxy (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object,
GstDebugMessage * message, gpointer user_data)
G_GNUC_NO_INSTRUMENT;

static FILE *_gstdlog = NULL;
static FILE *_gstlog = NULL;
static gchar *gstd_filename;
static gchar *gst_filename;

gboolean
gstd_log_init (const gchar * gstdfilename, const gchar * gstfilename)
Expand All @@ -62,7 +63,8 @@ gstd_log_init (const gchar * gstdfilename, const gchar * gstfilename)
_gstdlog = g_fopen (gstd_filename, "a+");

if (!_gstdlog) {
g_printerr ("Unable to open Gstd log file %s: %s\n", gstd_filename, g_strerror (errno));
g_printerr ("Unable to open Gstd log file %s: %s\n", gstd_filename,
g_strerror (errno));
return FALSE;
}

Expand All @@ -71,7 +73,8 @@ gstd_log_init (const gchar * gstdfilename, const gchar * gstfilename)
_gstlog = g_fopen (gst_filename, "a+");

if (!_gstlog) {
g_printerr ("Unable to open Gst log file %s: %s\n", gst_filename, g_strerror (errno));
g_printerr ("Unable to open Gst log file %s: %s\n", gst_filename,
g_strerror (errno));
return FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion gstd/gstd_log.h → libgstd/gstd_log.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* GStreamer Daemon - Gst Launch under steroids
* Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com)
* Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion libgstd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ gstd_src = [
'gstd_session.c',
'gstd_socket.c',
'gstd_unix.c',
'../gstd/gstd_log.c',
'gstd_log.c',
]

libgstd_src = [
Expand Down

0 comments on commit dff1906

Please sign in to comment.