After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567952 - videocrop: add b/w support
videocrop: add b/w support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.14
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-16 08:56 UTC by Luotao Fu
Modified: 2009-01-23 08:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch adds 8bit grayscale support to videocrop plugin (1.76 KB, patch)
2009-01-16 08:59 UTC, Luotao Fu
committed Details | Review

Description Luotao Fu 2009-01-16 08:56:58 UTC
Videocrop lacks support for b/w streams, like provided by e.g. b/w cameras. Since we can now handle such stream with v4l2src plugin (see bug #566616). We should better enable it in videocrop too to crop this directly.
Comment 1 Luotao Fu 2009-01-16 08:59:19 UTC
Created attachment 126563 [details] [review]
Patch adds 8bit grayscale support to videocrop plugin
Comment 2 Wim Taymans 2009-01-19 11:38:26 UTC
-  if (gst_structure_has_name (structure, "video/x-raw-rgb")) {
+  if (gst_structure_has_name (structure, "video/x-raw-rgb" ||
+      gst_structure_has_name (structure, "video/x-raw-gray"))) {
     gint bpp = 0;

There is a wrong backet there (need to close the first structure_has_name call)
Comment 3 Wim Taymans 2009-01-19 11:45:25 UTC
commited with corrected brackets.

        Patch by: Luotao Fu <l dot fu at pengutronix dot de>

        * gst/videocrop/gstvideocrop.c:
        (gst_video_crop_get_image_details_from_caps):
        Add 8bit grayscale support to videocrop plugin. Fixes #567952.
Comment 4 Luotao Fu 2009-01-19 11:50:43 UTC
Comment on attachment 126563 [details] [review]
Patch adds 8bit grayscale support to videocrop plugin

>From: Luotao Fu <l.fu@pengutronix.de>
>Subject: [PATCH] videocrop: add b/w support
>
>Adds 8bit grayscale support to videocrop plugin
>
>Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
>---
> gst/videocrop/gstvideocrop.c |   12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
>diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
>index e4fcbd3..32ffb9d 100644
>--- a/gst/videocrop/gstvideocrop.c
>+++ b/gst/videocrop/gstvideocrop.c
>@@ -88,6 +88,12 @@ enum
> };
> 
> /* the formats we support */
>+#define GST_VIDEO_CAPS_GRAY "video/x-raw-gray, "			\
>+    "bpp = (int) 8, "                                                  \
>+    "width = " GST_VIDEO_SIZE_RANGE ", "                                \
>+    "height = " GST_VIDEO_SIZE_RANGE ", "                               \
>+    "framerate = " GST_VIDEO_FPS_RANGE
>+
> #define VIDEO_CROP_CAPS                          \
>   GST_VIDEO_CAPS_RGBx ";"                        \
>   GST_VIDEO_CAPS_xRGB ";"                        \
>@@ -107,7 +113,8 @@ enum
>   GST_VIDEO_CAPS_YUV ("I420") ";"                \
>   GST_VIDEO_CAPS_YUV ("YV12") ";"                \
>   GST_VIDEO_CAPS_RGB_16 ";"                      \
>-  GST_VIDEO_CAPS_RGB_15
>+  GST_VIDEO_CAPS_RGB_15 ";"			 \
>+  GST_VIDEO_CAPS_GRAY
> 
> static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
>     GST_PAD_SRC,
>@@ -211,7 +218,8 @@ gst_video_crop_get_image_details_from_caps (GstVideoCrop * vcrop,
>   details->width = width;
>   details->height = height;
> 
>-  if (gst_structure_has_name (structure, "video/x-raw-rgb")) {
>+  if (gst_structure_has_name (structure, "video/x-raw-rgb") ||
>+      gst_structure_has_name (structure, "video/x-raw-gray")) {
>     gint bpp = 0;
> 
>     if (!gst_structure_get_int (structure, "bpp", &bpp) || (bpp & 0x07) != 0)
>-- 
>1.5.6.5
>
Comment 5 Luotao Fu 2009-01-19 11:56:09 UTC
(In reply to comment #3)
> commited with corrected brackets.
> 
>         Patch by: Luotao Fu <l dot fu at pengutronix dot de>
> 
>         * gst/videocrop/gstvideocrop.c:
>         (gst_video_crop_get_image_details_from_caps):
>         Add 8bit grayscale support to videocrop plugin. Fixes #567952.
> 

Oops, stupid mark/past error. Just for better record. fixed in my attachment
too.

Please ignore the comment above. 'd learn to use Bugzilla as well..... ;-)

cheers
Luotao