-Subproject commit aa2a757c587d91069a230d8e656481c3c364ccc6
+Subproject commit 7c93670c50de2b6e9d8edd31737c636192fbd831
return ret;
}
-/* by default, this keeps the number of samples in the buffer the same */
static gboolean
gst_base_transform_transform_size (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps,
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- GST_DEBUG_OBJECT (trans, "asked to transform size %d in direction %s",
- size, direction == GST_PAD_SRC ? "SRC" : "SINK");
+ GST_DEBUG_OBJECT (trans, "asked to transform size %d for caps %"
+ GST_PTR_FORMAT " to size for caps %" GST_PTR_FORMAT " in direction %s",
+ size, caps, othercaps, direction == GST_PAD_SRC ? "SRC" : "SINK");
/* if there is a custom transform function, use this */
if (klass->transform_size) {
} else {
g_return_val_if_fail (gst_base_transform_get_unit_size (trans, caps,
&inunitsize), FALSE);
+ GST_DEBUG_OBJECT (trans, "input size %d, input unit size %d", size,
+ inunitsize);
g_return_val_if_fail (size % inunitsize == 0, FALSE);
units = size / inunitsize;
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->get_unit_size) {
res = bclass->get_unit_size (trans, caps, size);
- GST_DEBUG_OBJECT (trans, "get size(%" GST_PTR_FORMAT
- ") set size %d, returned %d", caps, *size, res);
+ GST_DEBUG_OBJECT (trans, "caps %" GST_PTR_FORMAT
+ ") has unit size %d, result %s", caps, *size, res ? "TRUE" : "FALSE");
if (res) {
if (trans->cache_caps1 == NULL) {
*buf = NULL;
- GST_DEBUG_OBJECT (trans, "allocating a buffer of size %d at offset %"
- G_GUINT64_FORMAT, size, offset);
+ GST_DEBUG_OBJECT (trans, "allocating a buffer of size %d ...", size, offset);
+ if (offset == GST_BUFFER_OFFSET_NONE)
+ GST_DEBUG_OBJECT (trans, "... and offset NONE");
+ else
+ GST_DEBUG_OBJECT (trans, "... and offset %" G_GUINT64_FORMAT, offset);
/* before any buffers are pushed, in_place is TRUE; allocating can trigger
* a renegotiation and change that to FALSE */
if (trans->in_place) {
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
+ GST_LOG_OBJECT (trans, "handling buffer %p of size %d ...", inbuf,
+ GST_BUFFER_SIZE (inbuf));
+ if (GST_BUFFER_OFFSET_IS_VALID (inbuf))
+ GST_LOG_OBJECT (trans, "... and offset %" G_GUINT64_FORMAT,
+ GST_BUFFER_OFFSET (inbuf));
+ else
+ GST_LOG_OBJECT (trans, "... and offset NONE");
+
if (trans->in_place) {
/* check if we can do inplace and the buffer is writable */
if (bclass->transform_ip && gst_buffer_is_writable (inbuf)) {
+ /* in place transform and subclass supports method */
+ GST_LOG_OBJECT (trans, "doing inplace transform");
gst_buffer_ref (inbuf);
- /* in place transform and subclass supports method */
ret = bclass->transform_ip (trans, inbuf);
-
*outbuf = inbuf;
} else {
+ GST_LOG_OBJECT (trans, "doing fake inplace transform");
/* in place transform and subclass does not support method or
* buffer is not writable. */
if (bclass->transform) {
}
}
} else {
+ GST_LOG_OBJECT (trans, "doing non-inplace transform");
/* not inplace, figure out the output size */
if (!gst_base_transform_transform_size (trans,
GST_PAD_DIRECTION (trans->sinkpad), GST_PAD_CAPS (trans->sinkpad),
}
/* FIXME, getrange is broken, need to pull range from the other
- * end based on the transform_size result.
+ * end based on the transform_size result.
*/
static GstFlowReturn
gst_base_transform_getrange (GstPad * pad, guint64 offset,
* Gets the duration in nanoseconds of the data in the buffer.
* Value will be %GST_CLOCK_TIME_NONE if the duration is unknown.
*
- * Returns: the duration of the buffer
+ * Returns: the duration of the buffer
*/
#define GST_BUFFER_DURATION(buf) (GST_BUFFER_CAST(buf)->duration)
/**
/**
* GST_BUFFER_OFFSET_NONE:
- *
+ *
* Constant for no-offset return results.
*/
#define GST_BUFFER_OFFSET_NONE ((guint64)-1)
/**
* GST_BUFFER_TIMESTAMP_IS_VALID:
* @buffer: the #GstBuffer to check for the timestamp
- *
+ *
* Tests if the timestamp is known.
*
* Returns: %TRUE for success
/**
* GST_BUFFER_OFFSET_IS_VALID:
* @buffer: the #GstBuffer to check for the start offset
- *
+ *
* Tests if the start offset is known.
*
* Returns: %TRUE for success
GstPadBufferAllocFunction bufferallocfunc;
gboolean caps_changed;
+ GST_DEBUG_OBJECT (pad, "offset %" G_GUINT64_FORMAT, offset);
+
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
goto flushing;
GST_CAT_DEBUG (GST_CAT_PADS,
- "calling bufferallocfunc &%s (@%p) of peer pad %s:%s for size %d",
+ "calling bufferallocfunc &%s (@%p) of peer pad %s:%s for size %d ...",
GST_DEBUG_FUNCPTR_NAME (bufferallocfunc),
&bufferallocfunc, GST_DEBUG_PAD_NAME (peer), size);
+ if (offset == GST_BUFFER_OFFSET_NONE)
+ GST_CAT_DEBUG (GST_CAT_PADS, "... and offset NONE");
+ else
+ GST_CAT_DEBUG (GST_CAT_PADS, "... and offset %" G_GUINT64_FORMAT, offset);
GST_UNLOCK (peer);
ret = bufferallocfunc (peer, offset, size, caps, buf);
return ret;
}
-/* by default, this keeps the number of samples in the buffer the same */
static gboolean
gst_base_transform_transform_size (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps,
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- GST_DEBUG_OBJECT (trans, "asked to transform size %d in direction %s",
- size, direction == GST_PAD_SRC ? "SRC" : "SINK");
+ GST_DEBUG_OBJECT (trans, "asked to transform size %d for caps %"
+ GST_PTR_FORMAT " to size for caps %" GST_PTR_FORMAT " in direction %s",
+ size, caps, othercaps, direction == GST_PAD_SRC ? "SRC" : "SINK");
/* if there is a custom transform function, use this */
if (klass->transform_size) {
} else {
g_return_val_if_fail (gst_base_transform_get_unit_size (trans, caps,
&inunitsize), FALSE);
+ GST_DEBUG_OBJECT (trans, "input size %d, input unit size %d", size,
+ inunitsize);
g_return_val_if_fail (size % inunitsize == 0, FALSE);
units = size / inunitsize;
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->get_unit_size) {
res = bclass->get_unit_size (trans, caps, size);
- GST_DEBUG_OBJECT (trans, "get size(%" GST_PTR_FORMAT
- ") set size %d, returned %d", caps, *size, res);
+ GST_DEBUG_OBJECT (trans, "caps %" GST_PTR_FORMAT
+ ") has unit size %d, result %s", caps, *size, res ? "TRUE" : "FALSE");
if (res) {
if (trans->cache_caps1 == NULL) {
*buf = NULL;
- GST_DEBUG_OBJECT (trans, "allocating a buffer of size %d at offset %"
- G_GUINT64_FORMAT, size, offset);
+ GST_DEBUG_OBJECT (trans, "allocating a buffer of size %d ...", size, offset);
+ if (offset == GST_BUFFER_OFFSET_NONE)
+ GST_DEBUG_OBJECT (trans, "... and offset NONE");
+ else
+ GST_DEBUG_OBJECT (trans, "... and offset %" G_GUINT64_FORMAT, offset);
/* before any buffers are pushed, in_place is TRUE; allocating can trigger
* a renegotiation and change that to FALSE */
if (trans->in_place) {
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
+ GST_LOG_OBJECT (trans, "handling buffer %p of size %d ...", inbuf,
+ GST_BUFFER_SIZE (inbuf));
+ if (GST_BUFFER_OFFSET_IS_VALID (inbuf))
+ GST_LOG_OBJECT (trans, "... and offset %" G_GUINT64_FORMAT,
+ GST_BUFFER_OFFSET (inbuf));
+ else
+ GST_LOG_OBJECT (trans, "... and offset NONE");
+
if (trans->in_place) {
/* check if we can do inplace and the buffer is writable */
if (bclass->transform_ip && gst_buffer_is_writable (inbuf)) {
+ /* in place transform and subclass supports method */
+ GST_LOG_OBJECT (trans, "doing inplace transform");
gst_buffer_ref (inbuf);
- /* in place transform and subclass supports method */
ret = bclass->transform_ip (trans, inbuf);
-
*outbuf = inbuf;
} else {
+ GST_LOG_OBJECT (trans, "doing fake inplace transform");
/* in place transform and subclass does not support method or
* buffer is not writable. */
if (bclass->transform) {
}
}
} else {
+ GST_LOG_OBJECT (trans, "doing non-inplace transform");
/* not inplace, figure out the output size */
if (!gst_base_transform_transform_size (trans,
GST_PAD_DIRECTION (trans->sinkpad), GST_PAD_CAPS (trans->sinkpad),
}
/* FIXME, getrange is broken, need to pull range from the other
- * end based on the transform_size result.
+ * end based on the transform_size result.
*/
static GstFlowReturn
gst_base_transform_getrange (GstPad * pad, guint64 offset,