Commit bf6a2f9a authored by Stefan Sauer's avatar Stefan Sauer

autodetect: use a common baseclass

This makes the actual elements super simple. We're using the ELEMENT_FLAG to
configure source/sink and a string for the Audio/Video type.
parent 62f5a274
This diff is collapsed.
......@@ -21,6 +21,7 @@
#define __GST_AUTO_AUDIO_SINK_H__
#include <gst/gst.h>
#include "gstautodetect.h"
G_BEGIN_DECLS
......@@ -38,18 +39,13 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_AUDIO_SINK))
typedef struct _GstAutoAudioSink {
GstBin parent;
GstAutoDetect parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
GstClockTimeDiff ts_offset;
gboolean sync;
} GstAutoAudioSink;
typedef struct _GstAutoAudioSinkClass {
GstBinClass parent_class;
GstAutoDetectClass parent_class;
} GstAutoAudioSinkClass;
GType gst_auto_audio_sink_get_type (void);
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
#define __GST_AUTO_AUDIO_SRC_H__
#include <gst/gst.h>
#include "gstautodetect.h"
G_BEGIN_DECLS
......@@ -39,16 +40,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_AUDIO_SRC))
typedef struct _GstAutoAudioSrc {
GstBin parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
GstAutoDetect parent;
} GstAutoAudioSrc;
typedef struct _GstAutoAudioSrcClass {
GstBinClass parent_class;
GstAutoDetectClass parent_class;
} GstAutoAudioSrcClass;
GType gst_auto_audio_src_get_type (void);
......
This diff is collapsed.
......@@ -20,11 +20,52 @@
#ifndef __GST_AUTO_DETECT_H__
#define __GST_AUTO_DETECT_H__
G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN (autodetect_debug);
#define GST_CAT_DEFAULT autodetect_debug
GstElement * gst_auto_create_element_with_pretty_name (
GstElement * autodetect, GstElementFactory * factory, const gchar *suffix);
#define GST_TYPE_AUTO_DETECT (gst_auto_detect_get_type ())
#define GST_AUTO_DETECT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AUTO_DETECT, GstAutoDetect))
#define GST_AUTO_DETECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_AUTO_DETECT, GstAutoDetectClass))
#define GST_IS_AUTO_DETECT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AUTO_DETECT))
#define GST_IS_AUTO_DETECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_DETECT))
#define GST_AUTO_DETECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AUTO_DETECT, GstAutoDetectClass))
typedef struct _GstAutoDetect {
GstBin parent;
/* configuration for subclasses */
const gchar *media_klass; /* Audio/Video/... */
GstElementFlags flag; /* GST_ELEMENT_FLAG_{SINK/SOURCE} */
/* explicit pointers to stuff used */
GstPad *pad;
GstCaps *filter_caps;
gboolean sync;
/* < private > */
GstElement *kid;
const gchar *type_klass; /* Source/Sink */
const gchar *media_klass_lc, *type_klass_lc; /* lower case versions */
} GstAutoDetect;
typedef struct _GstAutoDetectClass {
GstBinClass parent_class;
/*< public >*/
/* virtual methods for subclasses */
void (*configure)(GstAutoDetect *self, GstElement *kid);
} GstAutoDetectClass;
GType gst_auto_detect_get_type (void);
G_END_DECLS
#endif /* __GST_AUTO_DETECT_H__ */
This diff is collapsed.
......@@ -21,6 +21,7 @@
#define __GST_AUTO_VIDEO_SINK_H__
#include <gst/gst.h>
#include "gstautodetect.h"
G_BEGIN_DECLS
......@@ -38,18 +39,13 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_VIDEO_SINK))
typedef struct _GstAutoVideoSink {
GstBin parent;
GstAutoDetect parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
GstClockTimeDiff ts_offset;
gboolean sync;
} GstAutoVideoSink;
typedef struct _GstAutoVideoSinkClass {
GstBinClass parent_class;
GstAutoDetectClass parent_class;
} GstAutoVideoSinkClass;
GType gst_auto_video_sink_get_type (void);
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
#define __GST_AUTO_VIDEO_SRC_H__
#include <gst/gst.h>
#include "gstautodetect.h"
G_BEGIN_DECLS
......@@ -39,16 +40,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_VIDEO_SRC))
typedef struct _GstAutoVideoSrc {
GstBin parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
GstAutoDetect parent;
} GstAutoVideoSrc;
typedef struct _GstAutoVideoSrcClass {
GstBinClass parent_class;
GstAutoDetectClass parent_class;
} GstAutoVideoSrcClass;
GType gst_auto_video_src_get_type (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment