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
55
56
57
58
59
60
61
62
63
64
65
66
67
|
From a4185ee69f456d244f3bc5d1dc56800d112a3067 Mon Sep 17 00:00:00 2001
From: Kazunori Kobayashi <kkobayas@igel.co.jp>
Date: Mon, 29 Oct 2012 11:52:32 +0900
Subject: [PATCH 27/31] videocrop: add a new function to determine if source
images are interlaced
This patch groups the processing to determine if source images are
interlaced to gst_video_crop_is_interlaced().
---
gst/videocrop/gstvideocrop.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index caeb0b1..d02948d 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -604,6 +604,26 @@ gst_video_crop_transform_dimension_value (const GValue * src_val,
return ret;
}
+static gboolean
+gst_video_crop_is_interlaced (GstCaps * caps)
+{
+ gboolean interlaced;
+ const gchar *layout;
+ GstStructure *structure;
+ gboolean result;
+
+ structure = gst_caps_get_structure (caps, 0);
+ if (gst_structure_get_boolean (structure, "interlaced", &interlaced) &&
+ (interlaced == TRUE) &&
+ ((layout = gst_structure_get_string (structure, "field-layout")) != NULL)
+ && (strcmp (layout, "sequential") == 0))
+ result = TRUE;
+ else
+ result = FALSE;
+
+ return result;
+}
+
static GstCaps *
gst_video_crop_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps)
@@ -687,18 +707,10 @@ gst_video_crop_transform_caps (GstBaseTransform * trans,
guint ratio_y_c;
GstStructure *structure;
gint tile_height;
- gboolean interlaced;
- const gchar *layout;
structure = gst_caps_get_structure (caps, 0);
- if (gst_structure_get_boolean (structure, "interlaced", &interlaced) &&
- (interlaced == TRUE) &&
- ((layout =
- gst_structure_get_string (structure, "field-layout")) != NULL)
- && (strcmp (layout, "sequential") == 0))
- vcrop->interlaced = TRUE;
- else
- vcrop->interlaced = FALSE;
+
+ vcrop->interlaced = gst_video_crop_is_interlaced (caps);
rowstride = img_details.stride;
/* Y plane / UV plane */
--
1.7.9.5
|