ext/esd/esdsink.c: Remove property that handles osssink fallback.
authorDavid Schleef <ds@schleef.org>
Thu, 15 Jan 2004 21:05:17 +0000 (21:05 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 15 Jan 2004 21:05:17 +0000 (21:05 +0000)
Original commit message from CVS:
* ext/esd/esdsink.c: (gst_esdsink_class_init): Remove property
that handles osssink fallback.
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_init),
(gst_audio_convert_getcaps):
* gst/qtdemux/qtdemux.c: (qtdemux_audio_caps):
Add audio/x-qdm2 for QDM2 audio.
* gst/sine/gstsinesrc.c: (gst_sinesrc_get):
* gst/sine/gstsinesrc.h: Add example of how to implement tags.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_getcaps):
Decrease minimum size to 16x16.
* gst/wavparse/gstwavparse.c:
Convert disabled pad template caps to new caps.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_chain): Throw element error when display cannot
be opened.  Increase minimum framerate to 1.0.  Check the data
free function on a buffer to make sure it is the type we expect
before manipulating it.

ChangeLog
gst/audioconvert/gstaudioconvert.c
gst/sine/gstsinesrc.c
gst/sine/gstsinesrc.h
gst/videoscale/gstvideoscale.c
sys/ximage/ximagesink.c
sys/xvimage/xvimagesink.c

index 131c75f..821365d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2004-01-15  David Schleef  <ds@schleef.org>
+
+       * ext/esd/esdsink.c: (gst_esdsink_class_init): Remove property
+       that handles osssink fallback.
+       * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_init),
+       (gst_audio_convert_getcaps):
+       * gst/qtdemux/qtdemux.c: (qtdemux_audio_caps):
+       Add audio/x-qdm2 for QDM2 audio.
+       * gst/sine/gstsinesrc.c: (gst_sinesrc_get):
+       * gst/sine/gstsinesrc.h: Add example of how to implement tags.
+       * gst/videoscale/gstvideoscale.c: (gst_videoscale_getcaps):
+       Decrease minimum size to 16x16.
+       * gst/wavparse/gstwavparse.c:
+       Convert disabled pad template caps to new caps.
+       * sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get):
+       * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
+       (gst_xvimagesink_chain): Throw element error when display cannot
+       be opened.  Increase minimum framerate to 1.0.  Check the data
+       free function on a buffer to make sure it is the type we expect
+       before manipulating it.
+
 2004-01-15  Julien MOUTTE <julien@moutte.net>
 
        * gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
index 64d5c91..aa0b812 100644 (file)
@@ -119,6 +119,7 @@ static void  gst_audio_convert_get_property (GObject *object, guint prop_id, GVa
 /* gstreamer functions */
 static void                  gst_audio_convert_chain        (GstPad *pad, GstData *_data);
 static GstPadLinkReturn      gst_audio_convert_link         (GstPad *pad, const GstCaps *caps);
+static GstCaps *             gst_audio_convert_getcaps      (GstPad *pad);
 static GstElementStateReturn gst_audio_convert_change_state (GstElement *element);
 
 /* actual work */
@@ -268,6 +269,7 @@ gst_audio_convert_init (GstAudioConvert *this)
   /* sinkpad */
   this->sink = gst_pad_new_from_template (
       gst_static_pad_template_get (&gst_audio_convert_sink_template), "sink");
+  gst_pad_set_getcaps_function (this->sink, gst_audio_convert_getcaps);
   gst_pad_set_link_function (this->sink, gst_audio_convert_link);
   gst_pad_set_getcaps_function (this->sink, gst_audioconvert_getcaps);
   gst_element_add_pad (GST_ELEMENT(this), this->sink);
@@ -275,6 +277,7 @@ gst_audio_convert_init (GstAudioConvert *this)
   /* srcpad */
   this->src = gst_pad_new_from_template (
       gst_static_pad_template_get (&gst_audio_convert_src_template), "src");
+  gst_pad_set_getcaps_function (this->src, gst_audio_convert_getcaps);
   gst_pad_set_link_function (this->src, gst_audio_convert_link);
   gst_pad_set_getcaps_function (this->src, gst_audioconvert_getcaps);
   gst_element_add_pad (GST_ELEMENT(this), this->src);
@@ -362,6 +365,39 @@ gst_audio_convert_chain (GstPad *pad, GstData *_data)
   gst_pad_push (this->src, GST_DATA (buf));
 }
 
