gstrtpbin.h 4.33 KB
Newer Older
1
/* GStreamer
2
 * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
3 4 5 6 7 8 9 10 11 12 13 14 15
 *
 * 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
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
16 17
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
18 19 20 21 22 23 24
 */

#ifndef __GST_RTP_BIN_H__
#define __GST_RTP_BIN_H__

#include <gst/gst.h>

25
#include "rtpsession.h"
26
#include "rtpjitterbuffer.h"
27

28 29 30
#define GST_TYPE_RTP_BIN \
  (gst_rtp_bin_get_type())
#define GST_RTP_BIN(obj) \
31
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BIN,GstRtpBin))
32
#define GST_RTP_BIN_CLASS(klass) \
33
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BIN,GstRtpBinClass))
34 35 36 37 38
#define GST_IS_RTP_BIN(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BIN))
#define GST_IS_RTP_BIN_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BIN))

39 40 41 42 43 44 45
typedef enum
{
  GST_RTP_BIN_RTCP_SYNC_ALWAYS,
  GST_RTP_BIN_RTCP_SYNC_INITIAL,
  GST_RTP_BIN_RTCP_SYNC_RTP
} GstRTCPSync;

46 47 48
typedef struct _GstRtpBin GstRtpBin;
typedef struct _GstRtpBinClass GstRtpBinClass;
typedef struct _GstRtpBinPrivate GstRtpBinPrivate;
49

50
struct _GstRtpBin {
51
  GstBin         bin;
52

Wim Taymans's avatar
Wim Taymans committed
53
  /*< private >*/
54
  /* default latency for sessions */
55 56
  guint           latency_ms;
  guint64         latency_ns;
57
  gboolean        drop_on_latency;
58
  gboolean        do_lost;
Marc Leeman's avatar
Marc Leeman committed
59
  gboolean        ignore_pt;
Wim Taymans's avatar
Wim Taymans committed
60
  gboolean        ntp_sync;
61
  gint            rtcp_sync;
62
  guint           rtcp_sync_interval;
63
  RTPJitterBufferMode buffer_mode;
Wim Taymans's avatar
Wim Taymans committed
64
  gboolean        buffering;
65
  gboolean        use_pipeline_clock;
66
  gboolean        send_sync_event;
67
  GstClockTime    buffer_start;
68
  gboolean        do_retransmission;
69 70
  GstRTPProfile   rtp_profile;

71
  /* a list of session */
72
  GSList         *sessions;
73

74 75 76
  /* a list of clients, these are streams with the same CNAME */
  GSList         *clients;

77
  /* the default SDES items for sessions */
Wim Taymans's avatar
Wim Taymans committed
78
  GstStructure   *sdes;
79

80
  /*< private >*/
81
  GstRtpBinPrivate *priv;
82 83
};

84
struct _GstRtpBinClass {
85
  GstBinClass  parent_class;
86 87

  /* get the caps for pt */
88 89
  GstCaps*    (*request_pt_map)       (GstRtpBin *rtpbin, guint session, guint pt);

90 91
  void        (*payload_type_change)  (GstRtpBin *rtpbin, guint session, guint pt);

92
  void        (*new_jitterbuffer)     (GstRtpBin *rtpbin, GstElement *jitterbuffer, guint session, guint32 ssrc);
93

94 95
  /* action signals */
  void        (*clear_pt_map)         (GstRtpBin *rtpbin);
96
  void        (*reset_sync)           (GstRtpBin *rtpbin);
97
  RTPSession* (*get_internal_session) (GstRtpBin *rtpbin, guint session);
98

99
  /* session manager signals */
100 101 102
  void     (*on_new_ssrc)       (GstRtpBin *rtpbin, guint session, guint32 ssrc);
  void     (*on_ssrc_collision) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
  void     (*on_ssrc_validated) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
103
  void     (*on_ssrc_active)    (GstRtpBin *rtpbin, guint session, guint32 ssrc);
104
  void     (*on_ssrc_sdes)      (GstRtpBin *rtpbin, guint session, guint32 ssrc);
105 106 107
  void     (*on_bye_ssrc)       (GstRtpBin *rtpbin, guint session, guint32 ssrc);
  void     (*on_bye_timeout)    (GstRtpBin *rtpbin, guint session, guint32 ssrc);
  void     (*on_timeout)        (GstRtpBin *rtpbin, guint session, guint32 ssrc);
108
  void     (*on_sender_timeout) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
Wim Taymans's avatar
Wim Taymans committed
109
  void     (*on_npt_stop)       (GstRtpBin *rtpbin, guint session, guint32 ssrc);
110 111 112 113 114

  GstElement* (*request_rtp_encoder)  (GstRtpBin *rtpbin, guint session);
  GstElement* (*request_rtp_decoder)  (GstRtpBin *rtpbin, guint session);
  GstElement* (*request_rtcp_encoder) (GstRtpBin *rtpbin, guint session);
  GstElement* (*request_rtcp_decoder) (GstRtpBin *rtpbin, guint session);
115 116 117

  GstElement* (*request_aux_sender)   (GstRtpBin *rtpbin, guint session);
  GstElement* (*request_aux_receiver) (GstRtpBin *rtpbin, guint session);
118 119 120 121 122
};

GType gst_rtp_bin_get_type (void);

#endif /* __GST_RTP_BIN_H__ */