[vlc-devel] [PATCH 1/3] expose demux_New

Francois Cartegnie fcvlcdev at free.fr
Fri Sep 25 16:46:53 CEST 2015


---
 include/vlc_demux.h      | 48 +++++++++++++++++++++++++++++++++----
 src/Makefile.am          |  1 -
 src/input/demux.c        |  3 ++-
 src/input/demux.h        | 61 ------------------------------------------------
 src/input/input.c        |  2 +-
 src/input/stream_demux.c |  3 ++-
 src/libvlccore.sym       |  2 ++
 7 files changed, 50 insertions(+), 70 deletions(-)
 delete mode 100644 src/input/demux.h

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index e0b4c49..2c8e668 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -183,7 +183,49 @@ enum demux_query_e
     DEMUX_NAV_RIGHT,           /* res=can fail */
 };
 
-VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args );
+/*************************************************************************
+ * Main Demux
+ *************************************************************************/
+
+/* stream_t *s could be null and then it mean a access+demux in one */
+VLC_API demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
+                            const char *psz_access, const char *psz_demux,
+                            const char *psz_path, stream_t *s, es_out_t *out, bool );
+#define demux_New( a, b, c, d, e, f, g, h ) demux_New(VLC_OBJECT(a),b,c,d,e,f,g,h)
+
+VLC_API void demux_Delete( demux_t * );
+
+
+VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end,
+                                   int64_t i_bitrate, int i_align, int i_query, va_list args );
+
+VLC_USED static inline int demux_Demux( demux_t *p_demux )
+{
+    if( !p_demux->pf_demux )
+        return 1;
+
+    return p_demux->pf_demux( p_demux );
+}
+
+static inline int demux_vaControl( demux_t *p_demux, int i_query, va_list args )
+{
+    return p_demux->pf_control( p_demux, i_query, args );
+}
+
+static inline int demux_Control( demux_t *p_demux, int i_query, ... )
+{
+    va_list args;
+    int     i_result;
+
+    va_start( args, i_query );
+    i_result = demux_vaControl( p_demux, i_query, args );
+    va_end( args );
+    return i_result;
+}
+
+/*************************************************************************
+ * Miscellaneous helpers for demuxers
+ *************************************************************************/
 
 static inline void demux_UpdateTitleFromStream( demux_t *demux )
 {
@@ -205,10 +247,6 @@ static inline void demux_UpdateTitleFromStream( demux_t *demux )
     }
 }
 
-/*************************************************************************
- * Miscellaneous helpers for demuxers
- *************************************************************************/
-
 VLC_USED
 static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension )
 {
diff --git a/src/Makefile.am b/src/Makefile.am
index 2520d67..03d030d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -363,7 +363,6 @@ SOURCES_libvlc_common = \
 	input/meta.c \
 	input/clock.h \
 	input/decoder.h \
-	input/demux.h \
 	input/es_out.h \
 	input/es_out_timeshift.h \
 	input/event.h \
diff --git a/src/input/demux.c b/src/input/demux.c
index 91f1742..5f0a371 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -25,7 +25,8 @@
 # include "config.h"
 #endif
 
-#include "demux.h"
+#include <vlc_demux.h>
+#include "stream.h"
 #include <libvlc.h>
 #include <vlc_codec.h>
 #include <vlc_meta.h>
diff --git a/src/input/demux.h b/src/input/demux.h
deleted file mode 100644
index 3372f17..0000000
--- a/src/input/demux.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * demux.h: Input demux functions
- *****************************************************************************
- * Copyright (C) 1998-2008 VLC authors and VideoLAN
- * Copyright (C) 2008 Laurent Aimar
- * $Id$
- *
- * Authors: Laurent Aimar <fenrir at via.ecp.fr>
- *
- * 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 LIBVLC_INPUT_DEMUX_H
-#define LIBVLC_INPUT_DEMUX_H 1
-
-#include <vlc_common.h>
-#include <vlc_demux.h>
-
-#include "stream.h"
-
-/* stream_t *s could be null and then it mean a access+demux in one */
-demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input, const char *psz_access, const char *psz_demux, const char *psz_path, stream_t *s, es_out_t *out, bool );
-#define demux_New( a, b, c, d, e, f, g, h ) demux_New(VLC_OBJECT(a),b,c,d,e,f,g,h)
-
-void demux_Delete( demux_t * );
-
-static inline int demux_Demux( demux_t *p_demux )
-{
-    if( !p_demux->pf_demux )
-        return 1;
-
-    return p_demux->pf_demux( p_demux );
-}
-static inline int demux_vaControl( demux_t *p_demux, int i_query, va_list args )
-{
-    return p_demux->pf_control( p_demux, i_query, args );
-}
-static inline int demux_Control( demux_t *p_demux, int i_query, ... )
-{
-    va_list args;
-    int     i_result;
-
-    va_start( args, i_query );
-    i_result = demux_vaControl( p_demux, i_query, args );
-    va_end( args );
-    return i_result;
-}
-
-#endif
diff --git a/src/input/input.c b/src/input/input.c
index 6b40a45..03f1a4d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -41,11 +41,11 @@
 #include "event.h"
 #include "es_out.h"
 #include "es_out_timeshift.h"
-#include "demux.h"
 #include "stream.h"
 #include "item.h"
 #include "resource.h"
 
+#include <vlc_demux.h>
 #include <vlc_sout.h>
 #include <vlc_dialog.h>
 #include <vlc_url.h>
diff --git a/src/input/stream_demux.c b/src/input/stream_demux.c
index e25814c..8f377aa 100644
--- a/src/input/stream_demux.c
+++ b/src/input/stream_demux.c
@@ -26,7 +26,8 @@
 #endif
 #include <limits.h>
 
-#include "demux.h"
+#include "stream.h"
+#include <vlc_demux.h>
 #include <libvlc.h>
 #include <vlc_codec.h>
 #include <vlc_atomic.h>
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 6d64c8e..6cf99e3 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -89,8 +89,10 @@ decoder_SynchroReset
 decoder_SynchroTrash
 decode_URI
 decode_URI_duplicate
+demux_Delete
 demux_PacketizerDestroy
 demux_PacketizerNew
+demux_New
 demux_vaControlHelper
 dialog_ExtensionUpdate
 dialog_Login
-- 
2.4.3



More information about the vlc-devel mailing list