fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK,
"%s: failed pushing byte buffer", reason);
}
fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK,
"%s: failed pushing byte buffer", reason);
}
GST_BUFFER_TIMESTAMP (buffer) = GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND / 10;
fail_unless (pk->header_from_buffer (buffer, 0, &len, &header));
gdpdepay_push_per_byte ("buffer header", header, len);
fail_unless_equals_int (g_list_length (buffers), 0);
GST_BUFFER_TIMESTAMP (buffer) = GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND / 10;
fail_unless (pk->header_from_buffer (buffer, 0, &len, &header));
gdpdepay_push_per_byte ("buffer header", header, len);
fail_unless_equals_int (g_list_length (buffers), 0);
fail_unless (pk->header_from_buffer (buffer, 0, &header_len, &buf_header));
payload_len = gst_dp_header_payload_length (caps_header);
inbuffer = gst_buffer_new_and_alloc (2 * GST_DP_HEADER_LENGTH +
fail_unless (pk->header_from_buffer (buffer, 0, &header_len, &buf_header));
payload_len = gst_dp_header_payload_length (caps_header);
inbuffer = gst_buffer_new_and_alloc (2 * GST_DP_HEADER_LENGTH +
- payload_len + GST_BUFFER_SIZE (buffer));
- memcpy (GST_BUFFER_DATA (inbuffer), caps_header, GST_DP_HEADER_LENGTH);
+ payload_len + gst_buffer_get_size (buffer));
+ gst_buffer_fill (inbuffer, 0, caps_header, GST_DP_HEADER_LENGTH);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, caps_payload, payload_len);
+ gst_buffer_fill (inbuffer, i, caps_payload, payload_len);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, buf_header, GST_DP_HEADER_LENGTH);
+ gst_buffer_fill (inbuffer, i, buf_header, GST_DP_HEADER_LENGTH);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, GST_BUFFER_DATA (buffer),
- GST_BUFFER_SIZE (buffer));
+ gst_buffer_fill (inbuffer, i, "f00d", 4);
GstPad *srcpad;
GstElement *gdpdepay;
GstBuffer *buffer, *inbuffer, *outbuffer, *shbuffer;
GstPad *srcpad;
GstElement *gdpdepay;
GstBuffer *buffer, *inbuffer, *outbuffer, *shbuffer;
- guint8 *caps_header, *caps_payload, *buf_header;
+ guint8 *caps_header, *caps_payload, *buf_header, *data;
+ gsize size;
caps = gst_caps_from_string ("application/x-gst-test-streamheader");
structure = gst_caps_get_structure (caps, 0);
buffer = gst_buffer_new_and_alloc (4);
caps = gst_caps_from_string ("application/x-gst-test-streamheader");
structure = gst_caps_get_structure (caps, 0);
buffer = gst_buffer_new_and_alloc (4);
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS);
g_value_init (&array, GST_TYPE_ARRAY);
g_value_init (&value, GST_TYPE_BUFFER);
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS);
g_value_init (&array, GST_TYPE_ARRAY);
g_value_init (&value, GST_TYPE_BUFFER);
- payload_len + GST_BUFFER_SIZE (buffer));
- memcpy (GST_BUFFER_DATA (inbuffer), caps_header, GST_DP_HEADER_LENGTH);
+ payload_len + size);
+ gst_buffer_fill (inbuffer, 0, caps_header, GST_DP_HEADER_LENGTH);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, caps_payload, payload_len);
+ gst_buffer_fill (inbuffer, i, caps_payload, payload_len);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, buf_header, GST_DP_HEADER_LENGTH);
+ gst_buffer_fill (inbuffer, i, buf_header, GST_DP_HEADER_LENGTH);
- memcpy (GST_BUFFER_DATA (inbuffer) + i, GST_BUFFER_DATA (buffer),
- GST_BUFFER_SIZE (buffer));
+ gst_buffer_fill (inbuffer, i, data, size);
+ gst_buffer_unmap (buffer, data, size);