* GST_BUFFER_COPY_ALL:
*
* Combination of all possible fields that can be copied with
- * gst_buffer_copy_metadata().
- *
- * Since: 0.10.13
+ * gst_buffer_copy_into().
*/
- #define GST_BUFFER_COPY_ALL (GST_BUFFER_COPY_METADATA | GST_BUFFER_COPY_MEMORY)
-#define GST_BUFFER_COPY_ALL ((GstBufferCopyFlags) (GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_CAPS))
++#define GST_BUFFER_COPY_ALL ((GstBufferCopyFlags)(GST_BUFFER_COPY_METADATA | GST_BUFFER_COPY_MEMORY))
-/* copies metadata into newly allocated buffer */
-void gst_buffer_copy_metadata (GstBuffer *dest, const GstBuffer *src,
- GstBufferCopyFlags flags);
+/* copies memory or metadata into newly allocated buffer */
+void gst_buffer_copy_into (GstBuffer *dest, GstBuffer *src,
+ GstBufferCopyFlags flags,
+ gsize offset, gsize size);
/**
* gst_buffer_is_writable:
* the structures diagonally down, then we iterate over the caps2
* structures.
*/
- len1 = caps1->structs->len;
- len2 = caps2->structs->len;
+ len1 = GST_CAPS_LEN (caps1);
+ len2 = GST_CAPS_LEN (caps2);
for (i = 0; i < len1 + len2 - 1; i++) {
- /* caps1 index goes from 0 to caps1->structs->len-1 */
+ /* caps1 index goes from 0 to GST_CAPS_LEN (caps1)-1 */
j = MIN (i, len1 - 1);
- /* caps2 index stays 0 until i reaches caps1->structs->len, then it counts
- * up from 1 to caps2->structs->len - 1 */
+ /* caps2 index stays 0 until i reaches GST_CAPS_LEN (caps1), then it counts
+ * up from 1 to GST_CAPS_LEN (caps2) - 1 */
- k = MAX (0, i - j);
+ k = (i > j) ? (i - j) : 0; /* MAX (0, i - j) */
/* now run the diagonal line, end condition is the left or bottom
* border */
g_return_if_fail (GST_IS_EVENT (event));
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_BUFFERSIZE);
- structure = event->structure;
+ structure = GST_EVENT_STRUCTURE (event);
if (format)
- *format =
+ *format = (GstFormat)
g_value_get_enum (gst_structure_id_get_value (structure,
GST_QUARK (FORMAT)));
if (minsize)
g_return_if_fail (GST_IS_EVENT (event));
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_QOS);
- structure = event->structure;
+ structure = GST_EVENT_STRUCTURE (event);
if (type)
- *type =
+ *type = (GstQOSType)
g_value_get_enum (gst_structure_id_get_value (structure,
GST_QUARK (TYPE)));
if (proportion)
g_return_if_fail (GST_IS_EVENT (event));
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STEP);
- structure = event->structure;
+ structure = GST_EVENT_STRUCTURE (event);
if (format)
- *format = g_value_get_enum (gst_structure_id_get_value (structure,
+ *format =
+ (GstFormat) g_value_get_enum (gst_structure_id_get_value (structure,
GST_QUARK (FORMAT)));
if (amount)
*amount = g_value_get_uint64 (gst_structure_id_get_value (structure,
/* historical default */
parse->priv->is_video = FALSE;
}
+ if (caps)
+ gst_caps_unref (caps);
- GST_DEBUG_OBJECT (parse, "media is video == %d", parse->priv->is_video);
+ GST_DEBUG_OBJECT (parse, "media is video: %d", parse->priv->is_video);
}
/* takes ownership of frame */