2004-04-30 02:25:09 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2004 Benjamin Otte <otte@gnome.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2005-09-06 22:29:00 +00:00
|
|
|
#include <gst/base/gstadapter.h>
|
2004-04-30 02:25:09 +00:00
|
|
|
#include <gst/video/video.h>
|
|
|
|
#include <gst/audio/audio.h>
|
|
|
|
#include <libvisual/libvisual.h>
|
|
|
|
|
|
|
|
#define GST_TYPE_VISUAL (gst_visual_get_type())
|
|
|
|
#define GST_IS_VISUAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VISUAL))
|
|
|
|
#define GST_VISUAL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VISUAL,GstVisual))
|
|
|
|
#define GST_IS_VISUAL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VISUAL))
|
|
|
|
#define GST_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VISUAL,GstVisualClass))
|
|
|
|
#define GST_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VISUAL, GstVisualClass))
|
|
|
|
|
|
|
|
typedef struct _GstVisual GstVisual;
|
|
|
|
typedef struct _GstVisualClass GstVisualClass;
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (libvisual_debug);
|
|
|
|
#define GST_CAT_DEFAULT (libvisual_debug)
|
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
struct _GstVisual
|
|
|
|
{
|
|
|
|
GstElement element;
|
|
|
|
|
|
|
|
/* pads */
|
|
|
|
GstPad *sinkpad;
|
|
|
|
GstPad *srcpad;
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
GstClockTime next_ts;
|
2004-04-30 02:25:09 +00:00
|
|
|
|
|
|
|
/* libvisual stuff */
|
|
|
|
VisAudio audio;
|
|
|
|
VisVideo *video;
|
|
|
|
VisActor *actor;
|
|
|
|
|
|
|
|
/* audio/video state */
|
2005-09-07 20:06:43 +00:00
|
|
|
gint rate; /* Input samplerate */
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
|
|
|
|
/* framerate numerator & denominator */
|
|
|
|
gint fps_n;
|
|
|
|
gint fps_d;
|
2004-04-30 02:25:09 +00:00
|
|
|
gint width;
|
|
|
|
gint height;
|
2004-05-04 00:44:19 +00:00
|
|
|
|
|
|
|
/* state stuff */
|
|
|
|
GstAdapter *adapter;
|
|
|
|
guint count;
|
2004-04-30 02:25:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVisualClass
|
|
|
|
{
|
|
|
|
GstElementClass parent_class;
|
|
|
|
|
|
|
|
VisPluginRef *plugin;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_visual_get_type (void);
|
|
|
|
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2004-05-04 00:44:19 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN "; "
|
2004-05-11 15:31:36 +00:00
|
|
|
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
|
|
|
GST_VIDEO_CAPS_RGB "; "
|
|
|
|
#else
|
|
|
|
GST_VIDEO_CAPS_BGR "; "
|
|
|
|
#endif
|
|
|
|
GST_VIDEO_CAPS_RGB_16)
|
2004-04-30 02:25:09 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
|
|
|
"width = (int) 16, "
|
|
|
|
"depth = (int) 16, "
|
|
|
|
"endianness = (int) BYTE_ORDER, "
|
|
|
|
"signed = (boolean) TRUE, "
|
|
|
|
"channels = (int) 2, " "rate = (int) [ 1000, MAX ]")
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
static void gst_visual_class_init (gpointer g_class, gpointer class_data);
|
|
|
|
static void gst_visual_init (GstVisual * visual);
|
2004-05-04 00:44:19 +00:00
|
|
|
static void gst_visual_dispose (GObject * object);
|
2004-04-30 02:25:09 +00:00
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn gst_visual_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2005-09-06 22:29:00 +00:00
|
|
|
static GstFlowReturn gst_visual_chain (GstPad * pad, GstBuffer * buffer);
|
2004-04-30 02:25:09 +00:00
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
static gboolean gst_visual_sink_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
static gboolean gst_visual_src_setcaps (GstPad * pad, GstCaps * caps);
|
2004-04-30 02:25:09 +00:00
|
|
|
static GstCaps *gst_visual_getcaps (GstPad * pad);
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
static void libvisual_log_handler (const char *message, const char *funcname,
|
|
|
|
void *priv);
|
2004-04-30 02:25:09 +00:00
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_visual_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
|
|
|
|
if (!type) {
|
|
|
|
static const GTypeInfo info = {
|
|
|
|
sizeof (GstVisualClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
gst_visual_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstVisual),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_visual_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
type = g_type_register_static (GST_TYPE_ELEMENT, "GstVisual", &info, 0);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
static void
|
|
|
|
libvisual_log_handler (const char *message, const char *funcname, void *priv)
|
|
|
|
{
|
|
|
|
GST_CAT_LEVEL_LOG (libvisual_debug, (GstDebugLevel) (priv), NULL, "%s - %s",
|
|
|
|
funcname, message);
|
|
|
|
}
|
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
static void
|
|
|
|
gst_visual_class_init (gpointer g_class, gpointer class_data)
|
|
|
|
{
|
|
|
|
GstVisualClass *klass = GST_VISUAL_CLASS (g_class);
|
2004-05-04 00:44:19 +00:00
|
|
|
GstElementClass *element = GST_ELEMENT_CLASS (g_class);
|
|
|
|
GObjectClass *object = G_OBJECT_CLASS (g_class);
|
2004-04-30 02:25:09 +00:00
|
|
|
|
|
|
|
klass->plugin = class_data;
|
|
|
|
|
|
|
|
element->change_state = gst_visual_change_state;
|
|
|
|
|
|
|
|
if (class_data == NULL) {
|
|
|
|
parent_class = g_type_class_peek_parent (g_class);
|
|
|
|
} else {
|
|
|
|
GstElementDetails details = {
|
|
|
|
NULL,
|
|
|
|
"Visualization",
|
|
|
|
klass->plugin->info->about,
|
|
|
|
"Benjamin Otte <otte@gnome.org>"
|
|
|
|
};
|
|
|
|
|
|
|
|
details.longname = g_strdup_printf ("libvisual %s plugin v.%s",
|
|
|
|
klass->plugin->info->name, klass->plugin->info->version);
|
|
|
|
|
|
|
|
/* FIXME: improve to only register what plugin supports? */
|
|
|
|
gst_element_class_add_pad_template (element,
|
|
|
|
gst_static_pad_template_get (&src_template));
|
|
|
|
gst_element_class_add_pad_template (element,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
gst_element_class_set_details (element, &details);
|
|
|
|
g_free (details.longname);
|
|
|
|
}
|
|
|
|
|
2004-05-04 00:44:19 +00:00
|
|
|
object->dispose = gst_visual_dispose;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_visual_init (GstVisual * visual)
|
|
|
|
{
|
|
|
|
/* create the sink and src pads */
|
2005-11-16 18:21:46 +00:00
|
|
|
visual->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
|
2005-09-06 22:29:00 +00:00
|
|
|
gst_pad_set_setcaps_function (visual->sinkpad, gst_visual_sink_setcaps);
|
2004-04-30 02:25:09 +00:00
|
|
|
gst_pad_set_chain_function (visual->sinkpad, gst_visual_chain);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (visual), visual->sinkpad);
|
|
|
|
|
2005-11-16 18:21:46 +00:00
|
|
|
visual->srcpad = gst_pad_new_from_static_template (&src_template, "src");
|
2005-09-06 22:29:00 +00:00
|
|
|
gst_pad_set_setcaps_function (visual->srcpad, gst_visual_src_setcaps);
|
2004-04-30 02:25:09 +00:00
|
|
|
gst_pad_set_getcaps_function (visual->srcpad, gst_visual_getcaps);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (visual), visual->srcpad);
|
|
|
|
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
visual->next_ts = 0;
|
2004-05-04 00:44:19 +00:00
|
|
|
visual->adapter = gst_adapter_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_visual_dispose (GObject * object)
|
|
|
|
{
|
|
|
|
GstVisual *visual = GST_VISUAL (object);
|
|
|
|
|
|
|
|
if (visual->adapter) {
|
|
|
|
g_object_unref (visual->adapter);
|
|
|
|
visual->adapter = NULL;
|
|
|
|
}
|
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
if (visual->actor) {
|
|
|
|
visual_object_unref (VISUAL_OBJECT (visual->actor));
|
|
|
|
visual->actor = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (visual->video) {
|
|
|
|
visual_object_unref (VISUAL_OBJECT (visual->video));
|
|
|
|
visual->video = NULL;
|
|
|
|
}
|
2004-05-04 00:44:19 +00:00
|
|
|
GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps *
|
|
|
|
gst_visual_getcaps (GstPad * pad)
|
|
|
|
{
|
|
|
|
GstCaps *ret;
|
|
|
|
GstVisual *visual = GST_VISUAL (gst_pad_get_parent (pad));
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
int depths;
|
2004-04-30 02:25:09 +00:00
|
|
|
|
|
|
|
if (!visual->actor)
|
|
|
|
return gst_caps_copy (gst_pad_get_pad_template_caps (visual->srcpad));
|
|
|
|
|
|
|
|
ret = gst_caps_new_empty ();
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
depths = visual_actor_get_supported_depth (visual->actor);
|
|
|
|
if (depths < 0) {
|
|
|
|
/* FIXME: set an error */
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
if (depths == VISUAL_VIDEO_DEPTH_GL) {
|
|
|
|
/* We can't handle GL only plugins */
|
|
|
|
return ret;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
GST_DEBUG_OBJECT (visual, "libvisual plugin supports depths %u (0x%04x)",
|
|
|
|
depths, depths);
|
|
|
|
/* if (depths & VISUAL_VIDEO_DEPTH_32BIT) Always supports 32bit output */
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
gst_caps_append (ret, gst_caps_from_string (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN));
|
|
|
|
|
|
|
|
if (depths & VISUAL_VIDEO_DEPTH_24BIT) {
|
2004-05-11 15:31:36 +00:00
|
|
|
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
|
|
|
gst_caps_append (ret, gst_caps_from_string (GST_VIDEO_CAPS_RGB));
|
|
|
|
#else
|
2004-04-30 02:25:09 +00:00
|
|
|
gst_caps_append (ret, gst_caps_from_string (GST_VIDEO_CAPS_BGR));
|
2004-05-11 15:31:36 +00:00
|
|
|
#endif
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
if (depths & VISUAL_VIDEO_DEPTH_16BIT) {
|
2004-04-30 02:25:09 +00:00
|
|
|
gst_caps_append (ret, gst_caps_from_string (GST_VIDEO_CAPS_RGB_16));
|
|
|
|
}
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
GST_DEBUG_OBJECT (visual, "returning caps %" GST_PTR_FORMAT, ret);
|
2004-04-30 02:25:09 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
static gboolean
|
2005-09-06 22:29:00 +00:00
|
|
|
gst_visual_src_setcaps (GstPad * pad, GstCaps * caps)
|
2004-04-30 02:25:09 +00:00
|
|
|
{
|
|
|
|
GstVisual *visual = GST_VISUAL (gst_pad_get_parent (pad));
|
|
|
|
GstStructure *structure;
|
|
|
|
gint depth;
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
if (!gst_structure_get_int (structure, "width", &visual->width))
|
2005-09-07 20:06:43 +00:00
|
|
|
return FALSE;
|
2004-04-30 02:25:09 +00:00
|
|
|
if (!gst_structure_get_int (structure, "height", &visual->height))
|
2005-09-07 20:06:43 +00:00
|
|
|
return FALSE;
|
2004-04-30 02:25:09 +00:00
|
|
|
if (!gst_structure_get_int (structure, "bpp", &depth))
|
2005-09-07 20:06:43 +00:00
|
|
|
return FALSE;
|
Updates for API changes
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps):
* gst/videorate/gstvideorate.c: (gst_videorate_setcaps),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_create):
* sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_get_fps),
(gst_v4lmjpegsrc_src_convert), (gst_v4lmjpegsrc_src_query),
(gst_v4lmjpegsrc_get), (gst_v4lmjpegsrc_getcaps):
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_get_fps),
(gst_v4lsrc_get_fps_list), (gst_v4lsrc_buffer_new):
Updates for API changes
2005-11-23 13:25:54 +00:00
|
|
|
if (!gst_structure_get_fraction (structure, "framerate", &visual->fps_n,
|
|
|
|
&visual->fps_d))
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
return FALSE;
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
visual_video_set_depth (visual->video,
|
2004-04-30 02:25:09 +00:00
|
|
|
visual_video_depth_enum_from_value (depth));
|
|
|
|
visual_video_set_dimension (visual->video, visual->width, visual->height);
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
visual_actor_video_negotiate (visual->actor, 0, FALSE, FALSE);
|
2004-04-30 02:25:09 +00:00
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
return TRUE;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
static gboolean
|
2005-09-06 22:29:00 +00:00
|
|
|
gst_visual_sink_setcaps (GstPad * pad, GstCaps * caps)
|
2004-04-30 02:25:09 +00:00
|
|
|
{
|
|
|
|
GstVisual *visual = GST_VISUAL (gst_pad_get_parent (pad));
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
gst_structure_get_int (structure, "rate", &visual->rate);
|
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
get_buffer (GstVisual * visual, GstBuffer ** outbuf)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
|
|
|
|
if (GST_PAD_CAPS (visual->srcpad) == NULL) {
|
|
|
|
gint width, height, bpp;
|
|
|
|
GstStructure *s;
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
/* No output caps current set up. Try and pick some */
|
|
|
|
caps = gst_pad_get_allowed_caps (visual->srcpad);
|
|
|
|
|
|
|
|
if (gst_caps_is_empty (caps)) {
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gst_caps_is_fixed (caps)) {
|
|
|
|
/* OK, not fixed, fixate the width and height */
|
|
|
|
caps = gst_caps_make_writable (caps);
|
|
|
|
gst_caps_truncate (caps);
|
|
|
|
|
|
|
|
s = gst_caps_get_structure (caps, 0);
|
|
|
|
|
2005-11-21 14:29:53 +00:00
|
|
|
gst_structure_fixate_field_nearest_int (s, "width", 320);
|
|
|
|
gst_structure_fixate_field_nearest_int (s, "height", 240);
|
Updates for API changes
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps):
* gst/videorate/gstvideorate.c: (gst_videorate_setcaps),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_create):
* sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_get_fps),
(gst_v4lmjpegsrc_src_convert), (gst_v4lmjpegsrc_src_query),
(gst_v4lmjpegsrc_get), (gst_v4lmjpegsrc_getcaps):
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_get_fps),
(gst_v4lsrc_get_fps_list), (gst_v4lsrc_buffer_new):
Updates for API changes
2005-11-23 13:25:54 +00:00
|
|
|
gst_structure_fixate_field_nearest_fraction (s, "framerate", 25, 1);
|
2005-09-07 20:06:43 +00:00
|
|
|
|
|
|
|
gst_pad_fixate_caps (visual->srcpad, caps);
|
|
|
|
} else
|
|
|
|
s = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (visual,
|
|
|
|
"Trying to alloc buffer with caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
|
|
|
|
if (!gst_structure_get_int (s, "width", &width) ||
|
|
|
|
!gst_structure_get_int (s, "height", &height) ||
|
|
|
|
!gst_structure_get_int (s, "bpp", &bpp)) {
|
|
|
|
ret = FALSE;
|
|
|
|
} else {
|
|
|
|
ret = gst_pad_alloc_buffer (visual->srcpad, GST_BUFFER_OFFSET_NONE,
|
|
|
|
height * GST_ROUND_UP_4 (width) * bpp, caps, outbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GST_PAD_CAPS (visual->srcpad) == NULL)
|
|
|
|
gst_pad_set_caps (visual->srcpad, caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
} else {
|
|
|
|
ret = gst_pad_alloc_buffer (visual->srcpad, GST_BUFFER_OFFSET_NONE,
|
|
|
|
visual->video->height * GST_ROUND_UP_4 (visual->video->width) *
|
|
|
|
visual->video->bpp, GST_PAD_CAPS (visual->srcpad), outbuf);
|
|
|
|
}
|
|
|
|
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
if (*outbuf == NULL)
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
return GST_FLOW_OK;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 22:29:00 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_visual_chain (GstPad * pad, GstBuffer * buffer)
|
2004-04-30 02:25:09 +00:00
|
|
|
{
|
2005-09-07 20:06:43 +00:00
|
|
|
GstBuffer *outbuf = NULL;
|
2004-05-04 00:44:19 +00:00
|
|
|
guint i;
|
2004-04-30 02:25:09 +00:00
|
|
|
GstVisual *visual = GST_VISUAL (gst_pad_get_parent (pad));
|
2005-09-07 20:06:43 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
|
|
|
guint spf;
|
|
|
|
|
|
|
|
/* If we don't have an output format yet, preallocate a buffer to try and
|
|
|
|
* set one */
|
|
|
|
if (GST_PAD_CAPS (visual->srcpad) == NULL) {
|
|
|
|
ret = get_buffer (visual, &outbuf);
|
|
|
|
if (ret != GST_FLOW_OK) {
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
2004-04-30 02:25:09 +00:00
|
|
|
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
/* Match timestamps from the incoming audio */
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
if (GST_BUFFER_TIMESTAMP (buffer) != GST_CLOCK_TIME_NONE)
|
|
|
|
visual->next_ts = GST_BUFFER_TIMESTAMP (buffer);
|
|
|
|
|
2004-05-04 00:44:19 +00:00
|
|
|
/* spf = samples per frame */
|
2005-11-22 23:39:12 +00:00
|
|
|
spf = ((guint64) (visual->rate) * visual->fps_d) / visual->fps_n;
|
2005-09-06 22:29:00 +00:00
|
|
|
gst_adapter_push (visual->adapter, buffer);
|
2005-09-07 20:06:43 +00:00
|
|
|
|
|
|
|
while (gst_adapter_available (visual->adapter) > MAX (512, spf) * 4 &&
|
|
|
|
(ret == GST_FLOW_OK)) {
|
|
|
|
/* Read 512 samples per channel */
|
2004-05-04 00:44:19 +00:00
|
|
|
const guint16 *data =
|
2005-09-07 20:06:43 +00:00
|
|
|
(const guint16 *) gst_adapter_peek (visual->adapter, 512 * 4);
|
2005-09-06 22:29:00 +00:00
|
|
|
|
2004-05-04 00:44:19 +00:00
|
|
|
for (i = 0; i < 512; i++) {
|
|
|
|
visual->audio.plugpcm[0][i] = *data++;
|
|
|
|
visual->audio.plugpcm[1][i] = *data++;
|
|
|
|
}
|
2005-09-07 20:06:43 +00:00
|
|
|
|
|
|
|
if (outbuf == NULL) {
|
|
|
|
ret = get_buffer (visual, &outbuf);
|
|
|
|
if (ret != GST_FLOW_OK) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (visual->video != NULL) {
|
|
|
|
visual_video_set_buffer (visual->video, GST_BUFFER_DATA (outbuf));
|
|
|
|
visual_audio_analyze (&visual->audio);
|
|
|
|
visual_actor_run (visual->actor, &visual->audio);
|
|
|
|
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = visual->next_ts;
|
Updates for API changes
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps):
* gst/videorate/gstvideorate.c: (gst_videorate_setcaps),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_create):
* sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_get_fps),
(gst_v4lmjpegsrc_src_convert), (gst_v4lmjpegsrc_src_query),
(gst_v4lmjpegsrc_get), (gst_v4lmjpegsrc_getcaps):
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_get_fps),
(gst_v4lsrc_get_fps_list), (gst_v4lsrc_buffer_new):
Updates for API changes
2005-11-23 13:25:54 +00:00
|
|
|
GST_BUFFER_DURATION (outbuf) = gst_util_uint64_scale_int (GST_SECOND,
|
2005-11-22 23:39:12 +00:00
|
|
|
visual->fps_d, visual->fps_n);
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
visual->next_ts += GST_BUFFER_DURATION (outbuf);
|
2005-09-07 20:06:43 +00:00
|
|
|
ret = gst_pad_push (visual->srcpad, outbuf);
|
|
|
|
outbuf = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Flush out the number of samples per frame * channels * sizeof (gint16) */
|
|
|
|
/* Recompute spf in case caps changed */
|
2005-11-22 23:39:12 +00:00
|
|
|
spf = ((guint64) (visual->rate) * visual->fps_d) / visual->fps_n;
|
2005-09-07 20:06:43 +00:00
|
|
|
GST_DEBUG_OBJECT (visual, "finished frame, flushing %u samples from input",
|
|
|
|
spf);
|
|
|
|
gst_adapter_flush (visual->adapter,
|
|
|
|
MIN (gst_adapter_available (visual->adapter), spf * 4));
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
2005-09-07 20:06:43 +00:00
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
/* so we're on the safe side */
|
2005-09-07 20:06:43 +00:00
|
|
|
if (visual->video)
|
|
|
|
visual_video_set_buffer (visual->video, NULL);
|
2005-09-06 22:29:00 +00:00
|
|
|
|
2005-09-07 20:06:43 +00:00
|
|
|
if (outbuf != NULL)
|
|
|
|
gst_buffer_unref (outbuf);
|
|
|
|
|
|
|
|
return ret;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_visual_change_state (GstElement * element, GstStateChange transition)
|
2004-04-30 02:25:09 +00:00
|
|
|
{
|
|
|
|
GstVisual *visual = GST_VISUAL (element);
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
GstStateChangeReturn ret;
|
2004-04-30 02:25:09 +00:00
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2004-04-30 02:25:09 +00:00
|
|
|
visual->actor =
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info->
|
|
|
|
plugname);
|
2005-09-07 20:06:43 +00:00
|
|
|
visual->video = visual_video_new ();
|
|
|
|
|
|
|
|
if (!visual->actor || !visual->video)
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
if (visual_actor_realize (visual->actor) != 0) {
|
2005-02-19 17:08:27 +00:00
|
|
|
visual_object_unref (VISUAL_OBJECT (visual->actor));
|
2004-04-30 02:25:09 +00:00
|
|
|
visual->actor = NULL;
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
2005-09-07 20:06:43 +00:00
|
|
|
visual_actor_set_video (visual->actor, visual->video);
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2004-05-04 00:44:19 +00:00
|
|
|
gst_adapter_clear (visual->adapter);
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
visual->next_ts = 0;
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2005-09-07 20:06:43 +00:00
|
|
|
if (visual->actor)
|
|
|
|
visual_object_unref (VISUAL_OBJECT (visual->actor));
|
|
|
|
if (visual->video)
|
|
|
|
visual_object_unref (VISUAL_OBJECT (visual->video));
|
2004-04-30 02:25:09 +00:00
|
|
|
visual->actor = NULL;
|
2005-09-07 20:06:43 +00:00
|
|
|
visual->video = NULL;
|
2004-04-30 02:25:09 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-07-09 10:56:51 +00:00
|
|
|
break;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
check/: Add extra tests for basetransform based components.
Original commit message from CVS:
* check/Makefile.am:
* check/pipelines/simple_launch_lines.c: (setup_pipeline),
(run_pipeline), (GST_START_TEST), (simple_launch_lines_suite):
Add extra tests for basetransform based components.
Comment out the test_element_negotiation test until we decide
if it's testing correct behaviour.
* ext/libvisual/visual.c: (gst_visual_init), (get_buffer),
(gst_visual_chain), (gst_visual_change_state):
Slightly more correct but still bogus timestamping.
Fix state change function.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init):
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_class_init):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_class_init),
(gst_videoscale_prepare_size), (gst_videoscale_set_caps),
(gst_videoscale_prepare_image):
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_transform_ip):
Basetransform updates. Enable passthrough modes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
Negotiation fix that allows the window to return to the original
size and renegotiate passthrough upstream. Extra debug output.
2005-09-09 17:53:47 +00:00
|
|
|
return ret;
|
2004-04-30 02:25:09 +00:00
|
|
|
}
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
static void
|
|
|
|
make_valid_name (char *name)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Replace invalid chars with _ in the type name
|
|
|
|
*/
|
|
|
|
static const gchar *extra_chars = "-_+";
|
|
|
|
gchar *p = name;
|
|
|
|
|
|
|
|
for (; *p; p++) {
|
|
|
|
int valid = ((p[0] >= 'A' && p[0] <= 'Z') ||
|
|
|
|
(p[0] >= 'a' && p[0] <= 'z') ||
|
|
|
|
(p[0] >= '0' && p[0] <= '9') || strchr (extra_chars, p[0]));
|
|
|
|
if (!valid)
|
|
|
|
*p = '_';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
VisList *list;
|
|
|
|
|
2005-09-15 06:59:36 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (libvisual_debug, "libvisual", 0,
|
|
|
|
"libvisual audio visualisations");
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
if (!visual_is_initialized ())
|
|
|
|
if (visual_init (NULL, NULL) != 0)
|
|
|
|
return FALSE;
|
2004-04-30 02:25:09 +00:00
|
|
|
|
2005-09-15 06:59:36 +00:00
|
|
|
visual_log_set_verboseness (VISUAL_LOG_VERBOSENESS_LOW);
|
|
|
|
visual_log_set_info_handler (libvisual_log_handler, (void *) GST_LEVEL_INFO);
|
|
|
|
visual_log_set_warning_handler (libvisual_log_handler,
|
|
|
|
(void *) GST_LEVEL_WARNING);
|
|
|
|
visual_log_set_critical_handler (libvisual_log_handler,
|
|
|
|
(void *) GST_LEVEL_ERROR);
|
|
|
|
visual_log_set_error_handler (libvisual_log_handler,
|
|
|
|
(void *) GST_LEVEL_ERROR);
|
|
|
|
|
2004-04-30 02:25:09 +00:00
|
|
|
list = visual_actor_get_list ();
|
|
|
|
for (i = 0; i < visual_list_count (list); i++) {
|
|
|
|
VisPluginRef *ref = visual_list_get (list, i);
|
|
|
|
GType type;
|
|
|
|
gchar *name;
|
|
|
|
GTypeInfo info = {
|
|
|
|
sizeof (GstVisualClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
gst_visual_class_init,
|
|
|
|
NULL,
|
|
|
|
ref,
|
|
|
|
sizeof (GstVisual),
|
|
|
|
0,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
if (ref->info->plugname == NULL)
|
2004-04-30 02:25:09 +00:00
|
|
|
continue;
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
|
|
|
|
name = g_strdup_printf ("GstVisual%s", ref->info->plugname);
|
|
|
|
make_valid_name (name);
|
2004-04-30 02:25:09 +00:00
|
|
|
type = g_type_register_static (GST_TYPE_VISUAL, name, &info, 0);
|
|
|
|
g_free (name);
|
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
Original commit message from CVS:
* configure.ac:
* ext/libvisual/visual.c: (gst_visual_get_type),
(libvisual_log_handler), (gst_visual_getcaps),
(gst_visual_srclink), (gst_visual_change_state), (make_valid_name),
(plugin_init):
Update libvisual to 0.1.7. Link in the debug handling to gstreamer
* ext/smoothwave/Makefile.am:
* ext/smoothwave/demo-osssrc.c: (main):
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_class_init),
(gst_smoothwave_init), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain), (gst_sw_change_state),
(plugin_init):
* ext/smoothwave/gstsmoothwave.h:
Make gstsmoothwave a working element in the 20th century.
* gst/chart/gstchart.c: (gst_chart_init), (gst_chart_srcconnect):
Fix incorrect link function
2004-11-12 17:37:49 +00:00
|
|
|
|
|
|
|
name = g_strdup_printf ("libvisual_%s", ref->info->plugname);
|
|
|
|
make_valid_name (name);
|
2004-04-30 02:25:09 +00:00
|
|
|
if (!gst_element_register (plugin, name, GST_RANK_NONE, type)) {
|
|
|
|
g_free (name);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
g_free (name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"libvisual",
|
|
|
|
"libvisual visualization plugins",
|
2005-10-16 13:54:44 +00:00
|
|
|
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|