From 82a12763e89d20541dee139a38872a2ef2816363 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 24 Feb 2005 16:04:20 +0000 Subject: [PATCH] gst/base/: Added small README for base classes. Original commit message from CVS: * gst/base/README: * gst/base/gstbasesink.c: (gst_basesink_get_template), (gst_basesink_base_init), (gst_basesink_pad_getcaps), (gst_basesink_pad_setcaps), (gst_basesink_pad_buffer_alloc), (gst_basesink_init), (gst_base_sink_get_template), (gst_base_sink_get_caps), (gst_base_sink_set_caps), (gst_base_sink_buffer_alloc), (gst_basesink_finish_preroll), (gst_basesink_event), (gst_basesink_get_times), (gst_basesink_do_sync), (gst_basesink_change_state): Added small README for base classes. Make default getcaps function in the base class return a copy of the padtemplate caps if nothing else. --- ChangeLog | 15 +++++++++++++++ gst/base/README | 16 ++++++++++++++++ gst/base/gstbasesink.c | 8 ++++++++ libs/gst/base/README | 16 ++++++++++++++++ libs/gst/base/gstbasesink.c | 8 ++++++++ 5 files changed, 63 insertions(+) create mode 100644 gst/base/README create mode 100644 libs/gst/base/README diff --git a/ChangeLog b/ChangeLog index 31e4e172b7..d9b45d0d41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-02-24 Wim Taymans + + * gst/base/README: + * gst/base/gstbasesink.c: (gst_basesink_get_template), + (gst_basesink_base_init), (gst_basesink_pad_getcaps), + (gst_basesink_pad_setcaps), (gst_basesink_pad_buffer_alloc), + (gst_basesink_init), (gst_base_sink_get_template), + (gst_base_sink_get_caps), (gst_base_sink_set_caps), + (gst_base_sink_buffer_alloc), (gst_basesink_finish_preroll), + (gst_basesink_event), (gst_basesink_get_times), + (gst_basesink_do_sync), (gst_basesink_change_state): + Added small README for base classes. + Make default getcaps function in the base class return a + copy of the padtemplate caps if nothing else. + 2005-02-24 Wim Taymans * gst/elements/gstfakesrc.c: (gst_fakesrc_get_range_unlocked): diff --git a/gst/base/README b/gst/base/README new file mode 100644 index 0000000000..efd6e572a9 --- /dev/null +++ b/gst/base/README @@ -0,0 +1,16 @@ +Base classes +------------ + +GstBaseSink + + Base class for sink elements. + + - one sinkpad + - handles state changes + - does flushing + - preroll with optional preview + - pull/push mode + - EOS handling + + FIXME: not much point making it operate in pull mode as a generic + base class I guess... diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index 52a50fca8e..716721e371 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -155,6 +155,14 @@ gst_basesink_pad_getcaps (GstPad * pad) if (bclass->get_caps) caps = bclass->get_caps (bsink); + if (caps == NULL) { + GstStaticPadTemplate *stemplate; + GstPadTemplate *template; + + stemplate = gst_basesink_get_template (bsink); + template = gst_static_pad_template_get (stemplate); + caps = gst_caps_copy (gst_pad_template_get_caps (template)); + } return caps; } diff --git a/libs/gst/base/README b/libs/gst/base/README new file mode 100644 index 0000000000..efd6e572a9 --- /dev/null +++ b/libs/gst/base/README @@ -0,0 +1,16 @@ +Base classes +------------ + +GstBaseSink + + Base class for sink elements. + + - one sinkpad + - handles state changes + - does flushing + - preroll with optional preview + - pull/push mode + - EOS handling + + FIXME: not much point making it operate in pull mode as a generic + base class I guess... diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 52a50fca8e..716721e371 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -155,6 +155,14 @@ gst_basesink_pad_getcaps (GstPad * pad) if (bclass->get_caps) caps = bclass->get_caps (bsink); + if (caps == NULL) { + GstStaticPadTemplate *stemplate; + GstPadTemplate *template; + + stemplate = gst_basesink_get_template (bsink); + template = gst_static_pad_template_get (stemplate); + caps = gst_caps_copy (gst_pad_template_get_caps (template)); + } return caps; }