[vlc-commits] test: demux-run: add libvlc_demux_process_memory

Thomas Guillem git at videolan.org
Sat Feb 23 10:17:04 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb 20 18:40:07 2019 +0100| [547a154b7fa70d4af56ab35937cf92186f7812a1] | committer: Thomas Guillem

test: demux-run: add libvlc_demux_process_memory

Same than vlc_demux_process_memory but with a libvlc_instance_t arg.

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

 test/src/input/demux-run.c | 19 +++++++++++++------
 test/src/input/demux-run.h |  3 +++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c
index fe9ce530b5..8178756ed6 100644
--- a/test/src/input/demux-run.c
+++ b/test/src/input/demux-run.c
@@ -363,6 +363,18 @@ int vlc_demux_process_path(const struct vlc_run_args *args, const char *path)
     return ret;
 }
 
+int libvlc_demux_process_memory(libvlc_instance_t *vlc,
+                                const struct vlc_run_args *args,
+                                const unsigned char *buf, size_t length)
+{
+    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),
+                                       (void *)buf, length, true);
+    if (s == NULL)
+        fprintf(stderr, "Error: cannot create input stream\n");
+
+    return demux_process_stream(args, s);
+}
+
 int vlc_demux_process_memory(const struct vlc_run_args *args,
                              const unsigned char *buf, size_t length)
 {
@@ -370,12 +382,7 @@ int vlc_demux_process_memory(const struct vlc_run_args *args,
     if (vlc == NULL)
         return -1;
 
-    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),
-                                       (void *)buf, length, true);
-    if (s == NULL)
-        fprintf(stderr, "Error: cannot create input stream\n");
-
-    int ret = demux_process_stream(args, s);
+    int ret = libvlc_demux_process_memory(vlc, args, buf, length);
     libvlc_release(vlc);
     return ret;
 }
diff --git a/test/src/input/demux-run.h b/test/src/input/demux-run.h
index 01ae245891..551f002770 100644
--- a/test/src/input/demux-run.h
+++ b/test/src/input/demux-run.h
@@ -30,3 +30,6 @@ int vlc_demux_process_url(const struct vlc_run_args *, const char *url);
 int vlc_demux_process_path(const struct vlc_run_args *, const char *path);
 int vlc_demux_process_memory(const struct vlc_run_args *,
                              const unsigned char *buf, size_t length);
+int libvlc_demux_process_memory(libvlc_instance_t *vlc,
+                                const struct vlc_run_args *args,
+                                const unsigned char *buf, size_t length);



More information about the vlc-commits mailing list