vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Fri Jan 18 22:49:35 2019 +0200| [a46a9cbf5a75a7553de76e9e6e0e8fa19f277984] | committer: Rémi Denis-Courmont
vout: add vout_Stop() This stops a vout but leaves it for reuse. So far, this was handled by vout_Request() with a NULL format. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a46a9cbf5a75a7553de76e9e6e0e8fa19f277984 --- src/video_output/video_output.c | 16 ++++++++++++++++ src/video_output/vout_internal.h | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 853ed00619..d83c828216 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -259,6 +259,22 @@ vout_thread_t *vout_Request(vlc_object_t *object, return VoutCreate(object, cfg, input); } +void vout_Stop(vout_thread_t *vout) +{ + if (vout->p->input != NULL) { + spu_Detach(vout->p->spu); + vout->p->input = NULL; + } + + vout_control_cmd_t cmd; + vout_configuration_t cfg = { .fmt = NULL }; + + vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT); + cmd.cfg = &cfg; + vout_control_Push(&vout->p->control, &cmd); + vout_control_WaitEmpty(&vout->p->control); +} + void vout_Close(vout_thread_t *vout) { assert(vout); diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h index 21ae108c6c..991fc695a9 100644 --- a/src/video_output/vout_internal.h +++ b/src/video_output/vout_internal.h @@ -166,6 +166,13 @@ vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t * #define vout_Request(a,b,c) vout_Request(VLC_OBJECT(a),b,c) /** + * Disables a vout. + * + * This disables a vout, but keeps it for later reuse. + */ +void vout_Stop(vout_thread_t *); + +/** * Destroys a vout. * * This function closes and releases a vout created by vout_Request(). _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
