diff options
author | Mats Lindestam <matslm@axis.com> | 2016-05-25 12:55:36 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-06-13 10:10:21 +0100 |
commit | a0876aa750797d9f171040d4736086fcfea55b91 (patch) | |
tree | 5be6b58a2f1deaee0a2277ad1f4a62b8331e9bd0 | |
parent | bf0d952387e517c983fce44bcf129db87e8b3ea3 (diff) |
h264parse: support for handling of config-interval = -1
Added support for handling of config-interval = -1.
config-inteval = -1 represents resending SPS and PPS for each
I-/IDR-frame.
https://bugzilla.gnome.org/show_bug.cgi?id=766803
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 17 |
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: |