2002-07-26 22:18:57 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2005-07-19 12:01:53 +00:00
|
|
|
* Copyright (C) <2002> David A. Schleef <ds@schleef.org>
|
2002-07-26 22:18:57 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2004-07-27 21:51:32 +00:00
|
|
|
#include "gstvideotestsrc.h"
|
|
|
|
#include "videotestsrc.h"
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2002-07-28 13:40:53 +00:00
|
|
|
#include <string.h>
|
2002-07-26 22:18:57 +00:00
|
|
|
#include <stdlib.h>
|
Convert a few inner loops to use liboil. This is currently optional, and is only enabled if liboil is present (duh!).
Original commit message from CVS:
Convert a few inner loops to use liboil. This is currently
optional, and is only enabled if liboil is present (duh!).
* configure.ac: Check for liboil-0.1
* gst/intfloat/Makefile.am:
* gst/intfloat/gstint2float.c: (conv_f32_s16), (scalarmult_f32),
(gst_int2float_chain_gint16):
* gst/videofilter/Makefile.am:
* gst/videofilter/gstvideobalance.c: (gst_videobalance_class_init),
(tablelookup_u8), (gst_videobalance_planar411):
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (plugin_init):
* gst/videotestsrc/videotestsrc.c: (splat_u8), (paint_hline_YUY2),
(paint_hline_IYU2), (paint_hline_str4), (paint_hline_str3),
(paint_hline_RGB565), (paint_hline_xRGB1555):
2004-02-12 07:37:50 +00:00
|
|
|
#include <liboil/liboil.h>
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
|
2004-07-22 15:55:33 +00:00
|
|
|
GST_DEBUG_CATEGORY (videotestsrc_debug);
|
|
|
|
#define GST_CAT_DEFAULT videotestsrc_debug
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static GstElementDetails videotestsrc_details =
|
|
|
|
GST_ELEMENT_DETAILS ("Video test source",
|
|
|
|
"Source/Video",
|
|
|
|
"Creates a test video stream",
|
|
|
|
"David A. Schleef <ds@schleef.org>");
|
2002-07-26 22:18:57 +00:00
|
|
|
|
|
|
|
|
2002-10-04 06:49:51 +00:00
|
|
|
enum
|
|
|
|
{
|
2005-07-19 12:01:53 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_PATTERN,
|
|
|
|
PROP_TIMESTAMP_OFFSET,
|
2005-06-24 00:17:13 +00:00
|
|
|
/* FILL ME */
|
2002-07-26 22:18:57 +00:00
|
|
|
};
|
|
|
|
|
2004-08-04 11:08:13 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
GST_BOILERPLATE (GstVideoTestSrc, gst_videotestsrc, GstPushSrc,
|
|
|
|
GST_TYPE_PUSH_SRC);
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
|
|
|
|
static void gst_videotestsrc_set_pattern (GstVideoTestSrc * videotestsrc,
|
2004-03-14 22:34:34 +00:00
|
|
|
int pattern_type);
|
2002-10-04 06:49:51 +00:00
|
|
|
static void gst_videotestsrc_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_videotestsrc_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2002-07-26 22:18:57 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
static GstCaps *gst_videotestsrc_getcaps (GstBaseSrc * bsrc);
|
|
|
|
static gboolean gst_videotestsrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
|
|
|
|
static gboolean gst_videotestsrc_negotiate (GstBaseSrc * bsrc);
|
|
|
|
static void gst_videotestsrc_get_times (GstBaseSrc * src, GstBuffer * buffer,
|
|
|
|
GstClockTime * start, GstClockTime * end);
|
2005-07-19 12:01:53 +00:00
|
|
|
static gboolean gst_videotestsrc_event (GstBaseSrc * bsrc, GstEvent * event);
|
2002-07-26 22:18:57 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
static GstFlowReturn gst_videotestsrc_create (GstPushSrc * psrc,
|
|
|
|
GstBuffer ** buffer);
|
2005-05-09 10:56:13 +00:00
|
|
|
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2003-04-23 07:38:32 +00:00
|
|
|
#define GST_TYPE_VIDEOTESTSRC_PATTERN (gst_videotestsrc_pattern_get_type ())
|
|
|
|
static GType
|
|
|
|
gst_videotestsrc_pattern_get_type (void)
|
|
|
|
{
|
|
|
|
static GType videotestsrc_pattern_type = 0;
|
|
|
|
static GEnumValue pattern_types[] = {
|
2004-03-14 22:34:34 +00:00
|
|
|
{GST_VIDEOTESTSRC_SMPTE, "smpte", "SMPTE 100% color bars"},
|
|
|
|
{GST_VIDEOTESTSRC_SNOW, "snow", "Random (television snow)"},
|
2004-08-02 15:35:13 +00:00
|
|
|
{GST_VIDEOTESTSRC_BLACK, "black", "100% Black"},
|
2004-03-14 22:34:34 +00:00
|
|
|
{0, NULL, NULL},
|
2003-04-23 07:38:32 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!videotestsrc_pattern_type) {
|
|
|
|
videotestsrc_pattern_type =
|
2005-07-19 12:01:53 +00:00
|
|
|
g_enum_register_static ("GstVideoTestSrcPattern", pattern_types);
|
2003-04-23 07:38:32 +00:00
|
|
|
}
|
|
|
|
return videotestsrc_pattern_type;
|
|
|
|
}
|
|
|
|
|
2003-11-02 20:48:33 +00:00
|
|
|
static void
|
|
|
|
gst_videotestsrc_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &videotestsrc_details);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
2005-07-19 12:01:53 +00:00
|
|
|
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
|
|
|
gst_videotestsrc_getcaps (NULL)));
|
2003-11-02 20:48:33 +00:00
|
|
|
}
|
2005-07-19 12:01:53 +00:00
|
|
|
|
2002-07-26 22:18:57 +00:00
|
|
|
static void
|
2005-07-19 12:01:53 +00:00
|
|
|
gst_videotestsrc_class_init (GstVideoTestSrcClass * klass)
|
2002-07-26 22:18:57 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
GstBaseSrcClass *gstbasesrc_class;
|
|
|
|
GstPushSrcClass *gstpushsrc_class;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2002-10-04 06:49:51 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gstbasesrc_class = (GstBaseSrcClass *) klass;
|
|
|
|
gstpushsrc_class = (GstPushSrcClass *) klass;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class->set_property = gst_videotestsrc_set_property;
|
|
|
|
gobject_class->get_property = gst_videotestsrc_get_property;
|
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PATTERN,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_enum ("pattern", "Pattern",
|
2004-03-15 19:32:28 +00:00
|
|
|
"Type of test pattern to generate", GST_TYPE_VIDEOTESTSRC_PATTERN, 1,
|
|
|
|
G_PARAM_READWRITE));
|
2005-07-19 12:01:53 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
|
|
|
PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
|
|
|
|
"Timestamp offset",
|
|
|
|
"An offset added to timestamps set on buffers (in ns)", G_MININT64,
|
|
|
|
G_MAXINT64, 0, G_PARAM_READWRITE));
|
2003-05-01 06:24:34 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gstbasesrc_class->get_caps = gst_videotestsrc_getcaps;
|
|
|
|
gstbasesrc_class->set_caps = gst_videotestsrc_setcaps;
|
|
|
|
gstbasesrc_class->negotiate = gst_videotestsrc_negotiate;
|
|
|
|
gstbasesrc_class->get_times = gst_videotestsrc_get_times;
|
|
|
|
gstbasesrc_class->event = gst_videotestsrc_event;
|
2003-05-01 06:24:34 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gstpushsrc_class->create = gst_videotestsrc_create;
|
2002-07-26 22:18:57 +00:00
|
|
|
}
|
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
static void
|
2005-08-28 17:52:45 +00:00
|
|
|
gst_videotestsrc_init (GstVideoTestSrc * videotestsrc,
|
|
|
|
GstVideoTestSrcClass * g_class)
|
2003-12-22 01:47:09 +00:00
|
|
|
{
|
2005-07-19 12:01:53 +00:00
|
|
|
gst_videotestsrc_set_pattern (videotestsrc, GST_VIDEOTESTSRC_SMPTE);
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
videotestsrc->segment_start_frame = -1;
|
|
|
|
videotestsrc->segment_end_frame = -1;
|
|
|
|
videotestsrc->timestamp_offset = 0;
|
|
|
|
}
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
static void
|
|
|
|
gst_videotestsrc_set_pattern (GstVideoTestSrc * videotestsrc, int pattern_type)
|
|
|
|
{
|
|
|
|
videotestsrc->pattern_type = pattern_type;
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
GST_DEBUG_OBJECT (videotestsrc, "setting pattern to %d", pattern_type);
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
switch (pattern_type) {
|
|
|
|
case GST_VIDEOTESTSRC_SMPTE:
|
|
|
|
videotestsrc->make_image = gst_videotestsrc_smpte;
|
|
|
|
break;
|
|
|
|
case GST_VIDEOTESTSRC_SNOW:
|
|
|
|
videotestsrc->make_image = gst_videotestsrc_snow;
|
|
|
|
break;
|
|
|
|
case GST_VIDEOTESTSRC_BLACK:
|
|
|
|
videotestsrc->make_image = gst_videotestsrc_black;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
static void
|
|
|
|
gst_videotestsrc_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVideoTestSrc *videotestsrc = GST_VIDEOTESTSRC (object);
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_PATTERN:
|
|
|
|
gst_videotestsrc_set_pattern (videotestsrc, g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
case PROP_TIMESTAMP_OFFSET:
|
|
|
|
videotestsrc->timestamp_offset = g_value_get_int64 (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
}
|
2005-07-19 12:01:53 +00:00
|
|
|
}
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
static void
|
|
|
|
gst_videotestsrc_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVideoTestSrc *videotestsrc = GST_VIDEOTESTSRC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_PATTERN:
|
|
|
|
g_value_set_enum (value, videotestsrc->pattern_type);
|
|
|
|
break;
|
|
|
|
case PROP_TIMESTAMP_OFFSET:
|
|
|
|
g_value_set_int64 (value, videotestsrc->timestamp_offset);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* threadsafe because this gets called as the plugin is loaded */
|
|
|
|
static GstCaps *
|
|
|
|
gst_videotestsrc_getcaps (GstBaseSrc * unused)
|
|
|
|
{
|
|
|
|
static GstCaps *capslist = NULL;
|
|
|
|
|
|
|
|
if (!capslist) {
|
|
|
|
GstCaps *caps;
|
|
|
|
GstStructure *structure;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < n_fourccs; i++) {
|
|
|
|
structure = paint_get_structure (fourcc_list + i);
|
|
|
|
gst_structure_set (structure,
|
|
|
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
|
|
|
gst_caps_append_structure (caps, structure);
|
|
|
|
}
|
|
|
|
|
|
|
|
capslist = caps;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gst_caps_copy (capslist);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_videotestsrc_parse_caps (const GstCaps * caps,
|
|
|
|
gint * width, gint * height, gdouble * rate,
|
|
|
|
struct fourcc_list_struct **fourcc)
|
2002-07-26 22:18:57 +00:00
|
|
|
{
|
2003-12-22 01:47:09 +00:00
|
|
|
const GstStructure *structure;
|
|
|
|
GstPadLinkReturn ret;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_DEBUG ("parsing caps");
|
|
|
|
|
|
|
|
if (gst_caps_get_size (caps) < 1)
|
|
|
|
return FALSE;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2003-06-10 16:22:41 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
*fourcc = paintinfo_find_by_structure (structure);
|
|
|
|
if (!*fourcc) {
|
2004-07-22 15:55:33 +00:00
|
|
|
g_critical ("videotestsrc format not found");
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
2002-07-26 22:18:57 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ret = gst_structure_get_int (structure, "width", width);
|
|
|
|
ret &= gst_structure_get_int (structure, "height", height);
|
|
|
|
ret &= gst_structure_get_double (structure, "framerate", rate);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2003-04-16 07:52:54 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gst_videotestsrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
|
|
|
gboolean res;
|
|
|
|
gint width, height;
|
|
|
|
gdouble rate;
|
|
|
|
struct fourcc_list_struct *fourcc;
|
2005-07-19 12:01:53 +00:00
|
|
|
GstVideoTestSrc *videotestsrc;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
videotestsrc = GST_VIDEOTESTSRC (bsrc);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
res = gst_videotestsrc_parse_caps (caps, &width, &height, &rate, &fourcc);
|
|
|
|
if (res) {
|
|
|
|
/* looks ok here */
|
|
|
|
videotestsrc->fourcc = fourcc;
|
|
|
|
videotestsrc->width = width;
|
|
|
|
videotestsrc->height = height;
|
|
|
|
videotestsrc->rate = rate;
|
|
|
|
videotestsrc->bpp = videotestsrc->fourcc->bitspp;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (videotestsrc, "size %dx%d, %f fps", videotestsrc->width,
|
|
|
|
videotestsrc->height, videotestsrc->rate);
|
|
|
|
}
|
|
|
|
return res;
|
2002-07-26 22:18:57 +00:00
|
|
|
}
|
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
static gboolean
|
|
|
|
gst_videotestsrc_negotiate (GstBaseSrc * bsrc)
|
2004-08-04 11:08:13 +00:00
|
|
|
{
|
2005-07-19 12:01:53 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
GstCaps *temp;
|
|
|
|
gboolean result = FALSE;
|
2004-08-04 11:08:13 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
/* get all possible caps on this link */
|
|
|
|
caps = gst_pad_get_allowed_caps (GST_BASE_SRC_PAD (bsrc));
|
|
|
|
temp = gst_caps_normalize (caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
caps = temp;
|
2003-07-14 08:36:03 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
if (gst_caps_get_size (caps) > 0) {
|
|
|
|
GstStructure *structure;
|
2003-07-14 08:36:03 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
/* pick the first one */
|
|
|
|
gst_caps_truncate (caps);
|
2003-07-14 08:36:03 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2002-07-30 07:38:01 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
gst_caps_structure_fixate_field_nearest_int (structure, "width", 320);
|
|
|
|
gst_caps_structure_fixate_field_nearest_int (structure, "height", 240);
|
|
|
|
gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
|
|
|
|
30.0);
|
2002-10-04 06:49:51 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
result = gst_pad_set_caps (GST_BASE_SRC_PAD (bsrc), caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
2002-10-04 06:49:51 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
return result;
|
2002-10-04 06:49:51 +00:00
|
|
|
}
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2002-10-04 06:49:51 +00:00
|
|
|
static void
|
2005-07-19 12:01:53 +00:00
|
|
|
gst_videotestsrc_get_times (GstBaseSrc * src, GstBuffer * buffer,
|
|
|
|
GstClockTime * start, GstClockTime * end)
|
2004-06-18 22:32:44 +00:00
|
|
|
{
|
2005-07-19 12:01:53 +00:00
|
|
|
*start = GST_CLOCK_TIME_NONE;
|
|
|
|
*end = GST_CLOCK_TIME_NONE;
|
2004-06-18 22:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gst_videotestsrc_event (GstBaseSrc * bsrc, GstEvent * event)
|
2004-06-18 22:32:44 +00:00
|
|
|
{
|
|
|
|
gboolean res = TRUE;
|
2005-07-19 12:01:53 +00:00
|
|
|
GstVideoTestSrc *videotestsrc;
|
2004-06-18 22:32:44 +00:00
|
|
|
gint64 new_n_frames;
|
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
videotestsrc = GST_VIDEOTESTSRC (bsrc);
|
2004-06-18 22:32:44 +00:00
|
|
|
new_n_frames = videotestsrc->n_frames;
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
|
|
|
{
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
GstFormat format;
|
|
|
|
GstSeekType cur_type, stop_type;
|
|
|
|
GstSeekFlags flags;
|
|
|
|
gint64 cur, stop;
|
|
|
|
|
|
|
|
gst_event_parse_seek (event, NULL, &format, &flags, &cur_type, &cur,
|
|
|
|
&stop_type, &stop);
|
|
|
|
|
|
|
|
switch (format) {
|
2004-06-18 22:32:44 +00:00
|
|
|
case GST_FORMAT_TIME:
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
new_n_frames = cur * (double) videotestsrc->rate / GST_SECOND;
|
2004-06-18 22:32:44 +00:00
|
|
|
videotestsrc->segment_start_frame = new_n_frames;
|
|
|
|
videotestsrc->segment_end_frame =
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
stop * (double) videotestsrc->rate / GST_SECOND;
|
|
|
|
videotestsrc->segment = flags & GST_SEEK_FLAG_SEGMENT;
|
2004-06-18 22:32:44 +00:00
|
|
|
break;
|
|
|
|
case GST_FORMAT_DEFAULT:
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
new_n_frames = cur;
|
2004-06-18 22:32:44 +00:00
|
|
|
videotestsrc->segment_start_frame = new_n_frames;
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
videotestsrc->segment_end_frame = stop;
|
|
|
|
videotestsrc->segment = flags & GST_SEEK_FLAG_SEGMENT;
|
2004-06-18 22:32:44 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
res = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
res = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (videotestsrc->n_frames != new_n_frames) {
|
|
|
|
videotestsrc->n_frames = new_n_frames;
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2003-12-14 21:25:32 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_videotestsrc_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
2002-07-26 22:18:57 +00:00
|
|
|
{
|
2005-07-19 12:01:53 +00:00
|
|
|
GstVideoTestSrc *videotestsrc;
|
2002-07-26 22:18:57 +00:00
|
|
|
gulong newsize;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstBuffer *outbuf;
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
GstFlowReturn res;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
videotestsrc = GST_VIDEOTESTSRC (psrc);
|
2004-06-18 22:32:44 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
if (videotestsrc->fourcc == NULL)
|
|
|
|
goto not_negotiated;
|
2004-06-18 22:32:44 +00:00
|
|
|
|
2004-01-09 01:53:31 +00:00
|
|
|
newsize = gst_videotestsrc_get_size (videotestsrc, videotestsrc->width,
|
|
|
|
videotestsrc->height);
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (newsize > 0, GST_FLOW_ERROR);
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2004-07-22 15:55:33 +00:00
|
|
|
GST_LOG_OBJECT (videotestsrc, "creating buffer of %ld bytes for %dx%d image",
|
|
|
|
newsize, videotestsrc->width, videotestsrc->height);
|
2002-07-26 22:18:57 +00:00
|
|
|
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
res =
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
gst_pad_alloc_buffer (GST_BASE_SRC_PAD (psrc), GST_BUFFER_OFFSET_NONE,
|
|
|
|
newsize, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)), &outbuf);
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
if (res != GST_FLOW_OK)
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
goto no_buffer;
|
2002-07-30 01:25:26 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
videotestsrc->make_image (videotestsrc, (void *) GST_BUFFER_DATA (outbuf),
|
2004-03-14 22:34:34 +00:00
|
|
|
videotestsrc->width, videotestsrc->height);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = videotestsrc->timestamp_offset +
|
2004-08-05 17:51:07 +00:00
|
|
|
videotestsrc->running_time;
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_BUFFER_DURATION (outbuf) = GST_SECOND / (double) videotestsrc->rate;
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
|
2004-08-05 17:51:07 +00:00
|
|
|
videotestsrc->n_frames++;
|
2005-03-31 09:43:49 +00:00
|
|
|
videotestsrc->running_time += GST_BUFFER_DURATION (outbuf);
|
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
*buffer = outbuf;
|
gst/: Don't ignore _push() return values.
Original commit message from CVS:
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_setcaps), (gst_audio_convert_fixate),
(gst_audio_convert_change_state), (gst_audio_convert_channels):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_negotiate), (gst_videotestsrc_src_link),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_src_accept_caps),
(gst_videotestsrc_setcaps), (gst_videotestsrc_activate),
(gst_videotestsrc_init), (gst_videotestsrc_loop):
Don't ignore _push() return values.
Make sure no processing is done when shutting down.
Videotestsrc pad activation fix.
2005-05-05 09:49:08 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
return GST_FLOW_OK;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
not_negotiated:
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
GST_ELEMENT_ERROR (videotestsrc, CORE, NEGOTIATION, (NULL),
|
|
|
|
("format wasn't negotiated before get function"));
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
gst/videotestsrc/: Make videotestsrc a pushsrc.
Original commit message from CVS:
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get_type),
(gst_videotestsrc_class_init), (gst_videotestsrc_negotiate),
(gst_videotestsrc_setcaps), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_event),
(gst_videotestsrc_create), (gst_videotestsrc_start),
(gst_videotestsrc_stop), (gst_videotestsrc_get_times),
(gst_videotestsrc_set_pattern), (gst_videotestsrc_set_property),
(gst_videotestsrc_get_property):
* gst/videotestsrc/gstvideotestsrc.h:
Make videotestsrc a pushsrc.
2005-07-14 18:42:47 +00:00
|
|
|
no_buffer:
|
|
|
|
{
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-07-26 22:18:57 +00:00
|
|
|
|
|
|
|
static gboolean
|
2003-11-02 20:48:33 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2002-07-26 22:18:57 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
oil_init ();
|
Convert a few inner loops to use liboil. This is currently optional, and is only enabled if liboil is present (duh!).
Original commit message from CVS:
Convert a few inner loops to use liboil. This is currently
optional, and is only enabled if liboil is present (duh!).
* configure.ac: Check for liboil-0.1
* gst/intfloat/Makefile.am:
* gst/intfloat/gstint2float.c: (conv_f32_s16), (scalarmult_f32),
(gst_int2float_chain_gint16):
* gst/videofilter/Makefile.am:
* gst/videofilter/gstvideobalance.c: (gst_videobalance_class_init),
(tablelookup_u8), (gst_videobalance_planar411):
* gst/videotestsrc/Makefile.am:
* gst/videotestsrc/gstvideotestsrc.c: (plugin_init):
* gst/videotestsrc/videotestsrc.c: (splat_u8), (paint_hline_YUY2),
(paint_hline_IYU2), (paint_hline_str4), (paint_hline_str3),
(paint_hline_RGB565), (paint_hline_xRGB1555):
2004-02-12 07:37:50 +00:00
|
|
|
|
2005-07-19 12:01:53 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (videotestsrc_debug, "videotestsrc", 0,
|
|
|
|
"Video Test Source");
|
2004-08-04 11:08:13 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
return gst_element_register (plugin, "videotestsrc", GST_RANK_NONE,
|
|
|
|
GST_TYPE_VIDEOTESTSRC);
|
2002-07-26 22:18:57 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"videotestsrc",
|
|
|
|
"Creates a test video stream",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
|