caps = gst_caps_make_writable (caps);
structure = gst_caps_get_structure (caps, 0);
+ /* mark buffers */
+ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS);
+ GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS);
+
/* Copy buffers, because we can't use the originals -
* it creates a circular refcount with the caps<->buffers */
buf1 = gst_buffer_copy (buf1);
buf2 = gst_buffer_copy (buf2);
buf3 = gst_buffer_copy (buf3);
- /* mark buffers */
- GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS);
- GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS);
-
/* put copies of the buffers in a fixed list */
g_value_init (&array, GST_TYPE_ARRAY);
cond = NULL;
}
+static void
+check_buffer_is_header (GstBuffer * buffer, gboolean is_header)
+{
+ fail_unless (GST_BUFFER_FLAG_IS_SET (buffer,
+ GST_BUFFER_FLAG_IN_CAPS) == is_header,
+ "GST_BUFFER_IN_CAPS is set to %d but expected %d",
+ GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS), is_header);
+}
+
static void
check_buffer_timestamp (GstBuffer * buffer, GstClockTime timestamp)
{
start_pipeline (bin, pad);
- /* header packets should have timestamp == NONE, granulepos 0 */
+ /* header packets should have timestamp == NONE, granulepos 0, IN_CAPS */
buffer = get_buffer (bin, pad);
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
buffer = get_buffer (bin, pad);
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
buffer = get_buffer (bin, pad);
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
{
check_buffer_timestamp (buffer, TIMESTAMP_OFFSET);
/* don't really have a good way of checking duration... */
check_buffer_granulepos_from_starttime (buffer, TIMESTAMP_OFFSET);
+ check_buffer_is_header (buffer, FALSE);
next_timestamp = TIMESTAMP_OFFSET + GST_BUFFER_DURATION (buffer);
FRAMERATE)
- gst_util_uint64_scale (last_granulepos, GST_SECOND, FRAMERATE));
check_buffer_granulepos_from_starttime (buffer, next_timestamp);
+ check_buffer_is_header (buffer, FALSE);
gst_buffer_unref (buffer);
}
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
buffer = get_buffer (bin, pad);
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
buffer = get_buffer (bin, pad);
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, TRUE);
gst_buffer_unref (buffer);
{
/* plain division because I know the answer is exact */
check_buffer_duration (buffer, GST_SECOND / 10);
check_buffer_granulepos (buffer, 0);
+ check_buffer_is_header (buffer, FALSE);
next_timestamp = GST_BUFFER_DURATION (buffer);
check_buffer_timestamp (buffer, next_timestamp);
check_buffer_duration (buffer, GST_SECOND / 10);
check_buffer_granulepos (buffer, 1);
+ check_buffer_is_header (buffer, FALSE);
gst_buffer_unref (buffer);
}