queue2: Integrate into coreplugins

This commit is contained in:
Sebastian Dröge 2009-10-29 11:30:11 +01:00
parent 08e3cb531c
commit 40732dd308
4 changed files with 252 additions and 268 deletions

View file

@ -21,6 +21,7 @@ libgstcoreelements_la_SOURCES = \
gstfilesrc.c \ gstfilesrc.c \
gstidentity.c \ gstidentity.c \
gstqueue.c \ gstqueue.c \
gstqueue2.c \
gsttee.c \ gsttee.c \
gsttypefindelement.c \ gsttypefindelement.c \
gstmultiqueue.c gstmultiqueue.c
@ -42,6 +43,7 @@ noinst_HEADERS = \
gstfilesrc.h \ gstfilesrc.h \
gstidentity.h \ gstidentity.h \
gstqueue.h \ gstqueue.h \
gstqueue2.h \
gsttee.h \ gsttee.h \
gsttypefindelement.h \ gsttypefindelement.h \
gstmultiqueue.h gstmultiqueue.h

View file

@ -36,6 +36,7 @@
#include "gstfilesrc.h" #include "gstfilesrc.h"
#include "gstidentity.h" #include "gstidentity.h"
#include "gstqueue.h" #include "gstqueue.h"
#include "gstqueue2.h"
#include "gsttee.h" #include "gsttee.h"
#include "gsttypefindelement.h" #include "gsttypefindelement.h"
#include "gstmultiqueue.h" #include "gstmultiqueue.h"
@ -59,6 +60,7 @@ static struct _elements_entry _elements[] = {
{"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type}, {"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type},
{"identity", GST_RANK_NONE, gst_identity_get_type}, {"identity", GST_RANK_NONE, gst_identity_get_type},
{"queue", GST_RANK_NONE, gst_queue_get_type}, {"queue", GST_RANK_NONE, gst_queue_get_type},
{"queue2", GST_RANK_NONE, gst_queue2_get_type},
{"filesink", GST_RANK_PRIMARY, gst_file_sink_get_type}, {"filesink", GST_RANK_PRIMARY, gst_file_sink_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type}, {"tee", GST_RANK_NONE, gst_tee_get_type},
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type}, {"typefind", GST_RANK_NONE, gst_type_find_element_get_type},

File diff suppressed because it is too large Load diff

View file

@ -28,24 +28,33 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_QUEUE \ #define GST_TYPE_QUEUE2 \
(gst_queue_get_type()) (gst_queue2_get_type())
#define GST_QUEUE(obj) \ #define GST_QUEUE2(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QUEUE,GstQueue)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QUEUE2,GstQueue2))
#define GST_QUEUE_CLASS(klass) \ #define GST_QUEUE2_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QUEUE,GstQueueClass)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QUEUE2,GstQueue2Class))
#define GST_IS_QUEUE(obj) \ #define GST_IS_QUEUE2(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE2))
#define GST_IS_QUEUE_CLASS(klass) \ #define GST_IS_QUEUE2_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE2))
#define GST_QUEUE_CAST(obj) \ #define GST_QUEUE2_CAST(obj) \
((GstQueue *)(obj)) ((GstQueue2 *)(obj))
typedef struct _GstQueue GstQueue; typedef struct _GstQueue2 GstQueue2;
typedef struct _GstQueueSize GstQueueSize; typedef struct _GstQueue2Size GstQueue2Size;
typedef struct _GstQueueClass GstQueueClass; typedef struct _GstQueue2Class GstQueue2Class;
struct _GstQueue /* used to keep track of sizes (current and max) */
struct _GstQueue2Size
{
guint buffers;
guint bytes;
guint64 time;
guint64 rate_time;
};
struct _GstQueue2
{ {
GstElement element; GstElement element;
@ -65,8 +74,8 @@ struct _GstQueue
/* the queue of data we're keeping our hands on */ /* the queue of data we're keeping our hands on */
GQueue *queue; GQueue *queue;
GstQueueSize cur_level; /* currently in the queue */ GstQueue2Size cur_level; /* currently in the queue */
GstQueueSize max_level; /* max. amount of data allowed in the queue */ GstQueue2Size max_level; /* max. amount of data allowed in the queue */
gboolean use_buffering; gboolean use_buffering;
gboolean use_rate_estimate; gboolean use_rate_estimate;
GstClockTime buffering_interval; GstClockTime buffering_interval;
@ -111,11 +120,13 @@ struct _GstQueue
}; };
struct _GstQueueClass struct _GstQueue2Class
{ {
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_queue2_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_QUEUE2_H__ */ #endif /* __GST_QUEUE2_H__ */