/** optional parameters **/
/* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */
- /* "framerate = (fraction) [ 0/1, MAX/1 ], " */
"video/x-h264, "
"stream-format = (string) byte-stream, alignment = (string) { nal, au }")
/** optional parameters **/
/* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */
- /* "framerate = (fraction) [ 0/1, MAX/1 ], " */
);
static GstStaticPadTemplate gst_rtp_h264_depay_sink_template =
/* "max-rcmd-nalu-size = (string) ANY, " */
/* "width = (int) [ 1, MAX ], " */
/* "height = (int) [ 1, MAX ], " */
- /* "framerate = (fraction) [ 0/1, MAX/1 ] " */
);
#define gst_rtp_h264_depay_parent_class parent_class
rtph264depay->new_codec_data = FALSE;
rtph264depay->width = 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->pps, 0);
}
"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) {
GstBuffer *codec_data;
GstMapInfo map;
GstMapInfo map;
guint8 *ptr;
gint width = 0, height = 0;
- gint num = 0, denom = 1;
rtph264depay = GST_RTP_H264_DEPAY (depayload);
goto invalid_dimension;
}
- if (gst_structure_get_fraction (structure, "framerate", &num, &denom) &&
- (num < 0 || denom <= 0)) {
- goto invalid_framerate;
- }
-
rtph264depay->width = width;
rtph264depay->height = height;
- rtph264depay->frate_num = num;
- rtph264depay->frate_denom = denom;
return gst_rtp_h264_set_src_caps (rtph264depay);
GST_ERROR_OBJECT (depayload, "invalid width/height from caps");
return FALSE;
}
-invalid_framerate:
- {
- GST_ERROR_OBJECT (depayload, "invalid framerate from caps");
- return FALSE;
- }
}
static GstBuffer *
"video/x-h264, "
"stream-format = (string) byte-stream, alignment = (string) { nal, au }, "
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]")
- /** optional parameters **/
- /* "framerate = (fraction) [ 0/1, MAX/1 ] " */
);
static GstStaticPadTemplate gst_rtp_h264_pay_src_template =
"clock-rate = (int) 90000, "
"encoding-name = (string) \"H264\", "
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]")
- /** optional parameters **/
- /* "framerate = (fraction) [ 0/1, MAX/1 ] " */
);
#define DEFAULT_SPROP_PARAMETER_SETS NULL
gchar *sprops;
gboolean caps_set;
gint width, height;
- gint num = 0, denom = 1;
rtph264pay = GST_RTP_H264_PAY (basepayload);
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 */
if ((value = gst_structure_get_value (str, "codec_data"))) {
guint num_sps, num_pps;
sprops = NULL;
}
- if (num > 0 && 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) {
+ 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, 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 {
caps_set = gst_rtp_base_payload_set_outcaps (basepayload, "width",
G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL);
GST_ERROR_OBJECT (rtph264pay, "invalid width/height from caps");
return FALSE;
}
-invalid_framerate:
- {
- GST_ERROR_OBJECT (rtph264pay, "invalid framerate from caps");
- return FALSE;
- }
error:
{
gst_buffer_unmap (buffer, &map);