[vlc-devel] [PATCH 09/20] vout: spu: pass channel order to vout_ChangeSubMargin
Thomas Guillem
thomas at gllm.fr
Thu Jun 20 17:23:52 CEST 2019
From: Roland Bewick <roland.bewick at gmail.com>
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>
---
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 ab3666da81..bd3214bdef 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_spu_channel_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 699ade93ae..d1a123abeb 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_spu_channel_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_spu_channel_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..805c2d5112 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_SPU_CHANNEL_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 8d209bbbde..42e802d018 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_spu_channel_order order,
+ int margin)
{
spu_private_t *sys = spu->p;
vlc_mutex_lock(&sys->lock);
- sys->margin = margin;
+ switch (order)
+ {
+ case VLC_SPU_CHANNEL_ORDER_PRIMARY:
+ sys->margin = margin;
+ break;
+ case VLC_SPU_CHANNEL_ORDER_SECONDARY:
+ sys->secondary_margin = margin;
+ break;
+ default:
+ vlc_assert_unreachable();
+ }
vlc_mutex_unlock(&sys->lock);
}
--
2.20.1
More information about the vlc-devel
mailing list