summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-04-22 12:02:35 +0200
committerThibault Saunier <tsaunier@gnome.org>2014-04-22 16:57:21 +0200
commit21a4888ae7e5cc3bc1e762c9631f940d46124b24 (patch)
tree2926a10fad7afbdad30265681d158ed637482865
parent8527d91737adb076ca7d9297d1c2157757040285 (diff)
validate: Check that for raw, buffers are strictly contained in segment
For encoded data we might need buffers that have timestamp < segment.start to make sure that we have the keyframe, etc... but for raw data, buffer end should strictly be inside the segment, be more strict about that.
-rw-r--r--validate/gst/validate/gst-validate-pad-monitor.c18
-rw-r--r--validate/gst/validate/gst-validate-pad-monitor.h1
2 files changed, 16 insertions, 3 deletions
diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c
index 4f5e6b8..14bec4d 100644
--- a/validate/gst/validate/gst-validate-pad-monitor.c
+++ b/validate/gst/validate/gst-validate-pad-monitor.c
@@ -1169,7 +1169,7 @@ gst_validate_pad_monitor_flush (GstValidatePadMonitor * pad_monitor)
pad_monitor->is_eos = FALSE;
pad_monitor->last_flow_return = GST_FLOW_OK;
gst_caps_replace (&pad_monitor->last_caps, NULL);
- pad_monitor->caps_is_audio = pad_monitor->caps_is_video = FALSE;
+ pad_monitor->caps_is_audio = pad_monitor->caps_is_video = pad_monitor->caps_is_raw = FALSE;
g_list_free_full (pad_monitor->expired_events,
(GDestroyNotify) gst_event_unref);
@@ -1650,9 +1650,14 @@ gst_validate_pad_monitor_buffer_probe (GstPad * pad, GstBuffer * buffer,
/* should not push out of segment data */
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)) &&
GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)) &&
- !gst_segment_clip (&monitor->segment, monitor->segment.format,
+ ((!gst_segment_clip (&monitor->segment, monitor->segment.format,
GST_BUFFER_TIMESTAMP (buffer), GST_BUFFER_TIMESTAMP (buffer) +
- GST_BUFFER_DURATION (buffer), NULL, NULL)) {
+ GST_BUFFER_DURATION (buffer), NULL, NULL)) ||
+ /* In the case of raw data, buffers should be strictly contained inside the
+ * segment */
+ (monitor->caps_is_raw &&
+ GST_BUFFER_PTS (buffer) + GST_BUFFER_DURATION (buffer) < monitor->segment.start))
+ ) {
/* TODO is this a timestamp issue? */
GST_VALIDATE_REPORT (monitor, BUFFER_IS_OUT_OF_SEGMENT,
"buffer is out of segment and shouldn't be pushed. Timestamp: %"
@@ -1803,6 +1808,13 @@ gst_validate_pad_monitor_update_caps_info (GstValidatePadMonitor * pad_monitor,
} else if (g_str_has_prefix (gst_structure_get_name (structure), "video/")) {
pad_monitor->caps_is_video = TRUE;
}
+
+ if (g_str_has_prefix (gst_structure_get_name (structure), "audio/x-raw") ||
+ g_str_has_prefix (gst_structure_get_name (structure), "video/x-raw")) {
+ pad_monitor->caps_is_raw = TRUE;
+ } else {
+ pad_monitor->caps_is_raw = FALSE;
+ }
}
static void
diff --git a/validate/gst/validate/gst-validate-pad-monitor.h b/validate/gst/validate/gst-validate-pad-monitor.h
index 13a53c6..27f9f2f 100644
--- a/validate/gst/validate/gst-validate-pad-monitor.h
+++ b/validate/gst/validate/gst-validate-pad-monitor.h
@@ -73,6 +73,7 @@ struct _GstValidatePadMonitor {
GstCaps *last_caps;
gboolean caps_is_audio;
gboolean caps_is_video;
+ gboolean caps_is_raw;
/* FIXME : Let's migrate all those booleans into a 32 (or 64) bit flag */
gboolean first_buffer;