mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ext/esd/esdsink.c: Remove property that handles osssink fallback.
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.
This commit is contained in:
parent
37defa2525
commit
89303c580f
7 changed files with 82 additions and 6 deletions
21
ChangeLog
21
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>
|
2004-01-15 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
|
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
|
||||||
|
|
|
@ -119,6 +119,7 @@ static void gst_audio_convert_get_property (GObject *object, guint prop_id, GVa
|
||||||
/* gstreamer functions */
|
/* gstreamer functions */
|
||||||
static void gst_audio_convert_chain (GstPad *pad, GstData *_data);
|
static void gst_audio_convert_chain (GstPad *pad, GstData *_data);
|
||||||
static GstPadLinkReturn gst_audio_convert_link (GstPad *pad, const GstCaps *caps);
|
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);
|
static GstElementStateReturn gst_audio_convert_change_state (GstElement *element);
|
||||||
|
|
||||||
/* actual work */
|
/* actual work */
|
||||||
|
@ -268,6 +269,7 @@ gst_audio_convert_init (GstAudioConvert *this)
|
||||||
/* sinkpad */
|
/* sinkpad */
|
||||||
this->sink = gst_pad_new_from_template (
|
this->sink = gst_pad_new_from_template (
|
||||||
gst_static_pad_template_get (&gst_audio_convert_sink_template), "sink");
|
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_link_function (this->sink, gst_audio_convert_link);
|
||||||
gst_pad_set_getcaps_function (this->sink, gst_audioconvert_getcaps);
|
gst_pad_set_getcaps_function (this->sink, gst_audioconvert_getcaps);
|
||||||
gst_element_add_pad (GST_ELEMENT(this), this->sink);
|
gst_element_add_pad (GST_ELEMENT(this), this->sink);
|
||||||
|
@ -275,6 +277,7 @@ gst_audio_convert_init (GstAudioConvert *this)
|
||||||
/* srcpad */
|
/* srcpad */
|
||||||
this->src = gst_pad_new_from_template (
|
this->src = gst_pad_new_from_template (
|
||||||
gst_static_pad_template_get (&gst_audio_convert_src_template), "src");
|
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_link_function (this->src, gst_audio_convert_link);
|
||||||
gst_pad_set_getcaps_function (this->src, gst_audioconvert_getcaps);
|
gst_pad_set_getcaps_function (this->src, gst_audioconvert_getcaps);
|
||||||
gst_element_add_pad (GST_ELEMENT(this), this->src);
|
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));
|
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
|
static GstPadLinkReturn
|
||||||
gst_audio_convert_link (GstPad *pad, const GstCaps *caps)
|
gst_audio_convert_link (GstPad *pad, const GstCaps *caps)
|
||||||
{
|
{
|
||||||
|
|
|
@ -314,6 +314,18 @@ gst_sinesrc_get (GstPad *pad)
|
||||||
g_return_val_if_fail (pad != NULL, NULL);
|
g_return_val_if_fail (pad != NULL, NULL);
|
||||||
src = GST_SINESRC (gst_pad_get_parent (pad));
|
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;
|
tdiff = src->samples_per_buffer * GST_SECOND / src->samplerate;
|
||||||
|
|
||||||
/* note: the 2 is because of the format we use */
|
/* note: the 2 is because of the format we use */
|
||||||
|
|
|
@ -77,6 +77,8 @@ struct _GstSineSrc {
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
|
|
||||||
gdouble accumulator;
|
gdouble accumulator;
|
||||||
|
|
||||||
|
gboolean tags_pushed;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstSineSrcClass {
|
struct _GstSineSrcClass {
|
||||||
|
|
|
@ -183,8 +183,8 @@ gst_videoscale_getcaps (GstPad *pad)
|
||||||
GstStructure *structure = gst_caps_get_structure (caps, i);
|
GstStructure *structure = gst_caps_get_structure (caps, i);
|
||||||
|
|
||||||
gst_structure_set (structure,
|
gst_structure_set (structure,
|
||||||
"width", GST_TYPE_INT_RANGE, 100, G_MAXINT,
|
"width", GST_TYPE_INT_RANGE, 16, G_MAXINT,
|
||||||
"height", GST_TYPE_INT_RANGE, 100, G_MAXINT,
|
"height", GST_TYPE_INT_RANGE, 16, G_MAXINT,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ GST_STATIC_PAD_TEMPLATE (
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("video/x-raw-rgb, "
|
GST_STATIC_CAPS ("video/x-raw-rgb, "
|
||||||
"framerate = (double) [ 0, MAX ], "
|
"framerate = (double) [ 1.0, 100.0 ], "
|
||||||
"width = (int) [ 0, MAX ], "
|
"width = (int) [ 0, MAX ], "
|
||||||
"height = (int) [ 0, MAX ]")
|
"height = (int) [ 0, MAX ]")
|
||||||
);
|
);
|
||||||
|
@ -446,6 +446,7 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink)
|
||||||
{
|
{
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
g_free (xcontext);
|
g_free (xcontext);
|
||||||
|
gst_element_error (GST_ELEMENT (ximagesink), "Could not open display");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
/* Object header */
|
/* Object header */
|
||||||
#include "xvimagesink.h"
|
#include "xvimagesink.h"
|
||||||
|
|
||||||
|
static void gst_xvimagesink_buffer_free (GstBuffer *buffer);
|
||||||
|
|
||||||
/* ElementFactory information */
|
/* ElementFactory information */
|
||||||
static GstElementDetails gst_xvimagesink_details = GST_ELEMENT_DETAILS (
|
static GstElementDetails gst_xvimagesink_details = GST_ELEMENT_DETAILS (
|
||||||
"Video sink",
|
"Video sink",
|
||||||
|
@ -46,11 +48,11 @@ GST_STATIC_PAD_TEMPLATE (
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS (
|
GST_STATIC_CAPS (
|
||||||
"video/x-raw-rgb, "
|
"video/x-raw-rgb, "
|
||||||
"framerate = (double) [ 0, MAX ], "
|
"framerate = (double) [ 1.0, 100.0 ], "
|
||||||
"width = (int) [ 0, MAX ], "
|
"width = (int) [ 0, MAX ], "
|
||||||
"height = (int) [ 0, MAX ]; "
|
"height = (int) [ 0, MAX ]; "
|
||||||
"video/x-raw-yuv, "
|
"video/x-raw-yuv, "
|
||||||
"framerate = (double) [ 0, MAX ], "
|
"framerate = (double) [ 1.0, 100.0 ], "
|
||||||
"width = (int) [ 0, MAX ], "
|
"width = (int) [ 0, MAX ], "
|
||||||
"height = (int) [ 0, MAX ]"
|
"height = (int) [ 0, MAX ]"
|
||||||
)
|
)
|
||||||
|
@ -557,6 +559,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
|
||||||
{
|
{
|
||||||
g_mutex_unlock (xvimagesink->x_lock);
|
g_mutex_unlock (xvimagesink->x_lock);
|
||||||
g_free (xcontext);
|
g_free (xcontext);
|
||||||
|
gst_element_error (GST_ELEMENT (xvimagesink), "Could not open display");
|
||||||
return NULL;
|
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
|
/* If this buffer has been allocated using our buffer management we simply
|
||||||
put the ximage which is in the PRIVATE pointer */
|
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));
|
gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (buf));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue