gstfakesrc.h 3.16 KB
Newer Older
Erik Walthinsen's avatar
Erik Walthinsen committed
1
2
3
4
5
/* GStreamer
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
 *                    2000 Wim Taymans <wtay@chello.be>
 *
 * gstfakesrc.h: 
Erik Walthinsen's avatar
Erik Walthinsen committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 *
 * 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.
 */


#ifndef __GST_FAKESRC_H__
#define __GST_FAKESRC_H__


#include <config.h>
#include <gst/gst.h>

David I. Lehn's avatar
David I. Lehn committed
31
G_BEGIN_DECLS
Erik Walthinsen's avatar
Erik Walthinsen committed
32
33
34

GstElementDetails gst_fakesrc_details;

Wim Taymans's avatar
Wim Taymans committed
35
36
37
38
39
40
typedef enum {
  FAKESRC_FIRST_LAST_LOOP = 1,
  FAKESRC_LAST_FIRST_LOOP,
  FAKESRC_PING_PONG,
  FAKESRC_ORDERED_RANDOM,
  FAKESRC_RANDOM,
41
42
  FAKESRC_PATTERN_LOOP,
  FAKESRC_PING_PONG_PATTERN,
43
  FAKESRC_GET_ALWAYS_SUCEEDS
Wim Taymans's avatar
Wim Taymans committed
44
} GstFakeSrcOutputType;
Erik Walthinsen's avatar
Erik Walthinsen committed
45

46
47
48
typedef enum {
  FAKESRC_DATA_ALLOCATE = 1,
  FAKESRC_DATA_SUBBUFFER,
49
  FAKESRC_DATA_BUFFERPOOL
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
} GstFakeSrcDataType;

typedef enum {
  FAKESRC_SIZETYPE_NULL = 1,
  FAKESRC_SIZETYPE_FIXED,
  FAKESRC_SIZETYPE_RANDOM
} GstFakeSrcSizeType;

typedef enum {
  FAKESRC_FILLTYPE_NOTHING = 1,
  FAKESRC_FILLTYPE_NULL,
  FAKESRC_FILLTYPE_RANDOM,
  FAKESRC_FILLTYPE_PATTERN,
  FAKESRC_FILLTYPE_PATTERN_CONT
} GstFakeSrcFillType;

Erik Walthinsen's avatar
Erik Walthinsen committed
66
67
68
#define GST_TYPE_FAKESRC \
  (gst_fakesrc_get_type())
#define GST_FAKESRC(obj) \
69
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
Erik Walthinsen's avatar
Erik Walthinsen committed
70
#define GST_FAKESRC_CLASS(klass) \
71
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
Erik Walthinsen's avatar
Erik Walthinsen committed
72
#define GST_IS_FAKESRC(obj) \
73
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESRC))
Erik Walthinsen's avatar
Erik Walthinsen committed
74
#define GST_IS_FAKESRC_CLASS(obj) \
75
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
Erik Walthinsen's avatar
Erik Walthinsen committed
76
77
78
79
80

typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;

struct _GstFakeSrc {
81
  GstElement     element;
Erik Walthinsen's avatar
Erik Walthinsen committed
82

83
84
  gboolean 	 loop_based;
  gboolean 	 eos;
85

Wim Taymans's avatar
Wim Taymans committed
86
  GstFakeSrcOutputType output;
87
88
89
  GstFakeSrcDataType   data;
  GstFakeSrcSizeType   sizetype;
  GstFakeSrcFillType   filltype;
90

91
92
  guint 	 sizemin;
  guint 	 sizemax;
93
  GstBuffer 	*parent;
94
95
96
  guint 	 parentsize;
  guint 	 parentoffset;
  guint8 	 pattern_byte;
97
98
  gchar 	*pattern;
  GList 	*patternlist;
99
100
101
102
103
104
105
106
107
  gint64	 segment_start;
  gint64	 segment_end;
  gboolean	 segment_loop;
  gint 		 num_buffers;
  gint 		 rt_num_buffers; /* we are going to change this at runtime */
  guint64 	 buffer_count;
  gboolean 	 silent;
  gboolean 	 dump;
  gboolean 	 need_flush;
108
  GstBufferPool *pool;
109
110

  gchar		*last_message;
Erik Walthinsen's avatar
Erik Walthinsen committed
111
112
113
};

struct _GstFakeSrcClass {
114
  GstElementClass parent_class;
115
116

  /* signals */
David I. Lehn's avatar
David I. Lehn committed
117
  void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
Erik Walthinsen's avatar
Erik Walthinsen committed
118
119
};

120
GType gst_fakesrc_get_type(void);
Erik Walthinsen's avatar
Erik Walthinsen committed
121

122
123
gboolean gst_fakesrc_factory_init (GstElementFactory *factory);

David I. Lehn's avatar
David I. Lehn committed
124
G_END_DECLS
Erik Walthinsen's avatar
Erik Walthinsen committed
125
126

#endif /* __GST_FAKESRC_H__ */