Commit b79d2173 authored by Wim Taymans's avatar Wim Taymans
Browse files

Revert "rtph264pay/depay: Add optional framerate caps for use in SDP"

This reverts commit d8825e2a.

There is no framerate attribute in the h264 RTP spec.
parent 190b3d66
...@@ -48,13 +48,11 @@ static GstStaticPadTemplate gst_rtp_h264_depay_src_template = ...@@ -48,13 +48,11 @@ static GstStaticPadTemplate gst_rtp_h264_depay_src_template =
/** optional parameters **/ /** optional parameters **/
/* "width = (int) [ 1, MAX ], " */ /* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */ /* "height = (int) [ 1, MAX ], " */
/* "framerate = (fraction) [ 0/1, MAX/1 ], " */
"video/x-h264, " "video/x-h264, "
"stream-format = (string) byte-stream, alignment = (string) { nal, au }") "stream-format = (string) byte-stream, alignment = (string) { nal, au }")
/** optional parameters **/ /** optional parameters **/
/* "width = (int) [ 1, MAX ], " */ /* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */ /* "height = (int) [ 1, MAX ], " */
/* "framerate = (fraction) [ 0/1, MAX/1 ], " */
); );
static GstStaticPadTemplate gst_rtp_h264_depay_sink_template = static GstStaticPadTemplate gst_rtp_h264_depay_sink_template =
...@@ -84,7 +82,6 @@ GST_STATIC_PAD_TEMPLATE ("sink", ...@@ -84,7 +82,6 @@ GST_STATIC_PAD_TEMPLATE ("sink",
/* "max-rcmd-nalu-size = (string) ANY, " */ /* "max-rcmd-nalu-size = (string) ANY, " */
/* "width = (int) [ 1, MAX ], " */ /* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */ /* "height = (int) [ 1, MAX ], " */
/* "framerate = (fraction) [ 0/1, MAX/1 ] " */
); );
#define gst_rtp_h264_depay_parent_class parent_class #define gst_rtp_h264_depay_parent_class parent_class
...@@ -161,8 +158,6 @@ gst_rtp_h264_depay_reset (GstRtpH264Depay * rtph264depay) ...@@ -161,8 +158,6 @@ gst_rtp_h264_depay_reset (GstRtpH264Depay * rtph264depay)
rtph264depay->new_codec_data = FALSE; rtph264depay->new_codec_data = FALSE;
rtph264depay->width = 0; rtph264depay->width = 0;
rtph264depay->height = 0; rtph264depay->height = 0;
rtph264depay->frate_num = 0;
rtph264depay->frate_denom = 1;
g_ptr_array_set_size (rtph264depay->sps, 0); g_ptr_array_set_size (rtph264depay->sps, 0);
g_ptr_array_set_size (rtph264depay->pps, 0); g_ptr_array_set_size (rtph264depay->pps, 0);
} }
...@@ -326,11 +321,6 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) ...@@ -326,11 +321,6 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay)
"height", G_TYPE_INT, rtph264depay->height, NULL); "height", G_TYPE_INT, rtph264depay->height, NULL);
} }
if (rtph264depay->frate_num > 0) {
gst_caps_set_simple (srccaps, "framerate", GST_TYPE_FRACTION,
rtph264depay->frate_num, rtph264depay->frate_denom, NULL);
}
if (!rtph264depay->byte_stream) { if (!rtph264depay->byte_stream) {
GstBuffer *codec_data; GstBuffer *codec_data;
GstMapInfo map; GstMapInfo map;
...@@ -546,7 +536,6 @@ gst_rtp_h264_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) ...@@ -546,7 +536,6 @@ gst_rtp_h264_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
GstMapInfo map; GstMapInfo map;
guint8 *ptr; guint8 *ptr;
gint width = 0, height = 0; gint width = 0, height = 0;
gint num = 0, denom = 1;
rtph264depay = GST_RTP_H264_DEPAY (depayload); rtph264depay = GST_RTP_H264_DEPAY (depayload);
...@@ -653,15 +642,8 @@ gst_rtp_h264_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) ...@@ -653,15 +642,8 @@ gst_rtp_h264_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
goto invalid_dimension; goto invalid_dimension;
} }
if (gst_structure_get_fraction (structure, "framerate", &num, &denom) &&
(num < 0 || denom <= 0)) {
goto invalid_framerate;
}
rtph264depay->width = width; rtph264depay->width = width;
rtph264depay->height = height; rtph264depay->height = height;
rtph264depay->frate_num = num;
rtph264depay->frate_denom = denom;
return gst_rtp_h264_set_src_caps (rtph264depay); return gst_rtp_h264_set_src_caps (rtph264depay);
...@@ -677,11 +659,6 @@ invalid_dimension: ...@@ -677,11 +659,6 @@ invalid_dimension:
GST_ERROR_OBJECT (depayload, "invalid width/height from caps"); GST_ERROR_OBJECT (depayload, "invalid width/height from caps");
return FALSE; return FALSE;
} }
invalid_framerate:
{
GST_ERROR_OBJECT (depayload, "invalid framerate from caps");
return FALSE;
}
} }
static GstBuffer * static GstBuffer *
......
...@@ -68,8 +68,6 @@ struct _GstRtpH264Depay ...@@ -68,8 +68,6 @@ struct _GstRtpH264Depay
gboolean new_codec_data; gboolean new_codec_data;
gint width; gint width;
gint height; gint height;
gint frate_num;
gint frate_denom;
}; };
struct _GstRtpH264DepayClass struct _GstRtpH264DepayClass
......
...@@ -52,8 +52,6 @@ static GstStaticPadTemplate gst_rtp_h264_pay_sink_template = ...@@ -52,8 +52,6 @@ static GstStaticPadTemplate gst_rtp_h264_pay_sink_template =
"video/x-h264, " "video/x-h264, "
"stream-format = (string) byte-stream, alignment = (string) { nal, au }, " "stream-format = (string) byte-stream, alignment = (string) { nal, au }, "
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]") "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]")
/** optional parameters **/
/* "framerate = (fraction) [ 0/1, MAX/1 ] " */
); );
static GstStaticPadTemplate gst_rtp_h264_pay_src_template = static GstStaticPadTemplate gst_rtp_h264_pay_src_template =
...@@ -66,8 +64,6 @@ GST_STATIC_PAD_TEMPLATE ("src", ...@@ -66,8 +64,6 @@ GST_STATIC_PAD_TEMPLATE ("src",
"clock-rate = (int) 90000, " "clock-rate = (int) 90000, "
"encoding-name = (string) \"H264\", " "encoding-name = (string) \"H264\", "
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]") "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]")
/** optional parameters **/
/* "framerate = (fraction) [ 0/1, MAX/1 ] " */
); );
#define DEFAULT_SPROP_PARAMETER_SETS NULL #define DEFAULT_SPROP_PARAMETER_SETS NULL
...@@ -435,7 +431,6 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps) ...@@ -435,7 +431,6 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
gchar *sprops; gchar *sprops;
gboolean caps_set; gboolean caps_set;
gint width, height; gint width, height;
gint num = 0, denom = 1;
rtph264pay = GST_RTP_H264_PAY (basepayload); rtph264pay = GST_RTP_H264_PAY (basepayload);
...@@ -470,11 +465,6 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps) ...@@ -470,11 +465,6 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
goto invalid_dimension; goto invalid_dimension;
} }
if (gst_structure_get_fraction (str, "framerate", &num, &denom) &&
(num < 0 || denom <= 0)) {
goto invalid_framerate;
}
/* packetized AVC video has a codec_data */ /* packetized AVC video has a codec_data */
if ((value = gst_structure_get_value (str, "codec_data"))) { if ((value = gst_structure_get_value (str, "codec_data"))) {
guint num_sps, num_pps; guint num_sps, num_pps;
...@@ -579,19 +569,10 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps) ...@@ -579,19 +569,10 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
sprops = NULL; sprops = NULL;
} }
if (num > 0 && sprops != NULL) { if (sprops != NULL) {
caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width",
G_TYPE_INT, width, "height", G_TYPE_INT, height,
"sprop-parameter-sets", G_TYPE_STRING, sprops, "framerate",
GST_TYPE_FRACTION, num, denom, NULL);
} else if (num <= 0 && sprops != NULL) {
caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width", caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width",
G_TYPE_INT, width, "height", G_TYPE_INT, height, G_TYPE_INT, width, "height", G_TYPE_INT, height,
"sprop-parameter-sets", G_TYPE_STRING, sprops, NULL); "sprop-parameter-sets", G_TYPE_STRING, sprops, NULL);
} else if (num > 0 && sprops == NULL) {
caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width",
G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate",
GST_TYPE_FRACTION, num, denom, NULL);
} else { } else {
caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width", caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width",
G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL); G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL);
...@@ -632,11 +613,6 @@ invalid_dimension: ...@@ -632,11 +613,6 @@ invalid_dimension:
GST_ERROR_OBJECT (rtph264pay, "invalid width/height from caps"); GST_ERROR_OBJECT (rtph264pay, "invalid width/height from caps");
return FALSE; return FALSE;
} }
invalid_framerate:
{
GST_ERROR_OBJECT (rtph264pay, "invalid framerate from caps");
return FALSE;
}
error: error:
{ {
gst_buffer_unmap (buffer, &map); gst_buffer_unmap (buffer, &map);
......
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