Blame gst-libs/gst/rtp/gstrtpbasedepayload.h

Packit 0652a1
/* GStreamer
Packit 0652a1
 * Copyright (C) <2005> Philippe Khalaf <burger@speedy.org>
Packit 0652a1
 *
Packit 0652a1
 * This library is free software; you can redistribute it and/or
Packit 0652a1
 * modify it under the terms of the GNU Library General Public
Packit 0652a1
 * License as published by the Free Software Foundation; either
Packit 0652a1
 * version 2 of the License, or (at your option) any later version.
Packit 0652a1
 *
Packit 0652a1
 * This library is distributed in the hope that it will be useful,
Packit 0652a1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0652a1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 0652a1
 * Library General Public License for more details.
Packit 0652a1
 *
Packit 0652a1
 * You should have received a copy of the GNU Library General Public
Packit 0652a1
 * License along with this library; if not, write to the
Packit 0652a1
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 0652a1
 * Boston, MA 02110-1301, USA.
Packit 0652a1
 */
Packit 0652a1
Packit 0652a1
#ifndef __GST_RTP_BASE_DEPAYLOAD_H__
Packit 0652a1
#define __GST_RTP_BASE_DEPAYLOAD_H__
Packit 0652a1
Packit 0652a1
#include <gst/gst.h>
Packit 0652a1
#include <gst/rtp/gstrtpbuffer.h>
Packit 0652a1
Packit 0652a1
G_BEGIN_DECLS
Packit 0652a1
Packit 0652a1
#define GST_TYPE_RTP_BASE_DEPAYLOAD (gst_rtp_base_depayload_get_type())
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD(obj) \
Packit 0652a1
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayload))
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD_CLASS(klass) \
Packit 0652a1
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD_GET_CLASS(obj) \
Packit 0652a1
        (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
Packit 0652a1
#define GST_IS_RTP_BASE_DEPAYLOAD(obj) \
Packit 0652a1
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_DEPAYLOAD))
Packit 0652a1
#define GST_IS_RTP_BASE_DEPAYLOAD_CLASS(klass) \
Packit 0652a1
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_DEPAYLOAD))
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD_CAST(obj) ((GstRTPBaseDepayload *)(obj))
Packit 0652a1
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD_SINKPAD(depayload) (GST_RTP_BASE_DEPAYLOAD_CAST (depayload)->sinkpad)
Packit 0652a1
#define GST_RTP_BASE_DEPAYLOAD_SRCPAD(depayload)  (GST_RTP_BASE_DEPAYLOAD_CAST (depayload)->srcpad)
Packit 0652a1
Packit 0652a1
typedef struct _GstRTPBaseDepayload      GstRTPBaseDepayload;
Packit 0652a1
typedef struct _GstRTPBaseDepayloadClass GstRTPBaseDepayloadClass;
Packit 0652a1
typedef struct _GstRTPBaseDepayloadPrivate GstRTPBaseDepayloadPrivate;
Packit 0652a1
Packit 0652a1
struct _GstRTPBaseDepayload
Packit 0652a1
{
Packit 0652a1
  GstElement parent;
Packit 0652a1
Packit 0652a1
  GstPad *sinkpad, *srcpad;
Packit 0652a1
Packit 0652a1
  /* this attribute must be set by the child */
Packit 0652a1
  guint clock_rate;
Packit 0652a1
Packit 0652a1
  GstSegment segment;
Packit 0652a1
  gboolean need_newsegment;
Packit 0652a1
Packit 0652a1
  /*< private >*/
Packit 0652a1
  GstRTPBaseDepayloadPrivate *priv;
Packit 0652a1
Packit 0652a1
  gpointer _gst_reserved[GST_PADDING];
Packit 0652a1
};
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstRTPBaseDepayloadClass:
Packit 0652a1
 * @parent_class: the parent class
Packit 0652a1
 * @set_caps: configure the depayloader
Packit 0652a1
 * @process: process incoming rtp packets. Subclass must implement either
Packit 0652a1
 *   this method or @process_rtp_packet to process incoming rtp packets.
Packit 0652a1
 *   If the child returns a buffer without a valid timestamp, the timestamp
