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 687655 - videocrop: Add support for automatic cropping (GST 0.10)
videocrop: Add support for automatic cropping (GST 0.10)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other All
: Normal enhancement
: 0.10.37
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 687761
Blocks:
 
 
Reported: 2012-11-05 15:25 UTC by Nicolas Dufresne (ndufresne)
Modified: 2012-11-07 10:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
videocrop: Add support for automatic cropping (10.56 KB, patch)
2012-11-05 15:25 UTC, Nicolas Dufresne (ndufresne)
needs-work Details | Review
videocrop: Style fix (942 bytes, patch)
2012-11-06 10:56 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
videocrop: Add support for automatic cropping (19.27 KB, patch)
2012-11-06 10:57 UTC, Nicolas Dufresne (ndufresne)
needs-work Details | Review
videocrop: Add support for automatic cropping (19.72 KB, patch)
2012-11-06 18:01 UTC, Nicolas Dufresne (ndufresne)
none Details | Review
videocrop: Add support for automatic cropping (20.16 KB, patch)
2012-11-07 10:15 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2012-11-05 15:25:12 UTC
The videocrop element does not currently allow automatic cropping. The attached
patched enables automatic cropping by using -1 on the left, top, right or bottom
properties. The cropping is done equally on both side in both are set to -1.
Comment 1 Nicolas Dufresne (ndufresne) 2012-11-05 15:25:14 UTC
Created attachment 228127 [details] [review]
videocrop: Add support for automatic cropping

This change enable automatic cropping using -1 set to left, top, right or
bottom property. In the case both side are set to automatic cropping, the
croping will be done equally on both side (in the odd case, right and
bottom cropping will be 1 pixel more).
Comment 2 Nicolas Dufresne (ndufresne) 2012-11-05 15:27:07 UTC
I'll also provide a 1.0 version soon ...
Comment 3 Olivier Crête 2012-11-05 15:37:17 UTC
Review of attachment 228127 [details] [review]:

It would be lovely to have unit tests.

Also, I think the caps negotiation may be broken if you crop on left and have it dynamic on the rightside.
Comment 4 Nicolas Dufresne (ndufresne) 2012-11-06 10:56:57 UTC
Created attachment 228234 [details] [review]
videocrop: Style fix
Comment 5 Nicolas Dufresne (ndufresne) 2012-11-06 10:57:00 UTC
Created attachment 228235 [details] [review]
videocrop: Add support for automatic cropping

This change enable automatic cropping using -1 set to left, top, right or
bottom property. In the case both side are set to automatic cropping, the
croping will be done equally on both side (in the odd case, right and
bottom cropping will be 1 pixel more).
Comment 6 Olivier Crête 2012-11-06 17:17:40 UTC
Review of attachment 228235 [details] [review]:

The actual patch looks good, the test has a little issue.

::: tests/check/elements/videocrop.c
@@ +183,3 @@
+  ctx->filter2 = gst_element_factory_make ("capsfilter", "filter2");
+  fail_unless (ctx->filter != NULL,
+      "Failed to create second capsfilter element");

Is that filter2 element used anywhere? It seems to be never added to a pipeline and never linked? You only set the outcaps on it, so they're in effect ignored.
Comment 7 Nicolas Dufresne (ndufresne) 2012-11-06 18:01:12 UTC
Created attachment 228299 [details] [review]
videocrop: Add support for automatic cropping

This change enable automatic cropping using -1 set to left, top, right or
bottom property. In the case both side are set to automatic cropping, the
croping will be done equally on both side (in the odd case, right and
bottom cropping will be 1 pixel more).
Comment 8 Nicolas Dufresne (ndufresne) 2012-11-06 18:03:05 UTC
(In reply to comment #6)
> Review of attachment 228235 [details] [review]:
> 
> The actual patch looks good, the test has a little issue.
> 
> ::: tests/check/elements/videocrop.c
> @@ +183,3 @@
> +  ctx->filter2 = gst_element_factory_make ("capsfilter", "filter2");
> +  fail_unless (ctx->filter != NULL,
> +      "Failed to create second capsfilter element");
> 
> Is that filter2 element used anywhere? It seems to be never added to a pipeline
> and never linked? You only set the outcaps on it, so they're in effect ignored.

My bad, updated in both bugs, the check should be on filter2, and the element should be added and linked. The caps are being set on the element for each tests.
Comment 9 Nicolas Dufresne (ndufresne) 2012-11-07 10:15:53 UTC
Created attachment 228349 [details] [review]
videocrop: Add support for automatic cropping

This change enable automatic cropping using -1 set to left, top, right or
bottom property. In the case both side are set to automatic cropping, the
croping will be done equally on both side (in the odd case, right and
bottom cropping will be 1 pixel more).
Comment 10 Olivier Crête 2012-11-07 10:49:28 UTC
commit 42ec3552f2dfd77e0e83663369e78838c0463ab6
Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date:   Tue Nov 6 11:53:25 2012 +0100

    videocrop: Add support for automatic cropping
    
    This change enable automatic cropping using -1 set to left, top, right or
    bottom property. In the case both side are set to automatic cropping, the
    croping will be done equally on both side (in the odd case, right and
    bottom cropping will be 1 pixel more).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687655

commit 73a478b02fcb71e2fe9ed104fa2b1125b84c5460
Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date:   Tue Nov 6 11:49:56 2012 +0100

    videocrop: Style fix
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687655