[vlc-devel] [PATCH] sdp: take last function out of code

RĂ©mi Denis-Courmont remi at remlab.net
Sat Apr 18 19:26:18 CEST 2020


This really does not seem to belong there. Move it in the modules
directory where its two users are located.
---
 include/vlc_sout.h                            | 10 ------
 modules/stream_out/Makefile.am                |  4 ++-
 modules/stream_out/rtp.c                      |  1 +
 .../sdp.c => modules/stream_out/sdp_helper.c  | 12 +++----
 modules/stream_out/sdp_helper.h               | 34 +++++++++++++++++++
 modules/stream_out/standard.c                 |  1 +
 src/Makefile.am                               |  2 +-
 src/libvlccore.sym                            |  1 -
 8 files changed, 44 insertions(+), 21 deletions(-)
 rename src/stream_output/sdp.c => modules/stream_out/sdp_helper.c (97%)
 create mode 100644 modules/stream_out/sdp_helper.h

diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 9b9c898cfc..5439e5afb4 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -273,16 +273,6 @@ VLC_API void sout_AnnounceUnRegister(vlc_object_t *,session_descriptor_t* );
 #define sout_AnnounceUnRegister(o, a) \
         sout_AnnounceUnRegister(VLC_OBJECT (o), a)
 
-/** SDP */
-
-struct sockaddr;
-struct vlc_memstream;
-
-VLC_API int vlc_sdp_Start(struct vlc_memstream *, vlc_object_t *obj,
-                          const char *cfgpref,
-                          const struct sockaddr *src, size_t slen,
-                          const struct sockaddr *addr, size_t alen) VLC_USED;
-
 /** @} */
 
 #ifdef __cplusplus
diff --git a/modules/stream_out/Makefile.am b/modules/stream_out/Makefile.am
index e9a7feccfc..6cc77a3350 100644
--- a/modules/stream_out/Makefile.am
+++ b/modules/stream_out/Makefile.am
@@ -4,7 +4,8 @@ libstream_out_dummy_plugin_la_SOURCES = stream_out/dummy.c
 libstream_out_cycle_plugin_la_SOURCES = stream_out/cycle.c
 libstream_out_delay_plugin_la_SOURCES = stream_out/delay.c
 libstream_out_stats_plugin_la_SOURCES = stream_out/stats.c
-libstream_out_standard_plugin_la_SOURCES = stream_out/standard.c
+libstream_out_standard_plugin_la_SOURCES = stream_out/standard.c \
+	stream_out/sdp_helper.c stream_out/sdp_helper.h
 libstream_out_standard_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_access_output_srt)
 libstream_out_standard_plugin_la_LIBADD = $(SOCKET_LIBS)
 libstream_out_duplicate_plugin_la_SOURCES = stream_out/duplicate.c
@@ -77,6 +78,7 @@ endif
 # RTP plugin
 sout_LTLIBRARIES += libstream_out_rtp_plugin.la
 libstream_out_rtp_plugin_la_SOURCES = \
+	stream_out/sdp_helper.c stream_out/sdp_helper.h \
 	stream_out/rtp.c stream_out/rtp.h stream_out/rtpfmt.c \
 	stream_out/rtcp.c stream_out/rtsp.c
 libstream_out_rtp_plugin_la_CFLAGS = $(AM_CFLAGS)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index ce5916fe19..e01a09127c 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -50,6 +50,7 @@
 #endif
 
 #include "rtp.h"
+#include "sdp_helper.h"
 
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/src/stream_output/sdp.c b/modules/stream_out/sdp_helper.c
similarity index 97%
rename from src/stream_output/sdp.c
rename to modules/stream_out/sdp_helper.c
index f3fea58409..caa646b30b 100644
--- a/src/stream_output/sdp.c
+++ b/modules/stream_out/sdp_helper.c
@@ -22,18 +22,14 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-
-#include <stddef.h>
 #include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <assert.h>
-#include <vlc_network.h>
+
+#include <vlc_common.h>
 #include <vlc_charset.h>
+#include <vlc_network.h>
 #include <vlc_memstream.h>
 
-#include "stream_output.h"
+#include "sdp_helper.h"
 
 #define MAXSDPADDRESS 47
 
diff --git a/modules/stream_out/sdp_helper.h b/modules/stream_out/sdp_helper.h
new file mode 100644
index 0000000000..9f4f2e10f8
--- /dev/null
+++ b/modules/stream_out/sdp_helper.h
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * sdp_helpert.h:
+ *****************************************************************************
+ * Copyright (C) 2002-2008 VLC authors and VideoLAN
+ *
+ * This program 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 program 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_SOUT_SDP_H
+#define VLC_SOUT_SDP_H
+
+#include <stddef.h>
+
+struct sockaddr;
+struct vlc_memstream;
+
+int vlc_sdp_Start(struct vlc_memstream *, vlc_object_t *obj,
+                  const char *cfgpref,
+                  const struct sockaddr *src, size_t slen,
+                  const struct sockaddr *addr, size_t alen) VLC_USED;
+
+#endif
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index 21c7ffead2..eb76e70b94 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -34,6 +34,7 @@
 #include <vlc_network.h>
 #include <vlc_url.h>
 #include <vlc_memstream.h>
+#include "sdp_helper.h"
 
 /*****************************************************************************
  * Module descriptor
diff --git a/src/Makefile.am b/src/Makefile.am
index f6e92e9154..9e088c1fd9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -507,7 +507,7 @@ endif
 
 if ENABLE_SOUT
 libvlccore_la_SOURCES += \
-	stream_output/sap.c stream_output/sdp.c \
+	stream_output/sap.c \
 	stream_output/stream_output.c stream_output/stream_output.h
 if ENABLE_VLM
 libvlccore_la_SOURCES += input/vlm.c input/vlm_event.c input/vlmshell.c
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 78597ef1ce..504801246b 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -642,7 +642,6 @@ vlc_sd_Create
 vlc_sd_Destroy
 vlc_sd_GetNames
 vlc_sd_probe_Add
-vlc_sdp_Start
 vlc_testcancel
 vlc_thread_id
 vlc_threadvar_create
-- 
2.26.1



More information about the vlc-devel mailing list