2 * Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_BASE_RTP_PAYLOAD_H__
21 #define __GST_BASE_RTP_PAYLOAD_H__
27 #define GST_TYPE_BASE_RTP_PAYLOAD \
28 (gst_basertppayload_get_type())
29 #define GST_BASE_RTP_PAYLOAD(obj) \
30 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayload))
31 #define GST_BASE_RTP_PAYLOAD_CLASS(klass) \
32 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayloadClass))
33 #define GST_BASE_RTP_PAYLOAD_GET_CLASS(obj) \
34 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadClass))
35 #define GST_IS_BASE_RTP_PAYLOAD(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_PAYLOAD))
37 #define GST_IS_BASE_RTP_PAYLOAD_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_PAYLOAD))
39 #define GST_BASE_RTP_PAYLOAD_CAST(obj) \
40 ((GstBaseRTPPayload*)(obj))
42 typedef struct _GstBaseRTPPayload GstBaseRTPPayload;
43 typedef struct _GstBaseRTPPayloadPrivate GstBaseRTPPayloadPrivate;
44 typedef struct _GstBaseRTPPayloadClass GstBaseRTPPayloadClass;
47 * GST_BASE_RTP_PAYLOAD_SINKPAD:
48 * @payload: a #GstBaseRTPPayload
50 * Get access to the sinkpad of @payload.
52 #define GST_BASE_RTP_PAYLOAD_SINKPAD(payload) (GST_BASE_RTP_PAYLOAD (payload)->sinkpad)
54 * GST_BASE_RTP_PAYLOAD_SRCPAD:
55 * @payload: a #GstBaseRTPPayload
57 * Get access to the srcpad of @payload.
59 #define GST_BASE_RTP_PAYLOAD_SRCPAD(payload) (GST_BASE_RTP_PAYLOAD (payload)->srcpad)
62 * GST_BASE_RTP_PAYLOAD_PT:
63 * @payload: a #GstBaseRTPPayload
65 * Get access to the configured payload type of @payload.
67 #define GST_BASE_RTP_PAYLOAD_PT(payload) (GST_BASE_RTP_PAYLOAD (payload)->pt)
69 * GST_BASE_RTP_PAYLOAD_MTU:
70 * @payload: a #GstBaseRTPPayload
72 * Get access to the configured MTU of @payload.
74 #define GST_BASE_RTP_PAYLOAD_MTU(payload) (GST_BASE_RTP_PAYLOAD (payload)->mtu)
76 struct _GstBaseRTPPayload
84 /* FIXME 0.11: none of these GRands are used anymore, remove them */
112 GstBaseRTPPayloadPrivate *priv;
116 guint64 ptime; /* in ns */
117 guint64 ptime_multiple; /* in ns */
119 gpointer _gst_reserved[GST_PADDING - (sizeof(guint64)/sizeof(gpointer)) - 1];
124 * GstBaseRTPPayloadClass:
125 * @parent_class: the parent class
126 * @set_caps: configure the payloader
127 * @handle_buffer: process data
128 * @handle_event: custom event handling
129 * @get_caps: get desired caps
131 * Base class for audio RTP payloader.
133 struct _GstBaseRTPPayloadClass
135 GstElementClass parent_class;
137 /* receive caps on the sink pad, configure the payloader. */
138 gboolean (*set_caps) (GstBaseRTPPayload *payload, GstCaps *caps);
139 /* handle a buffer, perform 0 or more gst_basertppayload_push() on
140 * the RTP buffers. This function takes ownership of the buffer. */
141 GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
143 gboolean (*handle_event) (GstPad * pad, GstEvent * event);
144 GstCaps * (*get_caps) (GstBaseRTPPayload *payload, GstPad * pad);
147 gpointer _gst_reserved[GST_PADDING-2];
150 GType gst_basertppayload_get_type (void);
152 void gst_basertppayload_set_options (GstBaseRTPPayload *payload,
155 const gchar *encoding_name,
158 gboolean gst_basertppayload_set_outcaps (GstBaseRTPPayload *payload,
159 const gchar *fieldname, ...);
161 gboolean gst_basertppayload_is_filled (GstBaseRTPPayload *payload,
162 guint size, GstClockTime duration);
164 GstFlowReturn gst_basertppayload_push (GstBaseRTPPayload *payload,
167 GstFlowReturn gst_basertppayload_push_list (GstBaseRTPPayload *payload,
168 GstBufferList *list);
172 #endif /* __GST_BASE_RTP_PAYLOAD_H__ */