Commit c70bc2ea authored by Brateau Etienne's avatar Brateau Etienne Committed by Jean-Baptiste Kempf
Browse files

(patch) Use the functions to proxy calls for the video output thread

parent a78eacc7
From 7d93d3c988692c6f3f2bddfa17dacba9539e854b Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@gmail.com>
Date: Tue, 5 Sep 2017 17:35:44 +0200
Subject: [PATCH 06/10] Apply functions to use proxy video output to can easily
have the canvas in the video output.
---
src/libvlc.c | 13 +++++++++++++
src/video_output/video_output.c | 6 +++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/libvlc.c b/src/libvlc.c
index 7e343a6365..880671eb21 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -351,6 +351,14 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
var_Create( p_libvlc, "drawable-nsobject", VLC_VAR_ADDRESS );
#endif
+#ifdef __EMSCRIPTEN__
+ var_Create( p_libvlc, "emscripten-vout-proxy-create", VLC_VAR_BOOL );
+ var_SetBool( p_libvlc, "emscripten-vout-proxy-create", true );
+ /* Initialisation of the proxy thread */
+ vout_proxy_init( p_libvlc );
+ var_SetBool( p_libvlc, "emscripten-vout-proxy-create", false );
+#endif
+
/*
* Get input filenames given as commandline arguments.
* We assume that the remaining parameters are filenames
@@ -383,6 +391,11 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
{
libvlc_priv_t *priv = libvlc_priv (p_libvlc);
+#ifdef __EMSCRIPTEN__
+ /* Stopping the proxy thread */
+ vout_proxy_deinit(p_libvlc);
+#endif
+
if (priv->parser != NULL)
playlist_preparser_Deactivate(priv->parser);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 54a9356407..5c4c4b9c91 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -193,8 +193,7 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
vlc_object_set_destructor(vout, VoutDestructor);
/* */
- if (vlc_clone(&vout->p->thread, Thread, vout,
- VLC_THREAD_PRIORITY_OUTPUT)) {
+ if (!vout_proxy_run(vout, Thread, vout)) {
if (vout->p->window != NULL)
vout_display_window_Delete(vout->p->window);
spu_Destroy(vout->p->spu);
@@ -269,7 +268,8 @@ void vout_Close(vout_thread_t *vout)
vout_snapshot_End(&vout->p->snapshot);
vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_CLEAN);
- vlc_join(vout->p->thread, NULL);
+ // Emscripten : we dont"t need to join the thread here because it is proxyfied
+ //vlc_join(vout->p->thread, NULL);
if (vout->p->window != NULL)
vout_display_window_Delete(vout->p->window);
--
2.14.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment