[vlc-commits] add stream_Custom

Francois Cartegnie git at videolan.org
Mon Oct 5 23:31:43 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 25 16:41:29 2015 +0200| [3946b13fa2908a0389c75b2ed70d095ae783d4fd] | committer: Francois Cartegnie

add stream_Custom

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3946b13fa2908a0389c75b2ed70d095ae783d4fd
---

 include/vlc_stream.h |    5 +++++
 src/input/stream.c   |    9 +++++++++
 src/libvlccore.sym   |    1 +
 3 files changed, 15 insertions(+)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index cbdd2fa..e29cf5b 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -160,6 +160,11 @@ VLC_API char * stream_ReadLine( stream_t * );
 VLC_API input_item_t *stream_ReadDir( stream_t * );
 
 /**
+ * Low level custom stream creation.
+ */
+VLC_API stream_t *stream_CustomNew(vlc_object_t *, void (*)(stream_t *));
+
+/**
  * Get the size of the stream.
  */
 VLC_USED static inline int stream_GetSize( stream_t *s, uint64_t *size )
diff --git a/src/input/stream.c b/src/input/stream.c
index 15a4079..b84fd13 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -57,6 +57,14 @@ typedef struct stream_priv_t
 } stream_priv_t;
 
 /**
+ * Allocates a custom VLC stream object
+ */
+stream_t *stream_CustomNew(vlc_object_t *parent, void (*destroy)(stream_t *))
+{
+    return stream_CommonNew(parent, destroy);
+}
+
+/**
  * Allocates a VLC stream object
  */
 stream_t *stream_CommonNew(vlc_object_t *parent, void (*destroy)(stream_t *))
@@ -73,6 +81,7 @@ stream_t *stream_CommonNew(vlc_object_t *parent, void (*destroy)(stream_t *))
     s->pf_read = NULL;
     s->pf_readdir = NULL;
     s->pf_control = NULL;
+    s->p_sys = NULL;
     s->p_input = NULL;
     assert(destroy != NULL);
     priv->destroy = destroy;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index dd813bc..a93ed58 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -394,6 +394,7 @@ spu_RegisterChannel
 spu_ClearChannel
 stream_Block
 stream_Control
+stream_CustomNew
 stream_Delete
 stream_DemuxNew
 stream_DemuxSend



More information about the vlc-commits mailing list