clapper: Move basic functions into separate files

Avoid including whole "clapper.h" internally.
Faster recompilation when changes are done.
This commit is contained in:
Rafał Dzięgiel
2025-05-16 16:19:40 +02:00
parent a97e7d1a96
commit e34f729f62
10 changed files with 67 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/* Clapper Playback Library /* Clapper Playback Library
* Copyright (C) 2024 Rafał Dzięgiel <rafostar.github@gmail.com> * Copyright (C) 2025 Rafał Dzięgiel <rafostar.github@gmail.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/pbutils/pbutils.h> #include <gst/pbutils/pbutils.h>
#include "clapper.h" #include "clapper-basic-functions.h"
#include "clapper-cache-private.h" #include "clapper-cache-private.h"
#include "clapper-utils-private.h" #include "clapper-utils-private.h"
#include "clapper-playbin-bus-private.h" #include "clapper-playbin-bus-private.h"
@@ -31,6 +31,8 @@
#include "clapper-enhancer-proxy-list-private.h" #include "clapper-enhancer-proxy-list-private.h"
#include "gst/clapper-plugin-private.h" #include "gst/clapper-plugin-private.h"
#include "clapper-functionalities-availability.h"
#if CLAPPER_WITH_ENHANCERS_LOADER #if CLAPPER_WITH_ENHANCERS_LOADER
#include "clapper-enhancers-loader-private.h" #include "clapper-enhancers-loader-private.h"
#endif #endif

View File

@@ -0,0 +1,46 @@
/* Clapper Playback Library
* Copyright (C) 2025 Rafał Dzięgiel <rafostar.github@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
#pragma once
#if !defined(__CLAPPER_INSIDE__) && !defined(CLAPPER_COMPILATION)
#error "Only <clapper/clapper.h> can be included directly."
#endif
#include <glib.h>
#include <glib-object.h>
#include <clapper/clapper-visibility.h>
#include <clapper/clapper-enhancer-proxy-list.h>
G_BEGIN_DECLS
CLAPPER_API
void clapper_init (int *argc, char **argv[]);
CLAPPER_API
gboolean clapper_init_check (int *argc, char **argv[]);
CLAPPER_DEPRECATED
gboolean clapper_enhancer_check (GType iface_type, const gchar *scheme, const gchar *host, const gchar **name);
CLAPPER_API
ClapperEnhancerProxyList * clapper_get_global_enhancer_proxies (void);
G_END_DECLS

View File

@@ -27,7 +27,7 @@
#include <gio/gio.h> #include <gio/gio.h>
#include "clapper.h" #include "clapper-basic-functions.h"
#include "clapper-enhancer-proxy-list-private.h" #include "clapper-enhancer-proxy-list-private.h"
#include "clapper-enhancer-proxy-private.h" #include "clapper-enhancer-proxy-private.h"

View File

@@ -43,8 +43,9 @@
#include <gobject/gvaluecollector.h> #include <gobject/gvaluecollector.h>
#include "clapper.h"
#include "clapper-enhancer-proxy-private.h" #include "clapper-enhancer-proxy-private.h"
#include "clapper-enhancer-proxy-list.h"
#include "clapper-basic-functions.h"
#include "clapper-cache-private.h" #include "clapper-cache-private.h"
#include "clapper-extractable.h" #include "clapper-extractable.h"
#include "clapper-enums.h" #include "clapper-enums.h"

View File

@@ -19,9 +19,6 @@
#pragma once #pragma once
#include <glib.h>
#include <glib-object.h>
#define __CLAPPER_INSIDE__ #define __CLAPPER_INSIDE__
#include <clapper/clapper-visibility.h> #include <clapper/clapper-visibility.h>
@@ -30,6 +27,7 @@
#include <clapper/clapper-version.h> #include <clapper/clapper-version.h>
#include <clapper/clapper-audio-stream.h> #include <clapper/clapper-audio-stream.h>
#include <clapper/clapper-basic-functions.h>
#include <clapper/clapper-enhancer-proxy.h> #include <clapper/clapper-enhancer-proxy.h>
#include <clapper/clapper-enhancer-proxy-list.h> #include <clapper/clapper-enhancer-proxy-list.h>
#include <clapper/clapper-feature.h> #include <clapper/clapper-feature.h>
@@ -61,20 +59,4 @@
#include <clapper/features/server/clapper-server.h> #include <clapper/features/server/clapper-server.h>
#endif #endif
G_BEGIN_DECLS
CLAPPER_API
void clapper_init (int *argc, char **argv[]);
CLAPPER_API
gboolean clapper_init_check (int *argc, char **argv[]);
CLAPPER_DEPRECATED
gboolean clapper_enhancer_check (GType iface_type, const gchar *scheme, const gchar *host, const gchar **name);
CLAPPER_API
ClapperEnhancerProxyList * clapper_get_global_enhancer_proxies (void);
G_END_DECLS
#undef __CLAPPER_INSIDE__ #undef __CLAPPER_INSIDE__

View File

@@ -20,6 +20,7 @@
#pragma once #pragma once
#include <glib.h> #include <glib.h>
#include <glib-object.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstpushsrc.h> #include <gst/base/gstpushsrc.h>

View File

@@ -22,9 +22,10 @@
#include "clapper-enhancer-src-private.h" #include "clapper-enhancer-src-private.h"
#include "clapper-enhancer-director-private.h" #include "clapper-enhancer-director-private.h"
#include "../clapper.h" #include "../clapper-basic-functions.h"
#include "../clapper-enhancer-proxy-list-private.h" #include "../clapper-enhancer-proxy.h"
#include "../clapper-extractable-private.h" #include "../clapper-enhancer-proxy-list.h"
#include "../clapper-extractable.h"
#include "../clapper-harvest-private.h" #include "../clapper-harvest-private.h"
#define GST_CAT_DEFAULT clapper_enhancer_src_debug #define GST_CAT_DEFAULT clapper_enhancer_src_debug

View File

@@ -21,10 +21,13 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "../clapper.h" #include "../clapper-basic-functions.h"
#include "clapper-enhancer-src-private.h" #include "../clapper-enhancer-proxy.h"
#include "../clapper-enhancer-proxy-list.h"
#include "../clapper-extractable.h"
#include "clapper-plugin-private.h" #include "clapper-plugin-private.h"
#include "clapper-enhancer-src-private.h"
#include "clapper-uri-list-demux-private.h" #include "clapper-uri-list-demux-private.h"
/* /*

View File

@@ -20,6 +20,7 @@
#pragma once #pragma once
#include <glib.h> #include <glib.h>
#include <glib-object.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/gstbin.h> #include <gst/gstbin.h>

View File

@@ -111,6 +111,7 @@ clapper_headers = [
'clapper.h', 'clapper.h',
'clapper-enums.h', 'clapper-enums.h',
'clapper-audio-stream.h', 'clapper-audio-stream.h',
'clapper-basic-functions.h',
'clapper-enhancer-proxy.h', 'clapper-enhancer-proxy.h',
'clapper-enhancer-proxy-list.h', 'clapper-enhancer-proxy-list.h',
'clapper-extractable.h', 'clapper-extractable.h',
@@ -131,9 +132,9 @@ clapper_headers = [
clapper_visibility_header, clapper_visibility_header,
] ]
clapper_sources = [ clapper_sources = [
'clapper.c',
'clapper-app-bus.c', 'clapper-app-bus.c',
'clapper-audio-stream.c', 'clapper-audio-stream.c',
'clapper-basic-functions.c',
'clapper-cache.c', 'clapper-cache.c',
'clapper-enhancer-proxy.c', 'clapper-enhancer-proxy.c',
'clapper-enhancer-proxy-list.c', 'clapper-enhancer-proxy-list.c',