|
Packit |
971217 |
/* GStreamer
|
|
Packit |
971217 |
* Copyright (C) <2002> David A. Schleef <ds@schleef.org>
|
|
Packit |
971217 |
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
971217 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
971217 |
* License as published by the Free Software Foundation; either
|
|
Packit |
971217 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
971217 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
971217 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
971217 |
* Library General Public License for more details.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
971217 |
* License along with this library; if not, write to the
|
|
Packit |
971217 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
971217 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#ifndef __GST_VIDEO_TEST_SRC_H__
|
|
Packit |
971217 |
#define __GST_VIDEO_TEST_SRC_H__
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include <gst/gst.h>
|
|
Packit |
971217 |
#include <gst/base/gstpushsrc.h>
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include <gst/video/gstvideometa.h>
|
|
Packit |
971217 |
#include <gst/video/gstvideopool.h>
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_BEGIN_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define GST_TYPE_VIDEO_TEST_SRC \
|
|
Packit |
971217 |
(gst_video_test_src_get_type())
|
|
Packit |
971217 |
#define GST_VIDEO_TEST_SRC(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrc))
|
|
Packit |
971217 |
#define GST_VIDEO_TEST_SRC_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrcClass))
|
|
Packit |
971217 |
#define GST_IS_VIDEO_TEST_SRC(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_TEST_SRC))
|
|
Packit |
971217 |
#define GST_IS_VIDEO_TEST_SRC_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_TEST_SRC))
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstVideoTestSrcPattern:
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SNOW: Random noise
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_BLACK: A black image
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_WHITE: A white image
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_RED: A red image
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_GREEN: A green image
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_BLUE: A blue image
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CHECKERS1: Checkers pattern (1px)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CHECKERS2: Checkers pattern (2px)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SMPTE75: SMPTE test pattern (75% color bars)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_ZONE_PLATE: Zone plate
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_GAMUT: Gamut checking pattern
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE: Chroma zone plate
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_BALL: Moving ball
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SMPTE100: SMPTE test pattern (100% color bars)
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SOLID: A solid color, defined by the
|
|
Packit |
971217 |
* #GstVideoTestSrc:foreground-color property
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_BAR: Bar with foreground color
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_PINWHEEL: Pinwheel
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_SPOKES: Spokes
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_GRADIENT: Gradient
|
|
Packit |
971217 |
* @GST_VIDEO_TEST_SRC_COLORS: All colors
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* The test pattern to produce.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* The Gamut pattern creates a checkerboard pattern of colors at the
|
|
Packit |
971217 |
* edge of the YCbCr gamut and nearby colors that are out of gamut.
|
|
Packit |
971217 |
* The pattern is divided into 4 regions: black, white, red, and blue.
|
|
Packit |
971217 |
* After conversion to RGB, the out-of-gamut colors should be converted
|
|
Packit |
971217 |
* to the same value as their in-gamut neighbors. If the checkerboard
|
|
Packit |
971217 |
* pattern is still visible after conversion, this indicates a faulty
|
|
Packit |
971217 |
* conversion. Image manipulation, such as adjusting contrast or
|
|
Packit |
971217 |
* brightness, can also cause the pattern to be visible.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* The Zone Plate pattern is based on BBC R&D Report 1978/23, and can
|
|
Packit |
971217 |
* be used to test spatial frequency response of a system. This
|
|
Packit |
971217 |
* pattern generator is controlled by the xoffset and yoffset parameters
|
|
Packit |
971217 |
* and also by all the parameters starting with 'k'. The default
|
|
Packit |
971217 |
* parameters produce a grey pattern. Try 'videotestsrc
|
|
Packit |
971217 |
* pattern=zone-plate kx2=20 ky2=20 kt=1' to produce something
|
|
Packit |
971217 |
* interesting.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
typedef enum {
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SMPTE,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SNOW,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_BLACK,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_WHITE,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_RED,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_GREEN,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_BLUE,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CHECKERS1,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CHECKERS2,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CHECKERS4,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CHECKERS8,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CIRCULAR,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_BLINK,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SMPTE75,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_ZONE_PLATE,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_GAMUT,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SOLID,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_BALL,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SMPTE100,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_BAR,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_PINWHEEL,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SPOKES,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_GRADIENT,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_COLORS
|
|
Packit |
971217 |
} GstVideoTestSrcPattern;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
typedef enum {
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_FRAMES,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_WALL_TIME,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_RUNNING_TIME
|
|
Packit |
971217 |
} GstVideoTestSrcAnimationMode;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
|
|
Packit |
971217 |
typedef enum {
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_WAVY,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_SWEEP,
|
|
Packit |
971217 |
GST_VIDEO_TEST_SRC_HSWEEP
|
|
Packit |
971217 |
} GstVideoTestSrcMotionType;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
typedef struct _GstVideoTestSrc GstVideoTestSrc;
|
|
Packit |
971217 |
typedef struct _GstVideoTestSrcClass GstVideoTestSrcClass;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstVideoTestSrc:
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* Opaque data structure.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
struct _GstVideoTestSrc {
|
|
Packit |
971217 |
GstPushSrc element;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/*< private >*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* type of output */
|
|
Packit |
971217 |
GstVideoTestSrcPattern pattern_type;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* video state */
|
|
Packit |
971217 |
GstVideoInfo info; /* protected by the object or stream lock */
|
|
Packit |
971217 |
GstVideoChromaResample *subsample;
|
|
Packit |
971217 |
gboolean bayer;
|
|
Packit |
971217 |
gint x_invert;
|
|
Packit |
971217 |
gint y_invert;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* private */
|
|
Packit |
971217 |
/* FIXME 2.0: Change type to GstClockTime */
|
|
Packit |
971217 |
gint64 timestamp_offset; /* base offset */
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* running time and frames for current caps */
|
|
Packit |
971217 |
GstClockTime running_time; /* total running time */
|
|
Packit |
971217 |
gint64 n_frames; /* total frames sent */
|
|
Packit |
971217 |
gboolean reverse;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* previous caps running time and frames */
|
|
Packit |
971217 |
GstClockTime accum_rtime; /* accumulated running_time */
|
|
Packit |
971217 |
gint64 accum_frames; /* accumulated frames */
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* zoneplate */
|
|
Packit |
971217 |
gint k0;
|
|
Packit |
971217 |
gint kx;
|
|
Packit |
971217 |
gint ky;
|
|
Packit |
971217 |
gint kt;
|
|
Packit |
971217 |
gint kxt;
|
|
Packit |
971217 |
gint kyt;
|
|
Packit |
971217 |
gint kxy;
|
|
Packit |
971217 |
gint kx2;
|
|
Packit |
971217 |
gint ky2;
|
|
Packit |
971217 |
gint kt2;
|
|
Packit |
971217 |
gint xoffset;
|
|
Packit |
971217 |
gint yoffset;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* solid color */
|
|
Packit |
971217 |
guint foreground_color;
|
|
Packit |
971217 |
guint background_color;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* moving color bars */
|
|
Packit |
971217 |
gint horizontal_offset;
|
|
Packit |
971217 |
gint horizontal_speed;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* smpte & snow */
|
|
Packit |
971217 |
guint random_state;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* Ball motion */
|
|
Packit |
971217 |
GstVideoTestSrcAnimationMode animation_mode;
|
|
Packit |
971217 |
GstVideoTestSrcMotionType motion_type;
|
|
Packit |
971217 |
gboolean flip;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
void (*make_image) (GstVideoTestSrc *v, GstClockTime pts, GstVideoFrame *frame);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* temporary AYUV/ARGB scanline */
|
|
Packit |
971217 |
guint8 *tmpline_u8;
|
|
Packit |
971217 |
guint8 *tmpline;
|
|
Packit |
971217 |
guint8 *tmpline2;
|
|
Packit |
971217 |
guint16 *tmpline_u16;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
guint n_lines;
|
|
Packit |
971217 |
gint offset;
|
|
Packit |
971217 |
gpointer *lines;
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
struct _GstVideoTestSrcClass {
|
|
Packit |
971217 |
GstPushSrcClass parent_class;
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GType gst_video_test_src_get_type (void);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_END_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif /* __GST_VIDEO_TEST_SRC_H__ */
|