2002-07-26 22:18:57 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2002> David A. Schleef <ds@schleef.org>
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2002-07-26 22:18:57 +00:00
|
|
|
*/
|
|
|
|
|
2005-12-01 01:12:55 +00:00
|
|
|
#ifndef __GST_VIDEO_TEST_SRC_H__
|
|
|
|
#define __GST_VIDEO_TEST_SRC_H__
|
2002-07-26 22:18:57 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
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
|
|
|
#include <gst/base/gstpushsrc.h>
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2011-10-31 01:23:21 +00:00
|
|
|
#include <gst/video/gstvideometa.h>
|
2011-07-29 15:15:39 +00:00
|
|
|
#include <gst/video/gstvideopool.h>
|
2011-06-21 15:33:27 +00:00
|
|
|
|
2002-10-30 09:17:12 +00:00
|
|
|
G_BEGIN_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2020-03-12 12:31:22 +00:00
|
|
|
#define GST_TYPE_VIDEO_TEST_SRC (gst_video_test_src_get_type())
|
|
|
|
G_DECLARE_FINAL_TYPE (GstVideoTestSrc, gst_video_test_src, GST, VIDEO_TEST_SRC,
|
|
|
|
GstPushSrc)
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2006-03-01 17:39:28 +00:00
|
|
|
/**
|
|
|
|
* GstVideoTestSrcPattern:
|
|
|
|
* @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern
|
|
|
|
* @GST_VIDEO_TEST_SRC_SNOW: Random noise
|
|
|
|
* @GST_VIDEO_TEST_SRC_BLACK: A black image
|
gst/videotestsrc/: Add more uni-colour patterns ("white", "red", "green", and "blue").
Original commit message from CVS:
* gst/videotestsrc/gstvideotestsrc.c:
(gst_video_test_src_pattern_get_type),
(gst_video_test_src_set_pattern):
* gst/videotestsrc/gstvideotestsrc.h:
* gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor),
(gst_video_test_src_black), (gst_video_test_src_white),
(gst_video_test_src_red), (gst_video_test_src_green),
(gst_video_test_src_blue):
* gst/videotestsrc/videotestsrc.h:
Add more uni-colour patterns ("white", "red", "green", and "blue").
2006-09-01 16:12:35 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_WHITE: A white image
|
|
|
|
* @GST_VIDEO_TEST_SRC_RED: A red image
|
|
|
|
* @GST_VIDEO_TEST_SRC_GREEN: A green image
|
|
|
|
* @GST_VIDEO_TEST_SRC_BLUE: A blue image
|
2006-10-23 12:46:41 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_CHECKERS1: Checkers pattern (1px)
|
|
|
|
* @GST_VIDEO_TEST_SRC_CHECKERS2: Checkers pattern (2px)
|
|
|
|
* @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px)
|
|
|
|
* @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px)
|
2007-04-04 02:45:03 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern
|
2007-12-18 01:01:23 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white
|
2008-11-19 00:24:44 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_SMPTE75: SMPTE test pattern (75% color bars)
|
2008-11-21 20:32:56 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_ZONE_PLATE: Zone plate
|
2009-10-07 02:35:50 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_GAMUT: Gamut checking pattern
|
2010-03-15 08:35:15 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE: Chroma zone plate
|
2010-08-23 05:16:45 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_BALL: Moving ball
|
2010-09-13 03:36:19 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_SMPTE100: SMPTE test pattern (100% color bars)
|
2015-03-16 08:37:26 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_SOLID: A solid color, defined by the
|
|
|
|
* #GstVideoTestSrc:foreground-color property
|
2010-09-16 15:14:20 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_BAR: Bar with foreground color
|
2013-07-31 18:26:58 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_PINWHEEL: Pinwheel
|
|
|
|
* @GST_VIDEO_TEST_SRC_SPOKES: Spokes
|
2015-03-10 10:55:11 +00:00
|
|
|
* @GST_VIDEO_TEST_SRC_GRADIENT: Gradient
|
|
|
|
* @GST_VIDEO_TEST_SRC_COLORS: All colors
|
2006-03-01 17:39:28 +00:00
|
|
|
*
|
|
|
|
* The test pattern to produce.
|
2009-10-07 02:35:50 +00:00
|
|
|
*
|
|
|
|
* The Gamut pattern creates a checkerboard pattern of colors at the
|
|
|
|
* edge of the YCbCr gamut and nearby colors that are out of gamut.
|
|
|
|
* The pattern is divided into 4 regions: black, white, red, and blue.
|
|
|
|
* After conversion to RGB, the out-of-gamut colors should be converted
|
|
|
|
* to the same value as their in-gamut neighbors. If the checkerboard
|
|
|
|
* pattern is still visible after conversion, this indicates a faulty
|
|
|
|
* conversion. Image manipulation, such as adjusting contrast or
|
|
|
|
* brightness, can also cause the pattern to be visible.
|
2010-03-15 08:35:15 +00:00
|
|
|
*
|
|
|
|
* The Zone Plate pattern is based on BBC R&D Report 1978/23, and can
|
|
|
|
* be used to test spatial frequency response of a system. This
|
|
|
|
* pattern generator is controlled by the xoffset and yoffset parameters
|
|
|
|
* and also by all the parameters starting with 'k'. The default
|
|
|
|
* parameters produce a grey pattern. Try 'videotestsrc
|
|
|
|
* pattern=zone-plate kx2=20 ky2=20 kt=1' to produce something
|
|
|
|
* interesting.
|
2006-03-01 17:39:28 +00:00
|
|
|
*/
|
2004-03-15 16:32:55 +00:00
|
|
|
typedef enum {
|
2005-12-01 01:12:55 +00:00
|
|
|
GST_VIDEO_TEST_SRC_SMPTE,
|
|
|
|
GST_VIDEO_TEST_SRC_SNOW,
|
|
|
|
GST_VIDEO_TEST_SRC_BLACK,
|
gst/videotestsrc/: Add more uni-colour patterns ("white", "red", "green", and "blue").
Original commit message from CVS:
* gst/videotestsrc/gstvideotestsrc.c:
(gst_video_test_src_pattern_get_type),
(gst_video_test_src_set_pattern):
* gst/videotestsrc/gstvideotestsrc.h:
* gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor),
(gst_video_test_src_black), (gst_video_test_src_white),
(gst_video_test_src_red), (gst_video_test_src_green),
(gst_video_test_src_blue):
* gst/videotestsrc/videotestsrc.h:
Add more uni-colour patterns ("white", "red", "green", and "blue").
2006-09-01 16:12:35 +00:00
|
|
|
GST_VIDEO_TEST_SRC_WHITE,
|
|
|
|
GST_VIDEO_TEST_SRC_RED,
|
|
|
|
GST_VIDEO_TEST_SRC_GREEN,
|
2006-10-23 12:46:41 +00:00
|
|
|
GST_VIDEO_TEST_SRC_BLUE,
|
|
|
|
GST_VIDEO_TEST_SRC_CHECKERS1,
|
|
|
|
GST_VIDEO_TEST_SRC_CHECKERS2,
|
|
|
|
GST_VIDEO_TEST_SRC_CHECKERS4,
|
2007-04-04 02:45:03 +00:00
|
|
|
GST_VIDEO_TEST_SRC_CHECKERS8,
|
2007-12-18 01:01:23 +00:00
|
|
|
GST_VIDEO_TEST_SRC_CIRCULAR,
|
2008-11-19 00:24:44 +00:00
|
|
|
GST_VIDEO_TEST_SRC_BLINK,
|
2008-11-21 20:32:56 +00:00
|
|
|
GST_VIDEO_TEST_SRC_SMPTE75,
|
2009-10-07 02:35:50 +00:00
|
|
|
GST_VIDEO_TEST_SRC_ZONE_PLATE,
|
2010-03-15 08:35:15 +00:00
|
|
|
GST_VIDEO_TEST_SRC_GAMUT,
|
2010-07-21 12:20:03 +00:00
|
|
|
GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE,
|
2010-08-23 05:16:45 +00:00
|
|
|
GST_VIDEO_TEST_SRC_SOLID,
|
2010-09-01 13:18:31 +00:00
|
|
|
GST_VIDEO_TEST_SRC_BALL,
|
2010-09-16 15:14:20 +00:00
|
|
|
GST_VIDEO_TEST_SRC_SMPTE100,
|
2013-07-31 18:26:58 +00:00
|
|
|
GST_VIDEO_TEST_SRC_BAR,
|
|
|
|
GST_VIDEO_TEST_SRC_PINWHEEL,
|
2014-10-08 09:26:24 +00:00
|
|
|
GST_VIDEO_TEST_SRC_SPOKES,
|
2015-03-10 10:55:11 +00:00
|
|
|
GST_VIDEO_TEST_SRC_GRADIENT,
|
|
|
|
GST_VIDEO_TEST_SRC_COLORS
|
2005-07-19 12:01:53 +00:00
|
|
|
} GstVideoTestSrcPattern;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2014-11-28 00:02:49 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_VIDEO_TEST_SRC_FRAMES,
|
|
|
|
GST_VIDEO_TEST_SRC_WALL_TIME,
|
|
|
|
GST_VIDEO_TEST_SRC_RUNNING_TIME
|
|
|
|
} GstVideoTestSrcAnimationMode;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GST_VIDEO_TEST_SRC_WAVY,
|
|
|
|
GST_VIDEO_TEST_SRC_SWEEP,
|
|
|
|
GST_VIDEO_TEST_SRC_HSWEEP
|
|
|
|
} GstVideoTestSrcMotionType;
|
|
|
|
|
2006-03-01 17:39:28 +00:00
|
|
|
/**
|
|
|
|
* GstVideoTestSrc:
|
|
|
|
*
|
|
|
|
* Opaque data structure.
|
|
|
|
*/
|
2005-07-19 12:01:53 +00:00
|
|
|
struct _GstVideoTestSrc {
|
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 element;
|
2002-07-26 22:18:57 +00:00
|
|
|
|
2006-10-23 12:46:41 +00:00
|
|
|
/*< private >*/
|
|
|
|
|
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
|
|
|
/* type of output */
|
2005-07-19 12:01:53 +00:00
|
|
|
GstVideoTestSrcPattern pattern_type;
|
2003-07-14 08:36:03 +00:00
|
|
|
|
2002-07-26 22:18:57 +00:00
|
|
|
/* video state */
|
2017-05-23 06:43:26 +00:00
|
|
|
GstVideoInfo info; /* protected by the object or stream lock */
|
2013-05-17 14:26:49 +00:00
|
|
|
GstVideoChromaResample *subsample;
|
2012-06-06 09:15:50 +00:00
|
|
|
gboolean bayer;
|
|
|
|
gint x_invert;
|
|
|
|
gint y_invert;
|
2011-04-29 10:10:14 +00:00
|
|
|
|
2002-07-26 22:18:57 +00:00
|
|
|
/* private */
|
2014-10-21 09:13:30 +00:00
|
|
|
/* FIXME 2.0: Change type to GstClockTime */
|
2005-12-06 19:42:02 +00:00
|
|
|
gint64 timestamp_offset; /* base offset */
|
2012-08-29 19:02:11 +00:00
|
|
|
|
|
|
|
/* running time and frames for current caps */
|
2005-12-06 19:42:02 +00:00
|
|
|
GstClockTime running_time; /* total running time */
|
|
|
|
gint64 n_frames; /* total frames sent */
|
2013-10-08 03:08:34 +00:00
|
|
|
gboolean reverse;
|
2002-07-30 01:25:26 +00:00
|
|
|
|
2012-08-29 19:02:11 +00:00
|
|
|
/* previous caps running time and frames */
|
|
|
|
GstClockTime accum_rtime; /* accumulated running_time */
|
|
|
|
gint64 accum_frames; /* accumulated frames */
|
|
|
|
|
2008-11-21 20:32:56 +00:00
|
|
|
/* zoneplate */
|
|
|
|
gint k0;
|
|
|
|
gint kx;
|
|
|
|
gint ky;
|
|
|
|
gint kt;
|
|
|
|
gint kxt;
|
|
|
|
gint kyt;
|
|
|
|
gint kxy;
|
|
|
|
gint kx2;
|
|
|
|
gint ky2;
|
|
|
|
gint kt2;
|
|
|
|
gint xoffset;
|
|
|
|
gint yoffset;
|
2010-07-21 12:20:03 +00:00
|
|
|
|
|
|
|
/* solid color */
|
2010-09-06 03:35:13 +00:00
|
|
|
guint foreground_color;
|
|
|
|
guint background_color;
|
|
|
|
|
2010-09-01 13:18:31 +00:00
|
|
|
/* moving color bars */
|
2010-09-13 03:36:19 +00:00
|
|
|
gint horizontal_offset;
|
|
|
|
gint horizontal_speed;
|
2010-09-01 13:18:31 +00:00
|
|
|
|
2016-10-14 13:18:28 +00:00
|
|
|
/* smpte & snow */
|
|
|
|
guint random_state;
|
|
|
|
|
2014-11-28 00:02:49 +00:00
|
|
|
/* Ball motion */
|
|
|
|
GstVideoTestSrcAnimationMode animation_mode;
|
|
|
|
GstVideoTestSrcMotionType motion_type;
|
|
|
|
gboolean flip;
|
|
|
|
|
|
|
|
void (*make_image) (GstVideoTestSrc *v, GstClockTime pts, GstVideoFrame *frame);
|
2010-09-10 19:48:30 +00:00
|
|
|
|
|
|
|
/* temporary AYUV/ARGB scanline */
|
2010-09-13 03:36:19 +00:00
|
|
|
guint8 *tmpline_u8;
|
2010-09-10 19:48:30 +00:00
|
|
|
guint8 *tmpline;
|
2010-09-13 03:36:19 +00:00
|
|
|
guint8 *tmpline2;
|
2012-05-29 15:48:45 +00:00
|
|
|
guint16 *tmpline_u16;
|
2013-05-17 14:26:49 +00:00
|
|
|
|
|
|
|
guint n_lines;
|
|
|
|
gint offset;
|
|
|
|
gpointer *lines;
|
2002-07-26 22:18:57 +00:00
|
|
|
};
|
|
|
|
|
2021-02-11 10:14:31 +00:00
|
|
|
GST_ELEMENT_REGISTER_DECLARE (videotestsrc);
|
|
|
|
|
2002-10-30 09:17:12 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2005-12-01 01:12:55 +00:00
|
|
|
#endif /* __GST_VIDEO_TEST_SRC_H__ */
|