summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/videoparsers/gsth264parse.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 530a4415c..e9a9ef81f 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -132,8 +132,9 @@ gst_h264_parse_class_init (GstH264ParseClass * klass)
g_param_spec_int ("config-interval",
"SPS PPS Send Interval",
"Send SPS and PPS Insertion Interval in seconds (sprop parameter sets "
- "will be multiplexed in the data stream when detected.) (0 = disabled)",
- 0, 3600, DEFAULT_CONFIG_INTERVAL,
+ "will be multiplexed in the data stream when detected.) "
+ "(0 = disabled, -1 = send with every IDR frame)",
+ -1, 3600, DEFAULT_CONFIG_INTERVAL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
/* Override BaseParse vfuncs */
@@ -2376,6 +2377,18 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
h264parse->have_pps = FALSE;
h264parse->state &= GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS;
}
+ } else if (h264parse->interval == -1) {
+ if (h264parse->idr_pos >= 0) {
+ GST_LOG_OBJECT (h264parse, "IDR nal at offset %d", h264parse->idr_pos);
+
+ gst_h264_parse_handle_sps_pps_nals (h264parse, buffer, frame);
+
+ /* we pushed whatever we had */
+ h264parse->push_codec = FALSE;
+ h264parse->have_sps = FALSE;
+ h264parse->have_pps = FALSE;
+ h264parse->state &= GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS;
+ }
}
/* Fixme: setting passthrough mode casuing multiple issues: