- if (rate != NULL) {
- res = gst_rtp_base_payload_set_outcaps (basepayload, "width", G_TYPE_INT,
- width, "height", G_TYPE_INT, height, "a-framerate", G_TYPE_STRING,
- rate, NULL);
- } else if (rate == NULL) {
- res = gst_rtp_base_payload_set_outcaps (basepayload, "width",
- G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL);
+ size = g_strdup_printf("%d-%d", width, height);
+
+ if (pay->width == 0) {
+ GST_DEBUG_OBJECT (pay,
+ "width or height are greater than 2040, adding x-dimensions to caps");
+ dim = g_strdup_printf ("%d,%d", width, height);
+ }
+
+ if (rate != NULL && dim != NULL) {
+ res = gst_rtp_base_payload_set_outcaps (basepayload, "a-framerate",
+ G_TYPE_STRING, rate, "a-framesize", G_TYPE_STRING, size,
+ "x-dimensions", G_TYPE_STRING, dim, NULL);
+ } else if (rate != NULL && dim == NULL) {
+ res = gst_rtp_base_payload_set_outcaps (basepayload, "a-framerate",
+ G_TYPE_STRING, rate, "a-framesize", G_TYPE_STRING, size, NULL);
+ } else if (rate == NULL && dim != NULL) {
+ res = gst_rtp_base_payload_set_outcaps (basepayload, "x-dimensions",
+ G_TYPE_STRING, dim, "a-framesize", G_TYPE_STRING, size, NULL);
+ } else {
+ res = gst_rtp_base_payload_set_outcaps (basepayload, "a-framesize",
+ G_TYPE_STRING, size, NULL);