mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 15:36:42 +00:00
rtp: Remove dead assignments and resulting unneeded variables.
This commit is contained in:
parent
153ae910a0
commit
0d6f0801f5
4 changed files with 4 additions and 97 deletions
|
@ -175,16 +175,14 @@ gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
rtpac3depay = GST_RTP_AC3_DEPAY (depayload);
|
rtpac3depay = GST_RTP_AC3_DEPAY (depayload);
|
||||||
|
|
||||||
{
|
{
|
||||||
gint payload_len;
|
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint16 FT, NF;
|
guint16 FT, NF;
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
if (gst_rtp_buffer_get_payload_len (buf) < 2)
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
|
||||||
|
|
||||||
if (payload_len <= 2)
|
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
|
||||||
|
payload = gst_rtp_buffer_get_payload (buf);
|
||||||
|
|
||||||
/* strip off header
|
/* strip off header
|
||||||
*
|
*
|
||||||
* 0 1
|
* 0 1
|
||||||
|
@ -198,9 +196,6 @@ gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpac3depay, "FT: %d, NF: %d", FT, NF);
|
GST_DEBUG_OBJECT (rtpac3depay, "FT: %d, NF: %d", FT, NF);
|
||||||
|
|
||||||
payload_len -= 2;
|
|
||||||
payload += 2;
|
|
||||||
|
|
||||||
/* We don't bother with fragmented packets yet */
|
/* We don't bother with fragmented packets yet */
|
||||||
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1);
|
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1);
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,6 @@ gst_rtp_celt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
total_size = 0;
|
total_size = 0;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
while (total_size < payload_len) {
|
while (total_size < payload_len) {
|
||||||
size = 0;
|
|
||||||
do {
|
do {
|
||||||
s = payload[offset++];
|
s = payload[offset++];
|
||||||
total_size += s + 1;
|
total_size += s + 1;
|
||||||
|
|
|
@ -125,14 +125,11 @@ gst_rtp_j2k_depay_finalize (GObject * object)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_rtp_j2k_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
|
gst_rtp_j2k_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstRtpJ2KDepay *rtpj2kdepay;
|
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gint clock_rate;
|
gint clock_rate;
|
||||||
GstCaps *outcaps;
|
GstCaps *outcaps;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
|
||||||
rtpj2kdepay = GST_RTP_J2K_DEPAY (depayload);
|
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
if (!gst_structure_get_int (structure, "clock-rate", &clock_rate))
|
if (!gst_structure_get_int (structure, "clock-rate", &clock_rate))
|
||||||
|
@ -154,7 +151,6 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstRtpJ2KDepay *rtpj2kdepay;
|
GstRtpJ2KDepay *rtpj2kdepay;
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
gint payload_len;
|
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint frag_offset;
|
guint frag_offset;
|
||||||
|
|
||||||
|
@ -167,9 +163,7 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
rtpj2kdepay->need_header = TRUE;
|
rtpj2kdepay->need_header = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
if (gst_rtp_buffer_get_payload_len (buf) < 8)
|
||||||
|
|
||||||
if (payload_len < 8)
|
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
payload = gst_rtp_buffer_get_payload (buf);
|
||||||
|
@ -194,9 +188,6 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
rtpj2kdepay->need_header = FALSE;
|
rtpj2kdepay->need_header = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
payload += 8;
|
|
||||||
payload_len -= 8;
|
|
||||||
|
|
||||||
/* take JPEG 2000 data, push in the adapter */
|
/* take JPEG 2000 data, push in the adapter */
|
||||||
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 8, -1);
|
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 8, -1);
|
||||||
gst_adapter_push (rtpj2kdepay->adapter, outbuf);
|
gst_adapter_push (rtpj2kdepay->adapter, outbuf);
|
||||||
|
|
|
@ -128,14 +128,6 @@ typedef struct
|
||||||
guint offset:24;
|
guint offset:24;
|
||||||
} RtpJ2KHeader;
|
} RtpJ2KHeader;
|
||||||
|
|
||||||
static void gst_rtp_j2k_pay_set_property (GObject * object, guint prop_id,
|
|
||||||
const GValue * value, GParamSpec * pspec);
|
|
||||||
static void gst_rtp_j2k_pay_get_property (GObject * object, guint prop_id,
|
|
||||||
GValue * value, GParamSpec * pspec);
|
|
||||||
|
|
||||||
static GstStateChangeReturn
|
|
||||||
gst_rtp_j2k_pay_change_state (GstElement * element, GstStateChange transition);
|
|
||||||
|
|
||||||
static gboolean gst_rtp_j2k_pay_setcaps (GstBaseRTPPayload * basepayload,
|
static gboolean gst_rtp_j2k_pay_setcaps (GstBaseRTPPayload * basepayload,
|
||||||
GstCaps * caps);
|
GstCaps * caps);
|
||||||
|
|
||||||
|
@ -161,19 +153,10 @@ gst_rtp_j2k_pay_base_init (gpointer klass)
|
||||||
static void
|
static void
|
||||||
gst_rtp_j2k_pay_class_init (GstRtpJ2KPayClass * klass)
|
gst_rtp_j2k_pay_class_init (GstRtpJ2KPayClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
|
||||||
GstElementClass *gstelement_class;
|
|
||||||
GstBaseRTPPayloadClass *gstbasertppayload_class;
|
GstBaseRTPPayloadClass *gstbasertppayload_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
|
||||||
gstelement_class = (GstElementClass *) klass;
|
|
||||||
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
|
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
|
||||||
|
|
||||||
gobject_class->set_property = gst_rtp_j2k_pay_set_property;
|
|
||||||
gobject_class->get_property = gst_rtp_j2k_pay_get_property;
|
|
||||||
|
|
||||||
gstelement_class->change_state = gst_rtp_j2k_pay_change_state;
|
|
||||||
|
|
||||||
gstbasertppayload_class->set_caps = gst_rtp_j2k_pay_setcaps;
|
gstbasertppayload_class->set_caps = gst_rtp_j2k_pay_setcaps;
|
||||||
gstbasertppayload_class->handle_buffer = gst_rtp_j2k_pay_handle_buffer;
|
gstbasertppayload_class->handle_buffer = gst_rtp_j2k_pay_handle_buffer;
|
||||||
|
|
||||||
|
@ -401,67 +384,6 @@ done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gst_rtp_j2k_pay_set_property (GObject * object, guint prop_id,
|
|
||||||
const GValue * value, GParamSpec * pspec)
|
|
||||||
{
|
|
||||||
GstRtpJ2KPay *rtpj2kpay;
|
|
||||||
|
|
||||||
rtpj2kpay = GST_RTP_J2K_PAY (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_rtp_j2k_pay_get_property (GObject * object, guint prop_id,
|
|
||||||
GValue * value, GParamSpec * pspec)
|
|
||||||
{
|
|
||||||
GstRtpJ2KPay *rtpj2kpay;
|
|
||||||
|
|
||||||
rtpj2kpay = GST_RTP_J2K_PAY (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstStateChangeReturn
|
|
||||||
gst_rtp_j2k_pay_change_state (GstElement * element, GstStateChange transition)
|
|
||||||
{
|
|
||||||
GstRtpJ2KPay *rtpj2kpay;
|
|
||||||
GstStateChangeReturn ret;
|
|
||||||
|
|
||||||
rtpj2kpay = GST_RTP_J2K_PAY (element);
|
|
||||||
|
|
||||||
switch (transition) {
|
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
||||||
break;
|
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
||||||
|
|
||||||
switch (transition) {
|
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
|
||||||
break;
|
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_rtp_j2k_pay_plugin_init (GstPlugin * plugin)
|
gst_rtp_j2k_pay_plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue