[vlc-commits] vout: spu: pass channel order to vout_ChangeSubMargin

Roland Bewick git at videolan.org
Tue Jun 25 20:55:23 CEST 2019


vlc | branch: master | Roland Bewick <roland.bewick at gmail.com> | Fri Jun 14 16:59:43 2019 +0200| [3b231c860c8712399bbc3df696a217c894c7cec7] | committer: Thomas Guillem

vout: spu: pass channel order to vout_ChangeSubMargin

And rename it to vout_ChangeSpuChannelMargin.

A margin is now set for a specific channel order.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 src/video_output/video_output.c     |  5 +++--
 src/video_output/vout_internal.h    |  4 ++--
 src/video_output/vout_intf.c        |  2 +-
 src/video_output/vout_subpictures.c | 15 +++++++++++++--
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 11ed7c3eac..490d1fa97e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -603,11 +603,12 @@ void vout_ControlChangeSubFilters(vout_thread_t *vout, const char *filters)
         spu_ChangeFilters(vout->p->spu, filters);
 }
 
-void vout_ChangeSubMargin(vout_thread_t *vout, int margin)
+void vout_ChangeSpuChannelMargin(vout_thread_t *vout,
+                                 enum vlc_vout_order order, int margin)
 {
     assert(!vout->p->dummy);
     if (likely(vout->p->spu != NULL))
-        spu_ChangeMargin(vout->p->spu, margin);
+        spu_ChangeChannelOrderMargin(vout->p->spu, order, margin);
 }
 
 void vout_ChangeViewpoint(vout_thread_t *vout,
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index bd25a244d6..3c5a7e2688 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -246,7 +246,7 @@ void vout_ChangeCropBorder(vout_thread_t *, int left, int top, int right, int bo
 void vout_ControlChangeFilters(vout_thread_t *, const char *);
 void vout_ControlChangeSubSources(vout_thread_t *, const char *);
 void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
-void vout_ChangeSubMargin(vout_thread_t *, int);
+void vout_ChangeSpuChannelMargin(vout_thread_t *, enum vlc_vout_order order, int);
 void vout_ChangeViewpoint( vout_thread_t *, const vlc_viewpoint_t *);
 
 /* */
@@ -269,7 +269,7 @@ void spu_Attach( spu_t *, input_thread_t *input );
 void spu_Detach( spu_t * );
 void spu_SetClockDelay(spu_t *spu, size_t channel_id, vlc_tick_t delay);
 void spu_SetClockRate(spu_t *spu, size_t channel_id, float rate);
-void spu_ChangeMargin(spu_t *, int);
+void spu_ChangeChannelOrderMargin(spu_t *, enum vlc_vout_order, int);
 void spu_SetHighlight(spu_t *, const vlc_spu_highlight_t*);
 
 /**
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 55e9c8cb88..b6f5ebc4bb 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -609,7 +609,7 @@ static int SubMarginCallback( vlc_object_t *p_this, char const *psz_cmd,
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
     VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
-    vout_ChangeSubMargin(p_vout, newval.i_int);
+    vout_ChangeSpuChannelMargin(p_vout, VLC_VOUT_ORDER_PRIMARY, newval.i_int);
     return VLC_SUCCESS;
 }
 
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 24f1a0c6f0..b58247ff03 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1910,12 +1910,23 @@ void spu_ChangeFilters(spu_t *spu, const char *filters)
     vlc_mutex_unlock(&sys->lock);
 }
 
-void spu_ChangeMargin(spu_t *spu, int margin)
+void spu_ChangeChannelOrderMargin(spu_t *spu, enum vlc_vout_order order,
+                                  int margin)
 {
     spu_private_t *sys = spu->p;
 
     vlc_mutex_lock(&sys->lock);
-    sys->margin = margin;
+    switch (order)
+    {
+        case VLC_VOUT_ORDER_PRIMARY:
+            sys->margin = margin;
+            break;
+        case VLC_VOUT_ORDER_SECONDARY:
+            sys->secondary_margin = margin;
+            break;
+        default:
+            vlc_assert_unreachable();
+    }
     vlc_mutex_unlock(&sys->lock);
 }
 



More information about the vlc-commits mailing list