Commit 11de94f9 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/rtp/gstrtph263penc.*: Added configurable pt and ssrc, to be merged in the...

gst/rtp/gstrtph263penc.*: Added configurable pt and ssrc, to be merged in the caps or a base class...

Original commit message from CVS:
* gst/rtp/gstrtph263penc.c: (gst_rtph263penc_class_init),
(gst_rtph263penc_flush), (gst_rtph263penc_chain),
(gst_rtph263penc_set_property), (gst_rtph263penc_get_property):
* gst/rtp/gstrtph263penc.h:
Added configurable pt and ssrc, to be merged in the caps or
a base class...
parent 3cb47855
2005-08-19 Wim Taymans <wim@fluendo.com>
* gst/rtp/gstrtph263penc.c: (gst_rtph263penc_class_init),
(gst_rtph263penc_flush), (gst_rtph263penc_chain),
(gst_rtph263penc_set_property), (gst_rtph263penc_get_property):
* gst/rtp/gstrtph263penc.h:
Added configurable pt and ssrc, to be merged in the caps or
a base class...
2005-08-19 Wim Taymans <wim@fluendo.com>
 
* gst/rtp/gstrtph263pdec.c: (gst_rtph263pdec_init),
......
......@@ -37,12 +37,16 @@ enum
LAST_SIGNAL
};
#define DEFAULT_MTU 1024
#define DEFAULT_MTU 1024
#define DEFAULT_PT 96
#define DEFAULT_SSRC 0
enum
{
PROP_0,
PROP_MTU
PROP_MTU,
PROP_PT,
PROP_SSRC
};
static GstStaticPadTemplate gst_rtph263penc_sink_template =
......@@ -132,6 +136,14 @@ gst_rtph263penc_class_init (GstRtpH263PEncClass * klass)
g_param_spec_uint ("mtu", "MTU",
"Maximum size of one packet",
28, G_MAXUINT, DEFAULT_MTU, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
g_param_spec_uint ("pt", "payload type",
"The payload type of the packets",
0, 0x80, DEFAULT_PT, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
"The SSRC of the packets",
0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
gstelement_class->change_state = gst_rtph263penc_change_state;
}
......@@ -187,6 +199,9 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
outbuf = gst_rtpbuffer_new_allocate (payload_len, 0, 0);
gst_rtpbuffer_set_timestamp (outbuf,
rtph263penc->first_ts * 90000 / GST_SECOND);
gst_rtpbuffer_set_payload_type (outbuf, rtph263penc->pt);
gst_rtpbuffer_set_ssrc (outbuf, rtph263penc->ssrc);
gst_rtpbuffer_set_seq (outbuf, rtph263penc->seqnum++);
/* last fragment gets the marker bit set */
gst_rtpbuffer_set_marker (outbuf, avail > towrite ? 0 : 1);
......@@ -247,6 +262,12 @@ gst_rtph263penc_set_property (GObject * object, guint prop_id,
case PROP_MTU:
rtph263penc->mtu = g_value_get_uint (value);
break;
case PROP_PT:
rtph263penc->pt = g_value_get_uint (value);
break;
case PROP_SSRC:
rtph263penc->ssrc = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -265,6 +286,12 @@ gst_rtph263penc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_MTU:
g_value_set_uint (value, rtph263penc->mtu);
break;
case PROP_PT:
g_value_set_uint (value, rtph263penc->pt);
break;
case PROP_SSRC:
g_value_set_uint (value, rtph263penc->ssrc);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -49,6 +49,10 @@ struct _GstRtpH263PEnc
GstAdapter *adapter;
GstClockTime first_ts;
guint16 seqnum;
guint pt;
guint ssrc;
guint mtu;
};
......
......@@ -37,12 +37,16 @@ enum
LAST_SIGNAL
};
#define DEFAULT_MTU 1024
#define DEFAULT_MTU 1024
#define DEFAULT_PT 96
#define DEFAULT_SSRC 0
enum
{
PROP_0,
PROP_MTU
PROP_MTU,
PROP_PT,
PROP_SSRC
};
static GstStaticPadTemplate gst_rtph263penc_sink_template =
......@@ -132,6 +136,14 @@ gst_rtph263penc_class_init (GstRtpH263PEncClass * klass)
g_param_spec_uint ("mtu", "MTU",
"Maximum size of one packet",
28, G_MAXUINT, DEFAULT_MTU, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
g_param_spec_uint ("pt", "payload type",
"The payload type of the packets",
0, 0x80, DEFAULT_PT, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
"The SSRC of the packets",
0, G_MAXUINT, DEFAULT_SSRC, G_PARAM_READWRITE));
gstelement_class->change_state = gst_rtph263penc_change_state;
}
......@@ -187,6 +199,9 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
outbuf = gst_rtpbuffer_new_allocate (payload_len, 0, 0);
gst_rtpbuffer_set_timestamp (outbuf,
rtph263penc->first_ts * 90000 / GST_SECOND);
gst_rtpbuffer_set_payload_type (outbuf, rtph263penc->pt);
gst_rtpbuffer_set_ssrc (outbuf, rtph263penc->ssrc);
gst_rtpbuffer_set_seq (outbuf, rtph263penc->seqnum++);
/* last fragment gets the marker bit set */
gst_rtpbuffer_set_marker (outbuf, avail > towrite ? 0 : 1);
......@@ -247,6 +262,12 @@ gst_rtph263penc_set_property (GObject * object, guint prop_id,
case PROP_MTU:
rtph263penc->mtu = g_value_get_uint (value);
break;
case PROP_PT:
rtph263penc->pt = g_value_get_uint (value);
break;
case PROP_SSRC:
rtph263penc->ssrc = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -265,6 +286,12 @@ gst_rtph263penc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_MTU:
g_value_set_uint (value, rtph263penc->mtu);
break;
case PROP_PT:
g_value_set_uint (value, rtph263penc->pt);
break;
case PROP_SSRC:
g_value_set_uint (value, rtph263penc->ssrc);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -49,6 +49,10 @@ struct _GstRtpH263PEnc
GstAdapter *adapter;
GstClockTime first_ts;
guint16 seqnum;
guint pt;
guint ssrc;
guint mtu;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment