[gstreamer1.0] Remove *.bbappend and update.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-multimedia / gstreamer / gstreamer-0.10.36.1+git / multiqueue-sparsestreams.patch
1 diff -Naur git.org/plugins/elements/gstmultiqueue.c git/plugins/elements/gstmultiqueue.c
2 --- git.org/plugins/elements/gstmultiqueue.c    2013-04-22 23:33:43.840120880 +0200
3 +++ git/plugins/elements/gstmultiqueue.c        2013-04-22 23:37:47.728118492 +0200
4 @@ -161,6 +161,7 @@
5    GstDataQueueSize max_size, extra_size;
6    GstClockTime cur_time;
7    gboolean is_eos;
8 +  gboolean is_sparse;
9    gboolean flushing;
10  
11    /* Protected by global lock */
12 @@ -801,6 +802,12 @@
13    return result;
14  }
15  
16 +static gboolean
17 +is_sparse (GstSingleQueue * sq)
18 +{
19 +  return sq->is_sparse;
20 +}
21 +
22  static void
23  update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
24  {
25 @@ -822,6 +829,8 @@
26    /* get bytes and time percentages and take the max */
27    if (sq->is_eos) {
28      percent = 100;
29 +  } else if (is_sparse (sq)) {
30 +    percent = 100;
31    } else {
32      percent = 0;
33      if (sq->max_size.time > 0) {
34 @@ -1609,11 +1618,24 @@
35  
36    otherpad = (pad == sq->srcpad) ? sq->sinkpad : sq->srcpad;
37  
38 -  GST_LOG_OBJECT (otherpad, "Getting caps from the peer of this pad");
39 -
40    result = gst_pad_peer_get_caps (otherpad);
41    if (result == NULL)
42      result = gst_caps_new_any ();
43 +  else
44 +  {
45 +    GstStructure* str;
46 +    const gchar *g_type;
47 +    str = gst_caps_get_structure(result, 0);
48 +    g_type = str ? gst_structure_get_name(str) : (const gchar*)"unknown";
49 +
50 +    GST_LOG_OBJECT (otherpad, "Got caps from the peer of this pad: %s", g_type);
51 +
52 +    if ( !g_strcmp0(g_type, "video/x-dvd-subpicture") || !g_strcmp0(g_type, "text/x-pango-markup") || !g_strcmp0(g_type, "text/plain") || !g_strcmp0(g_type, "subpicture/x-pgs") || !g_strcmp0(g_type, "subpicture/x-ass") )
53 +    {
54 +      GST_INFO_OBJECT (otherpad, "subtitle stream discovered --> set is_sparse to true");
55 +      sq->is_sparse = TRUE;
56 +    }
57 +  }
58  
59    return result;
60  }
61 @@ -1841,7 +1863,7 @@
62  
63      GST_LOG_OBJECT (mq, "Checking Queue %d", oq->id);
64  
65 -    if (gst_data_queue_is_empty (oq->queue)) {
66 +    if (gst_data_queue_is_empty (oq->queue) && !is_sparse (oq)) {
67        GST_LOG_OBJECT (mq, "Queue %d is empty", oq->id);
68        if (IS_FILLED (sq, visible, size.visible)) {
69          sq->max_size.visible = size.visible + 1;
70 @@ -1868,7 +1890,7 @@
71       *    we are checking here.
72       */
73      if (sq->is_eos || IS_FILLED (sq, bytes, ssize.bytes) ||
74 -        IS_FILLED (sq, time, sq->cur_time)) {
75 +        IS_FILLED (sq, time, sq->cur_time) || is_sparse (oq)) {
76        GST_LOG_OBJECT (mq, "Queue %d is filled", oq->id);
77        filled = TRUE;
78      }
79 @@ -1911,7 +1933,7 @@
80          gst_data_queue_limits_changed (oq->queue);
81        }
82      }
83 -    if (!gst_data_queue_is_empty (oq->queue))
84 +    if (!gst_data_queue_is_empty (oq->queue) || is_sparse (oq))
85        empty = FALSE;
86    }
87    GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
88 @@ -2011,6 +2033,7 @@
89        (GstDataQueueFullCallback) single_queue_overrun_cb,
90        (GstDataQueueEmptyCallback) single_queue_underrun_cb, sq);
91    sq->is_eos = FALSE;
92 +  sq->is_sparse = FALSE;
93    sq->flushing = FALSE;
94    gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
95    gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);