~ubuntu-branches/ubuntu/hardy/gstreamer0.10/hardy-updates

« back to all changes in this revision

Viewing changes to libs/gst/base/gstbasetransform.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2008-01-30 17:40:49 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20080130174049-9fu4gmhxxqs7sz31
Tags: 0.10.17-1ubuntu1
* Sync with Debian, remaining Ubuntu changes:
  + debian/control.in:
    - Set Ubuntu Core Developers as Maintainer.
    - Add Breaks field to libgstreamer0.10-0 for
      libgstreamer-plugins-base0.10-0.
  + debian/rules:
    - Set the package origin and url for Ubuntu.
    - Symlink the doc directories to avoid duplicate files and remove
      the old ones on upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
  gboolean discont;
235
235
 
236
236
  GstActivateMode pad_mode;
 
237
 
 
238
  gboolean gap_aware;
237
239
};
238
240
 
239
241
static GstElementClass *parent_class = NULL;
337
339
      GST_DEBUG_FUNCPTR (gst_base_transform_get_property);
338
340
 
339
341
  g_object_class_install_property (gobject_class, PROP_QOS,
340
 
      g_param_spec_boolean ("qos", "QoS", "handle QoS messages",
 
342
      g_param_spec_boolean ("qos", "QoS", "Handle Quality-of-Service events",
341
343
          DEFAULT_PROP_QOS, G_PARAM_READWRITE));
342
344
 
343
345
  gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_base_transform_finalize);
400
402
  trans->cache_caps1 = NULL;
401
403
  trans->cache_caps2 = NULL;
402
404
  trans->priv->pad_mode = GST_ACTIVATE_NONE;
 
405
  trans->priv->gap_aware = FALSE;
403
406
 
404
407
  trans->passthrough = FALSE;
405
408
  if (bclass->transform == NULL) {
523
526
no_in_size:
524
527
  {
525
528
    GST_DEBUG_OBJECT (trans, "could not get in_size");
526
 
    g_warning ("could not get in_size");
 
529
    g_warning ("%s: could not get in_size", GST_ELEMENT_NAME (trans));
527
530
    return FALSE;
528
531
  }
529
532
no_multiple:
530
533
  {
531
534
    GST_DEBUG_OBJECT (trans, "Size %u is not a multiple of unit size %u", size,
532
535
        inunitsize);
533
 
    g_warning ("Size %u is not a multiple of unit size %u", size, inunitsize);
 
536
    g_warning ("%s: size %u is not a multiple of unit size %u",
 
537
        GST_ELEMENT_NAME (trans), size, inunitsize);
534
538
    return FALSE;
535
539
  }
536
540
no_out_size:
537
541
  {
538
542
    GST_DEBUG_OBJECT (trans, "could not get out_size");
539
 
    g_warning ("could not get out_size");
 
543
    g_warning ("%s: could not get out_size", GST_ELEMENT_NAME (trans));
540
544
    return FALSE;
541
545
  }
542
546
}
974
978
 
975
979
    gst_buffer_copy_metadata (*out_buf, in_buf,
976
980
        GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS);
 
981
 
 
982
    /* Unset the GAP flag if the element is _not_ GAP aware. Otherwise
 
983
     * it might create an output buffer that does not contain neutral data
 
984
     * but still has the GAP flag on it! */
 
985
    if (!trans->priv->gap_aware)
 
986
      GST_BUFFER_FLAG_UNSET (*out_buf, GST_BUFFER_FLAG_GAP);
977
987
  }
978
988
 
979
989
done:
1570
1580
  GstClockTime last_stop = GST_CLOCK_TIME_NONE;
1571
1581
  GstBuffer *outbuf = NULL;
1572
1582
 
1573
 
  trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
 
1583
  trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad));
1574
1584
 
1575
1585
  /* calculate end position of the incoming buffer */
1576
1586
  if (GST_BUFFER_TIMESTAMP (buffer) != GST_CLOCK_TIME_NONE) {
1613
1623
    ret = GST_FLOW_OK;
1614
1624
  }
1615
1625
 
1616
 
  gst_object_unref (trans);
1617
 
 
1618
1626
  return ret;
1619
1627
}
1620
1628
 
1947
1955
 
1948
1956
  return result;
1949
1957
}
 
1958
 
 
1959
/**
 
1960
 * gst_base_transform_set_gap_aware:
 
1961
 * @trans: a #GstBaseTransform
 
1962
 * @gap_aware: New state
 
1963
 *
 
1964
 * If @gap_aware is %FALSE (as it is by default) subclasses will never get
 
1965
 * output buffers with the %GST_BUFFER_FLAG_GAP flag set.
 
1966
 *
 
1967
 * If set to %TRUE elements must handle output buffers with this flag set
 
1968
 * correctly, i.e. they can assume that the buffer contains neutral data
 
1969
 * but must unset the flag if the output is no neutral data.
 
1970
 * Since: 0.10.16
 
1971
 *
 
1972
 * MT safe.
 
1973
 */
 
1974
void
 
1975
gst_base_transform_set_gap_aware (GstBaseTransform * trans, gboolean gap_aware)
 
1976
{
 
1977
  g_return_if_fail (trans != NULL);
 
1978
 
 
1979
  GST_OBJECT_LOCK (trans);
 
1980
  trans->priv->gap_aware = gap_aware;
 
1981
  GST_DEBUG_OBJECT (trans, "set gap aware %d", trans->priv->gap_aware);
 
1982
  GST_OBJECT_UNLOCK (trans);
 
1983
}