gstcollectpads.h   gstcollectpads.h 
skipping to change at line 29 skipping to change at line 29
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_COLLECT_PADS_H__ #ifndef __GST_COLLECT_PADS_H__
#define __GST_COLLECT_PADS_H__ #define __GST_COLLECT_PADS_H__
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_COLLECT_PADS (gst_collect_pads_get_type( #define GST_TYPE_COLLECT_PADS (gst_collect_pads_get_type())
)) #define GST_COLLECT_PADS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),
#define GST_COLLECT_PADS(obj) (G_TYPE_CHECK_INSTANCE_CAST GST_TYPE_COLLECT_PADS,GstCollectPads))
((obj),GST_TYPE_COLLECT_PADS,GstCollectPads)) #define GST_COLLECT_PADS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),G
#define GST_COLLECT_PADS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GS ST_TYPE_COLLECT_PADS,GstCollectPadsClass))
T_TYPE_COLLECT_PADS,GstCollectPadsClass))
#define GST_COLLECT_PADS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_COLLECT_PADS,GstCollectPadsClass)) #define GST_COLLECT_PADS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_COLLECT_PADS,GstCollectPadsClass))
#define GST_IS_COLLECT_PADS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),G ST_TYPE_COLLECT_PADS)) #define GST_IS_COLLECT_PADS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_COLLECT_PADS))
#define GST_IS_COLLECT_PADS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),G ST_TYPE_COLLECT_PADS)) #define GST_IS_COLLECT_PADS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),G ST_TYPE_COLLECT_PADS))
typedef struct _GstCollectData GstCollectData; typedef struct _GstCollectData GstCollectData;
typedef struct _GstCollectPads GstCollectPads; typedef struct _GstCollectPads GstCollectPads;
typedef struct _GstCollectPadsPrivate GstCollectPadsPrivate;
typedef struct _GstCollectPadsClass GstCollectPadsClass; typedef struct _GstCollectPadsClass GstCollectPadsClass;
/** /**
* GstCollectDataDestroyNotify: * GstCollectDataDestroyNotify:
* @data: the #GstCollectData that will be freed * @data: the #GstCollectData that will be freed
* *
* A function that will be called when the #GstCollectData will be freed. * A function that will be called when the #GstCollectData will be freed.
* It is passed the pointer to the structure and should free any custom * It is passed the pointer to the structure and should free any custom
* memory and resources allocated for it. * memory and resources allocated for it.
* *
* Since: 0.10.12 * Since: 0.10.12
*/ */
typedef void (*GstCollectDataDestroyNotify) (GstCollectData *data); typedef void (*GstCollectDataDestroyNotify) (GstCollectData *data);
/** /**
* GstCollectPadsClipFunction:
* @pads: a #GstCollectPads
* @data: a #GstCollectData
* @buffer: a #GstBuffer
* @user_data: user data
*
* A function that will be called when @buffer is received on the pad manag
ed
* by @data in the collecpad object @pads.
*
* The function should use the segment of @data and the negotiated media ty
pe on
* the pad to perform clipping of @buffer.
*
* This function takes ownership of @buffer.
*
* Returns: a #GstBuffer that contains the clipped data of @buffer or NULL
when
* the buffer has been clipped completely.
*
* Since: 0.10.26
*/
typedef GstBuffer * (*GstCollectPadsClipFunction) (GstCollectPads *pads, Gs
tCollectData *data,
GstBuffer *buffer, gpoin
ter user_data);
/**
* GstCollectData: * GstCollectData:
* @collect: owner #GstCollectPads * @collect: owner #GstCollectPads
* @pad: #GstPad managed by this data * @pad: #GstPad managed by this data
* @buffer: currently queued buffer. * @buffer: currently queued buffer.
* @pos: position in the buffer * @pos: position in the buffer
* @segment: last segment received. * @segment: last segment received.
* *
* Structure used by the collect_pads. * Structure used by the collect_pads.
*/ */
struct _GstCollectData struct _GstCollectData
{ {
/* with LOCK of @collect */ /* with LOCK of @collect */
GstCollectPads *collect; GstCollectPads *collect;
GstPad *pad; GstPad *pad;
GstBuffer *buffer; GstBuffer *buffer;
guint pos; guint pos;
GstSegment segment; GstSegment segment;
/*< private >*/ /*< private >*/
union { union {
struct { struct {
gboolean flushing; gboolean flushing;
gboolean new_segment; gboolean new_segment;
gboolean eos; gboolean eos;
gint refcount; gint refcount;
} ABI; } ABI;
skipping to change at line 109 skipping to change at line 133
#define GST_COLLECT_PADS_GET_COND(pads) (((GstCollectPads *)pads)->cond) #define GST_COLLECT_PADS_GET_COND(pads) (((GstCollectPads *)pads)->cond)
#define GST_COLLECT_PADS_WAIT(pads) (g_cond_wait (GST_COLLECT_PADS_GET_ COND (pads), GST_OBJECT_GET_LOCK (pads))) #define GST_COLLECT_PADS_WAIT(pads) (g_cond_wait (GST_COLLECT_PADS_GET_ COND (pads), GST_OBJECT_GET_LOCK (pads)))
#define GST_COLLECT_PADS_SIGNAL(pads) (g_cond_signal (GST_COLLECT_PADS_GE T_COND (pads))) #define GST_COLLECT_PADS_SIGNAL(pads) (g_cond_signal (GST_COLLECT_PADS_GE T_COND (pads)))
#define GST_COLLECT_PADS_BROADCAST(pads)(g_cond_broadcast (GST_COLLECT_PADS _GET_COND (pads))) #define GST_COLLECT_PADS_BROADCAST(pads)(g_cond_broadcast (GST_COLLECT_PADS _GET_COND (pads)))
/** /**
* GstCollectPads: * GstCollectPads:
* @data: #GList of #GstCollectData managed by this #GstCollectPads. * @data: #GList of #GstCollectData managed by this #GstCollectPads.
* *
* Collectpads object. * Collectpads object.
* Note that @data is only reliable for iterating the list of #GstCollectDa
ta
* when inside the #GstCollectPadsFunction callback.
*/ */
struct _GstCollectPads { struct _GstCollectPads {
GstObject object; GstObject object;
/*< public >*/ /* with LOCK */ /*< public >*/ /* with LOCK */
GSList *data; /* list of CollectData items */ GSList *data; /* list of CollectData items */
/*< private >*/ /*< private >*/
guint32 cookie; /* @data list cookie */ guint32 cookie; /* @data list cookie */
/* with LOCK */ /* with LOCK */
GCond *cond; /* to signal removal of data */ GCond *cond; /* to signal removal of data */
GstCollectPadsFunction func; /* function and user_data for callba GstCollectPadsFunction func; /* function and user_data for callb
ck */ ack */
gpointer user_data; gpointer user_data;
guint numpads; /* number of pads in @data * guint numpads; /* number of pads in @data */
/ guint queuedpads; /* number of pads with a buffer */
guint queuedpads; /* number of pads with a buf guint eospads; /* number of pads that are EOS */
fer */
guint eospads; /* number of pads that are E
OS */
/* with LOCK and PAD_LOCK*/ /* with LOCK and PAD_LOCK*/
gboolean started; gboolean started;
/*< private >*/ /*< private >*/
union { union {
struct { struct {
/* since 0.10.6 */ /* with PAD_LOCK */ /* since 0.10.6 */ /* with PAD_LOCK */
GMutex *pad_lock; /* used to serialize add/remove */ GMutex *pad_lock; /* used to serialize add/remove */
GSList *pad_list; /* updated pad list */ GSList *pad_list; /* updated pad list */
guint32 pad_cookie; /* updated cookie */ guint32 pad_cookie; /* updated cookie */
GstCollectPadsPrivate *priv;
} ABI; } ABI;
/* adding + 0 to mark ABI change to be undone later */ /* adding + 0 to mark ABI change to be undone later */
gpointer _gst_reserved[GST_PADDING + 0]; gpointer _gst_reserved[GST_PADDING + 0];
} abidata; } abidata;
}; };
struct _GstCollectPadsClass { struct _GstCollectPadsClass {
GstObjectClass parent_class; GstObjectClass parent_class;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_collect_pads_get_type(void); GType gst_collect_pads_get_type(void);
/* creating the object */ /* creating the object */
GstCollectPads* gst_collect_pads_new (void); GstCollectPads* gst_collect_pads_new (void);
/* set the callback */ /* set the callbacks */
void gst_collect_pads_set_function (GstCollectPads *pads, GstCo void gst_collect_pads_set_function (GstCollectPads *pads, G
llectPadsFunction func, stCollectPadsFunction func,
gpointer user_data); gpointer user_data);
void gst_collect_pads_set_clip_function (GstCollectPads *pads, G
stCollectPadsClipFunction clipfunc,
gpointer user_data);
/* pad management */ /* pad management */
GstCollectData* gst_collect_pads_add_pad (GstCollectPads *pad s, GstPad *pad, guint size); GstCollectData* gst_collect_pads_add_pad (GstCollectPads *pads, GstP ad *pad, guint size);
GstCollectData* gst_collect_pads_add_pad_full (GstCollectPads *pads, GstP ad *pad, guint size, GstCollectDataDestroyNotify destroy_notify); GstCollectData* gst_collect_pads_add_pad_full (GstCollectPads *pads, GstP ad *pad, guint size, GstCollectDataDestroyNotify destroy_notify);
gboolean gst_collect_pads_remove_pad (GstCollectPads *pads, GstPa
d *pad); gboolean gst_collect_pads_remove_pad (GstCollectPads *pads, GstP
gboolean gst_collect_pads_is_active (GstCollectPads *pads, GstPa ad *pad);
d *pad); gboolean gst_collect_pads_is_active (GstCollectPads *pads, GstP
ad *pad);
/* start/stop collection */ /* start/stop collection */
GstFlowReturn gst_collect_pads_collect (GstCollectPads *pads); GstFlowReturn gst_collect_pads_collect (GstCollectPads *pads);
GstFlowReturn gst_collect_pads_collect_range (GstCollectPads *pads, guint GstFlowReturn gst_collect_pads_collect_range (GstCollectPads *pads, guin
64 offset, guint length); t64 offset, guint length);
void gst_collect_pads_start (GstCollectPads *pads); void gst_collect_pads_start (GstCollectPads *pads);
void gst_collect_pads_stop (GstCollectPads *pads); void gst_collect_pads_stop (GstCollectPads *pads);
void gst_collect_pads_set_flushing (GstCollectPads *pads, gbool void gst_collect_pads_set_flushing (GstCollectPads *pads, gboo
ean flushing); lean flushing);
/* get collected buffers */ /* get collected buffers */
GstBuffer* gst_collect_pads_peek (GstCollectPads *pads, GstCo GstBuffer* gst_collect_pads_peek (GstCollectPads *pads, GstC
llectData *data); ollectData *data);
GstBuffer* gst_collect_pads_pop (GstCollectPads *pads, GstCo GstBuffer* gst_collect_pads_pop (GstCollectPads *pads, GstC
llectData *data); ollectData *data);
/* get collected bytes */ /* get collected bytes */
guint gst_collect_pads_available (GstCollectPads *pads); guint gst_collect_pads_available (GstCollectPads *pads);
guint gst_collect_pads_read (GstCollectPads *pads, GstCo guint gst_collect_pads_read (GstCollectPads *pads, GstC
llectData *data, ollectData *data,
guint8 **bytes, guint size) guint8 **bytes, guint size
; );
GstBuffer * gst_collect_pads_read_buffer (GstCollectPads * pads, GstBuffer * gst_collect_pads_read_buffer (GstCollectPads * pads, Gst
GstCollectData * data, CollectData * data,
guint size); guint size);
GstBuffer * gst_collect_pads_take_buffer (GstCollectPads * pads, GstBuffer * gst_collect_pads_take_buffer (GstCollectPads * pads, Gst
GstCollectData * data, CollectData * data,
guint size); guint size);
guint gst_collect_pads_flush (GstCollectPads *pads, GstCo guint gst_collect_pads_flush (GstCollectPads *pads, GstC
llectData *data, ollectData *data,
guint size); guint size);
G_END_DECLS G_END_DECLS
#endif /* __GST_COLLECT_PADS_H__ */ #endif /* __GST_COLLECT_PADS_H__ */
 End of changes. 22 change blocks. 
61 lines changed or deleted 94 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/