Packit 0652a1
 *   of the provided buffer will be applied to the result buffer and the
Packit 0652a1
 *   buffer will be pushed. If this function returns %NULL, nothing is pushed.
Packit 0652a1
 * @packet_lost: signal the depayloader about packet loss
Packit 0652a1
 * @handle_event: custom event handling
Packit 0652a1
 * @process_rtp_packet: Same as the process virtual function, but slightly more
Packit 0652a1
 * efficient, since it is passed the rtp buffer structure that has already
Packit 0652a1
 * been mapped (with GST_MAP_READ) by the base class and thus does not have
Packit 0652a1
 * to be mapped again by the subclass. Can be used by the subclass to process
Packit 0652a1
 * incoming rtp packets. If the subclass returns a buffer without a valid
Packit 0652a1
 * timestamp, the timestamp of the input buffer will be applied to the result
Packit 0652a1
 * buffer and the output buffer will be pushed out. If this function returns
Packit 0652a1
 * %NULL, nothing is pushed out. Since: 1.6.
Packit 0652a1
 *
Packit 0652a1
 * Base class for RTP depayloaders.
Packit 0652a1
 */
Packit 0652a1
struct _GstRTPBaseDepayloadClass
Packit 0652a1
{
Packit 0652a1
  GstElementClass parent_class;
Packit 0652a1
Packit 0652a1
  /*< public >*/
Packit 0652a1
  /* virtuals, inform the subclass of the caps. */
Packit 0652a1
  gboolean (*set_caps) (GstRTPBaseDepayload *filter, GstCaps *caps);
Packit 0652a1
Packit 0652a1
  /* pure virtual function */
Packit 0652a1
  GstBuffer * (*process) (GstRTPBaseDepayload *base, GstBuffer *in);
Packit 0652a1
Packit 0652a1
  /* non-pure function used to to signal the depayloader about packet loss. the
Packit 0652a1
   * timestamp and duration are the estimated values of the lost packet.
Packit 0652a1
   * The default implementation of this message pushes a segment update. */
Packit 0652a1
  gboolean (*packet_lost) (GstRTPBaseDepayload *filter, GstEvent *event);
Packit 0652a1
Packit 0652a1
  /* the default implementation does the default actions for events but
Packit 0652a1
   * implementation can override. */
Packit 0652a1
  gboolean (*handle_event) (GstRTPBaseDepayload * filter, GstEvent * event);
Packit 0652a1
Packit 0652a1
  GstBuffer * (*process_rtp_packet) (GstRTPBaseDepayload *base, GstRTPBuffer * rtp_buffer);
Packit 0652a1
Packit 0652a1
  /*< private >*/
Packit 0652a1
  gpointer _gst_reserved[GST_PADDING - 1];
Packit 0652a1
};
Packit 0652a1
Packit 0652a1
GST_RTP_API
Packit 0652a1
GType gst_rtp_base_depayload_get_type (void);
Packit 0652a1
Packit 0652a1
GST_RTP_API
Packit 0652a1
GstFlowReturn   gst_rtp_base_depayload_push       (GstRTPBaseDepayload *filter, GstBuffer *out_buf);
Packit 0652a1
Packit 0652a1
GST_RTP_API
Packit 0652a1
GstFlowReturn   gst_rtp_base_depayload_push_list  (GstRTPBaseDepayload *filter, GstBufferList *out_list);
Packit 0652a1
Packit 0652a1
GST_RTP_API
Packit 0652a1
gboolean        gst_rtp_base_depayload_is_source_info_enabled  (GstRTPBaseDepayload * depayload);
Packit 0652a1
Packit 0652a1
GST_RTP_API
Packit 0652a1
void            gst_rtp_base_depayload_set_source_info_enabled (GstRTPBaseDepayload * depayload,
Packit 0652a1
                                                                gboolean enable);
Packit 0652a1
Packit 0652a1
Packit 0652a1
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit 0652a1
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTPBaseDepayload, gst_object_unref)
Packit 0652a1
#endif
Packit 0652a1
Packit 0652a1
G_END_DECLS
Packit 0652a1
Packit 0652a1
#endif /* __GST_RTP_BASE_DEPAYLOAD_H__ */