blob: a2cbb70fe961eb52315b6f189e79d831d1e7d608 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From c782a30482908a4b4dd9cd4abff9f9bc4016698f Mon Sep 17 00:00:00 2001
2From: Song Bing <b06498@freescale.com>
3Date: Tue, 5 Aug 2014 14:40:46 +0800
4Subject: [PATCH] gstrtpmp4gpay: set dafault value for MPEG4 without codec
5 data in caps.
6
7https://bugzilla.gnome.org/show_bug.cgi?id=734263
8
9Upstream-Status: Submitted
10
11Signed-off-by: Song Bing <b06498@freescale.com>
12---
13 gst/rtp/gstrtpmp4gpay.c | 19 ++++++++++++++++++-
14 1 file changed, 18 insertions(+), 1 deletion(-)
15
16diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
17index 7913d9a..1749d39 100644
18--- a/gst/rtp/gstrtpmp4gpay.c
19+++ b/gst/rtp/gstrtpmp4gpay.c
Patrick Williamsc0f7c042017-02-23 20:41:17 -060020@@ -391,6 +391,7 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 const GValue *codec_data;
22 const gchar *media_type = NULL;
23 gboolean res;
24+ const gchar *name;
25
26 rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
27
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028@@ -401,7 +402,6 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029 GST_LOG_OBJECT (rtpmp4gpay, "got codec_data");
30 if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
31 GstBuffer *buffer;
32- const gchar *name;
33
34 buffer = gst_value_get_buffer (codec_data);
35 GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data");
Patrick Williamsc0f7c042017-02-23 20:41:17 -060036@@ -427,6 +427,23 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037
38 rtpmp4gpay->config = gst_buffer_copy (buffer);
39 }
40+ } else {
41+ name = gst_structure_get_name (structure);
42+
43+ if (!strcmp (name, "video/mpeg")) {
44+ rtpmp4gpay->profile = g_strdup ("1");
45+
46+ /* fixed rate */
47+ rtpmp4gpay->rate = 90000;
48+ /* video stream type */
49+ rtpmp4gpay->streamtype = "4";
50+ /* no params for video */
51+ rtpmp4gpay->params = NULL;
52+ /* mode */
53+ rtpmp4gpay->mode = "generic";
54+
55+ media_type = "video";
56+ }
57 }
58 if (media_type == NULL)
59 goto config_failed;
60--
611.7.9.5
62