diff --git a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json index 102e012e2b..e3a8806a18 100644 --- a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json +++ b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json @@ -8183,6 +8183,11 @@ "desc": "discard aggregated CC when input video buffers hold CC metas already", "name": "favor", "value": "2" + }, + { + "desc": "discard aggregated CC even when input video buffers do not hold CC", + "name": "force", + "value": "3" } ] }, diff --git a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c index 152b7631d4..d3dc337db8 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c @@ -90,6 +90,9 @@ gst_cccombiner_input_meta_processing_get_type (void) {CCCOMBINER_INPUT_PROCESSING_FAVOR, "discard aggregated CC when input video buffers hold CC metas already", "favor"}, + {CCCOMBINER_INPUT_PROCESSING_FORCE, + "discard aggregated CC even when input video buffers do not hold CC", + "force"}, {0, NULL, NULL}, }; @@ -679,6 +682,12 @@ gst_cc_combiner_collect_captions (GstCCCombiner * self, gboolean timeout) g_array_set_size (self->current_frame_captions, 0); } break; + case CCCOMBINER_INPUT_PROCESSING_FORCE: + GST_LOG_OBJECT (self, + "Forced input captions, dropping %d dequeued captions", + self->current_frame_captions->len); + g_array_set_size (self->current_frame_captions, 0); + break; } if (self->current_frame_captions->len > 0) { diff --git a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.h b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.h index defd9832ef..52f6b65694 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.h +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.h @@ -47,6 +47,7 @@ typedef struct _GstCCCombinerClass GstCCCombinerClass; * @CCCOMBINER_INPUT_PROCESSING_APPEND: append aggregated CC to existing metas on video buffers * @CCCOMBINER_INPUT_PROCESSING_DROP: drop existing CC metas on input video buffers * @CCCOMBINER_INPUT_PROCESSING_FAVOR: discard aggregated CC when input video buffers hold CC metas already + * @CCCOMBINER_INPUT_PROCESSING_FORCE: discard aggregated CC even when input video buffers do not hold CC meta * * Possible processing types for the input-meta-processing property. * @@ -56,6 +57,7 @@ typedef enum { CCCOMBINER_INPUT_PROCESSING_APPEND = 0, CCCOMBINER_INPUT_PROCESSING_DROP, CCCOMBINER_INPUT_PROCESSING_FAVOR, + CCCOMBINER_INPUT_PROCESSING_FORCE, } GstCCCombinerInputProcessing; struct _GstCCCombiner