summaryrefslogtreecommitdiff
blob: ac56a08186784ddf45a10c30956c28c3a1ae6347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 30b32e864e9a77b66a36d27d3b071f59633d08b7 Mon Sep 17 00:00:00 2001
From: Rob Clark <rob@ti.com>
Date: Mon, 13 Sep 2010 19:16:02 -0500
Subject: [PATCH 22/24] stride: support for 32bit RGB formats

---
 gst/stride/convert.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/gst/stride/convert.c b/gst/stride/convert.c
index 5d392ac..7f976a5 100644
--- a/gst/stride/convert.c
+++ b/gst/stride/convert.c
@@ -372,6 +372,22 @@ convert_rgb16_rgb16 (GstStrideTransform * self,
   return convert_422i_422i (self, out, in);
 }
 
+/** convert 32bbp rgb formats */
+static GstFlowReturn
+convert_rgb32_rgb32 (GstStrideTransform * self,
+    guchar * out, guchar * in)
+{
+  if (G_UNLIKELY (self->needs_refresh)) {
+    gint sx[] = {1};
+    gint sy[] = {1};
+    if (refresh_cache (self, 1, 4, sx, sx, sy, sy))
+      return GST_FLOW_ERROR;
+    self->needs_refresh = FALSE;
+  }
+
+  return convert_n_n (self, out, in, 1);
+}
+
 #define CONVERT(tofmt, fromfmt, convert)                        \
 		{                                                           \
       { GST_VIDEO_FORMAT_##tofmt, GST_VIDEO_FORMAT_##fromfmt }, \
@@ -388,6 +404,14 @@ const Conversion stride_conversions[] = {
   CONVERT (I420, NV12, convert_i420_nv12),
   CONVERT (I420, YUY2, convert_i420_yuy2),
   CONVERT (RGB16, RGB16, convert_rgb16_rgb16),
+  CONVERT (RGBx, RGBx, convert_rgb32_rgb32),
+  CONVERT (BGRx, BGRx, convert_rgb32_rgb32),
+  CONVERT (xRGB, xRGB, convert_rgb32_rgb32),
+  CONVERT (xBGR, xBGR, convert_rgb32_rgb32),
+  CONVERT (RGBA, RGBA, convert_rgb32_rgb32),
+  CONVERT (BGRA, BGRA, convert_rgb32_rgb32),
+  CONVERT (ARGB, ARGB, convert_rgb32_rgb32),
+  CONVERT (ABGR, ABGR, convert_rgb32_rgb32),
   /* add new entries before here */
   {{GST_VIDEO_FORMAT_UNKNOWN}}
 };
-- 
1.7.1