+static GstCaps *
+gst_audio_convert_getcaps (GstPad *pad)
+{
+  GstAudioConvert *this;
+  GstPad *otherpad;
+  GstCaps *othercaps;
+  GstCaps *caps;
+  int i;
+
+  g_return_val_if_fail(GST_IS_PAD(pad), NULL);
+  g_return_val_if_fail(GST_IS_AUDIO_CONVERT(GST_OBJECT_PARENT (pad)), NULL);
+  this = GST_AUDIO_CONVERT(GST_OBJECT_PARENT (pad));
+
+  otherpad = (pad == this->src) ? this->sink : this->src;
+
+  othercaps = gst_pad_get_allowed_caps (otherpad);
+
+  for (i=0;i<gst_caps_get_size (othercaps); i++) {
+    GstStructure *structure;
+
+    structure = gst_caps_get_structure (othercaps, i);
+    gst_structure_remove_field (structure, "channels");
+    gst_structure_remove_field (structure, "endianness");
+    gst_structure_remove_field (structure, "width");
+    gst_structure_remove_field (structure, "depth");
+    gst_structure_remove_field (structure, "signed");
+  }
+  caps = gst_caps_intersect (othercaps, gst_pad_get_pad_template_caps (pad));
+  gst_caps_free(othercaps);
+
+  return caps;
+}
+
 static GstPadLinkReturn
 gst_audio_convert_link (GstPad *pad, const GstCaps *caps)
 {
index bed9ab9..4ceda29 100644 (file)
@@ -314,6 +314,18 @@ gst_sinesrc_get (GstPad *pad)
   g_return_val_if_fail (pad != NULL, NULL);
   src = GST_SINESRC (gst_pad_get_parent (pad));
 
+  if (!src->tags_pushed) {
+    GstTagList *taglist;
+
+    taglist = gst_tag_list_new ();
+
+    gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND,
+        GST_TAG_DESCRIPTION, "sine wave", NULL);
+
+    gst_element_found_tags_for_pad (GST_ELEMENT (src), pad, 0, taglist);
+    src->tags_pushed = TRUE;
+  }
+
   tdiff = src->samples_per_buffer * GST_SECOND / src->samplerate;
 
   /* note: the 2 is because of the format we use */
index b07e067..fbfc455 100644 (file)
@@ -77,6 +77,8 @@ struct _GstSineSrc {
   guint64 offset;
 
   gdouble accumulator;
+
+  gboolean tags_pushed;
 };
 
 struct _GstSineSrcClass {
index 25e835d..b3f4ea6 100644 (file)
@@ -183,8 +183,8 @@ gst_videoscale_getcaps (GstPad *pad)
     GstStructure *structure = gst_caps_get_structure (caps, i);
 
     gst_structure_set (structure,
-       "width", GST_TYPE_INT_RANGE, 100, G_MAXINT,
-       "height", GST_TYPE_INT_RANGE, 100, G_MAXINT,
+       "width", GST_TYPE_INT_RANGE, 16, G_MAXINT,
+       "height", GST_TYPE_INT_RANGE, 16, G_MAXINT,
        NULL);
   }
 
index bb4b392..bebd513 100644 (file)
@@ -44,7 +44,7 @@ GST_STATIC_PAD_TEMPLATE (
   GST_PAD_SINK,
   GST_PAD_ALWAYS,
   GST_STATIC_CAPS ("video/x-raw-rgb, "
-    "framerate = (double) [ 0, MAX ], "
+    "framerate = (double) [ 1.0, 100.0 ], "
     "width = (int) [ 0, MAX ], "
     "height = (int) [ 0, MAX ]")
 );
@@ -446,6 +446,7 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink)
     {
       g_mutex_unlock (ximagesink->x_lock);
       g_free (xcontext);
+      gst_element_error (GST_ELEMENT (ximagesink), "Could not open display");
       return NULL;
     }
   
index e774417..562a8e9 100644 (file)
@@ -29,6 +29,8 @@
 /* Object header */
 #include "xvimagesink.h"
 
+static void gst_xvimagesink_buffer_free (GstBuffer *buffer);
+
 /* ElementFactory information */
 static GstElementDetails gst_xvimagesink_details = GST_ELEMENT_DETAILS (
   "Video sink",
@@ -46,11 +48,11 @@ GST_STATIC_PAD_TEMPLATE (
   GST_PAD_ALWAYS,
   GST_STATIC_CAPS (
     "video/x-raw-rgb, "
-      "framerate = (double) [ 0, MAX ], "
+      "framerate = (double) [ 1.0, 100.0 ], "
       "width = (int) [ 0, MAX ], "
       "height = (int) [ 0, MAX ]; "
     "video/x-raw-yuv, "
-      "framerate = (double) [ 0, MAX ], "
+      "framerate = (double) [ 1.0, 100.0 ], "
       "width = (int) [ 0, MAX ], "
       "height = (int) [ 0, MAX ]"
   )
@@ -557,6 +559,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
     {
       g_mutex_unlock (xvimagesink->x_lock);
       g_free (xcontext);
+      gst_element_error (GST_ELEMENT (xvimagesink), "Could not open display");
       return NULL;
     }
   
@@ -938,7 +941,8 @@ gst_xvimagesink_chain (GstPad *pad, GstData *data)
   
   /* If this buffer has been allocated using our buffer management we simply
      put the ximage which is in the PRIVATE pointer */
-  if (GST_BUFFER_PRIVATE (buf))
+  /* FIXME: need to check for correct xvimagesink here? */
+  if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_xvimagesink_buffer_free)
     {
       gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (buf));
     }