[vlc-devel] [PATCH] vlc_filter: allow subpicture updater
Francois Cartegnie
fcvlcdev at free.fr
Wed Mar 11 15:34:48 CET 2020
---
include/vlc_filter.h | 13 ++++++++++---
src/video_output/vout_subpictures.c | 5 +++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index ce49be1be4..8c81ed98d2 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -48,7 +48,7 @@ struct filter_video_callbacks
struct filter_subpicture_callbacks
{
- subpicture_t *(*buffer_new)(filter_t *);
+ subpicture_t *(*buffer_new)(filter_t *, const subpicture_updater_t *);
};
typedef struct filter_owner_t
@@ -243,14 +243,21 @@ static inline block_t *filter_DrainAudio( filter_t *p_filter )
* \param p_filter filter_t object
* \return new subpicture
*/
-static inline subpicture_t *filter_NewSubpicture( filter_t *p_filter )
+static inline subpicture_t *
+ filter_NewUpdatableSubpicture( filter_t *p_filter,
+ const subpicture_updater_t *p_dyn )
{
- subpicture_t *subpic = p_filter->owner.sub->buffer_new( p_filter );
+ subpicture_t *subpic = p_filter->owner.sub->buffer_new( p_filter, p_dyn );
if( subpic == NULL )
msg_Warn( p_filter, "can't get output subpicture" );
return subpic;
}
+static inline subpicture_t *filter_NewSubpicture( filter_t *p_filter )
+{
+ return filter_NewUpdatableSubpicture( p_filter, NULL );
+}
+
/**
* This function gives all input attachments at once.
*
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 5a67f061a5..82ad09609f 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1311,11 +1311,12 @@ static void UpdateSPU(spu_t *spu, const vlc_spu_highlight_t *hl)
* Buffers allocation callbacks for the filters
*****************************************************************************/
-static subpicture_t *sub_new_buffer(filter_t *filter)
+static subpicture_t *sub_new_buffer(filter_t *filter,
+ const subpicture_updater_t *p_dyn)
{
ssize_t channel = *(ssize_t *)filter->owner.sys;
- subpicture_t *subpicture = subpicture_New(NULL);
+ subpicture_t *subpicture = subpicture_New(p_dyn);
if (subpicture)
subpicture->i_channel = channel;
return subpicture;
--
2.24.1
More information about the vlc-devel
mailing list