2008-03-29 00:45:18 +00:00
|
|
|
/*
|
|
|
|
* Farsight Voice+Video library
|
|
|
|
*
|
|
|
|
* Copyright 2008 Collabora Ltd
|
|
|
|
* Copyright 2008 Nokia Corporation
|
|
|
|
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
|
|
|
|
*
|
|
|
|
* 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_LIVE_ADDER_H__
|
|
|
|
#define __GST_LIVE_ADDER_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define GST_TYPE_LIVE_ADDER (gst_live_adder_get_type())
|
|
|
|
#define GST_LIVE_ADDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LIVE_ADDER,GstLiveAdder))
|
|
|
|
#define GST_IS_LIVE_ADDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LIVE_ADDER))
|
|
|
|
#define GST_LIVE_ADDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_LIVE_ADDER,GstLiveAdderClass))
|
|
|
|
#define GST_IS_LIVE_ADDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_LIVE_ADDER))
|
|
|
|
#define GST_LIVE_ADDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_LIVE_ADDER,GstLiveAdderClass))
|
2009-02-10 16:18:32 +00:00
|
|
|
typedef struct _GstLiveAdder GstLiveAdder;
|
|
|
|
typedef struct _GstLiveAdderClass GstLiveAdderClass;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2008-03-29 00:45:18 +00:00
|
|
|
GST_LIVE_ADDER_FORMAT_UNSET,
|
|
|
|
GST_LIVE_ADDER_FORMAT_INT,
|
|
|
|
GST_LIVE_ADDER_FORMAT_FLOAT
|
|
|
|
} GstLiveAdderFormat;
|
|
|
|
|
|
|
|
typedef void (*GstLiveAdderFunction) (gpointer out, gpointer in, guint size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLiveAdder:
|
|
|
|
*
|
|
|
|
* The adder object structure.
|
|
|
|
*/
|
2009-02-10 16:18:32 +00:00
|
|
|
struct _GstLiveAdder
|
|
|
|
{
|
2009-02-10 18:46:03 +00:00
|
|
|
/*< private >*/
|
2009-02-10 16:18:32 +00:00
|
|
|
GstElement element;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
GstPad *srcpad;
|
2008-03-29 00:45:18 +00:00
|
|
|
/* pad counter, used for creating unique request pads */
|
2009-02-10 16:18:32 +00:00
|
|
|
gint padcount;
|
|
|
|
GList *sinkpads;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
GstFlowReturn srcresult;
|
|
|
|
GstClockID clock_id;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
/* the queue is ordered head to tail */
|
2009-02-10 16:18:32 +00:00
|
|
|
GQueue *buffers;
|
|
|
|
GCond *not_empty_cond;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
GstClockTime next_timestamp;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
/* the next are valid for both int and float */
|
2009-02-10 16:18:32 +00:00
|
|
|
GstLiveAdderFormat format;
|
|
|
|
gint rate;
|
|
|
|
gint channels;
|
|
|
|
gint width;
|
|
|
|
gint endianness;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
/* the next are valid only for format == GST_LIVE_ADDER_FORMAT_INT */
|
2009-02-10 16:18:32 +00:00
|
|
|
gint depth;
|
|
|
|
gboolean is_signed;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
/* number of bytes per sample, actually width/8 * channels */
|
2009-02-10 16:18:32 +00:00
|
|
|
gint bps;
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
/* function to add samples */
|
|
|
|
GstLiveAdderFunction func;
|
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
GstClockTime latency_ms;
|
|
|
|
GstClockTime peer_latency;
|
2008-03-31 18:44:21 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
gboolean segment_pending;
|
2008-05-14 23:49:48 +00:00
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
gboolean playing;
|
2008-03-29 00:45:18 +00:00
|
|
|
};
|
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
struct _GstLiveAdderClass
|
|
|
|
{
|
2008-03-29 00:45:18 +00:00
|
|
|
GstElementClass parent_class;
|
|
|
|
};
|
|
|
|
|
2009-02-10 16:18:32 +00:00
|
|
|
GType gst_live_adder_get_type (void);
|
2008-03-29 00:45:18 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GST_LIVE_ADDER_H__ */
|