Added TI patches, generated from commit 04f9d72 of the following tree:
[ubuntu-omap:gst-plugins-bad1-0.git] / debian / patches / 0096-dri2bufferpool-Make-sure-max_buffers-NB_DRI2BUFS.patch
1 From 053dda8f17a2802307d77ffedc80293d94a98677 Mon Sep 17 00:00:00 2001
2 From: Thibault Saunier <thibault.saunier@collabora.com>
3 Date: Thu, 13 Dec 2012 15:27:39 -0300
4 Subject: [PATCH 096/100] dri2bufferpool: Make sure max_buffers < NB_DRI2BUFS
5
6 ---
7  sys/dri2/gstdri2bufferpool.c |   30 ++++++++++++++++++++++++++++++
8  1 file changed, 30 insertions(+)
9
10 diff --git a/sys/dri2/gstdri2bufferpool.c b/sys/dri2/gstdri2bufferpool.c
11 index 84654a4..e73c096 100755
12 --- a/sys/dri2/gstdri2bufferpool.c
13 +++ b/sys/dri2/gstdri2bufferpool.c
14 @@ -28,6 +28,7 @@
15  #endif
16  
17  #include "gstdri2bufferpool.h"
18 +#include "gstdri2util.h"
19  
20  #include <sys/drm/gstdrmmeta.h>
21  
22 @@ -97,6 +98,34 @@ gst_dri2_pool_alloc_buffer (GstBufferPool * pool, GstBuffer ** buffer,
23    return gst_drm_buffer_pool_finnish_alloc (pool, buffer, params);
24  }
25  
26 +static gboolean
27 +_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
28 +{
29 +  gsize size;
30 +  GstCaps *caps;
31 +  guint min_buffers, max_buffers;
32 +
33 +  if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
34 +          &max_buffers))
35 +    goto wrong_config;
36 +
37 +  if (max_buffers == 0 || max_buffers > NB_DRI2BUFS) {
38 +    max_buffers = NB_DRI2BUFS;
39 +  }
40 +
41 +  gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
42 +      max_buffers);
43 +
44 +  GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
45 +  return TRUE;
46 +
47 +wrong_config:
48 +  {
49 +    GST_WARNING_OBJECT (pool, "invalid config");
50 +    return FALSE;
51 +  }
52 +}
53 +
54  static void
55  gst_dri2_buffer_pool_finalize (GObject * object)
56  {
57 @@ -115,6 +144,7 @@ gst_dri2_buffer_pool_class_init (GstDRI2BufferPoolClass * klass)
58  
59    gstbufferpool_class->alloc_buffer =
60        GST_DEBUG_FUNCPTR (gst_dri2_pool_alloc_buffer);
61 +  gstbufferpool_class->set_config = _buffer_pool_set_config;
62  }
63  
64  static void
65 -- 
66 1.7.9.5
67