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 768687 - Rework video orientation
Rework video orientation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 765309 769147
 
 
Reported: 2016-07-11 16:42 UTC by Xabier Rodríguez Calvar
Modified: 2016-08-25 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-plugins-base 1/3 (1.66 KB, patch)
2016-07-11 17:48 UTC, Xabier Rodríguez Calvar
committed Details | Review
gst-plugins-base 2/3 (1.73 KB, patch)
2016-07-11 17:49 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 3/3 (1.34 KB, patch)
2016-07-11 17:49 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-good 1/2 (23.00 KB, patch)
2016-07-11 17:50 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-good 2/2 (2.58 KB, patch)
2016-07-11 17:50 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-bad 1/2 (10.25 KB, patch)
2016-07-11 17:50 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-bad 2/2 (3.42 KB, patch)
2016-07-11 17:50 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 2/5 (1.73 KB, patch)
2016-07-12 14:07 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 3/5 (6.53 KB, patch)
2016-07-12 14:07 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 4/5 (2.27 KB, patch)
2016-07-12 14:08 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 5/5 (1.96 KB, patch)
2016-07-12 14:08 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-good 1/2 (23.43 KB, patch)
2016-07-12 14:09 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-good 2/2 (2.70 KB, patch)
2016-07-12 14:09 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-bad 1/2 (10.22 KB, patch)
2016-07-12 14:09 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-bad 2/2 (3.38 KB, patch)
2016-07-12 14:10 UTC, Xabier Rodríguez Calvar
none Details | Review
gst-plugins-base 2/2 (11.89 KB, patch)
2016-07-26 18:00 UTC, Xabier Rodríguez Calvar
committed Details | Review
gst-plugins-good 1/1 (22.41 KB, patch)
2016-07-26 18:00 UTC, Xabier Rodríguez Calvar
committed Details | Review
gst-plugins-bad 1/1 (9.90 KB, patch)
2016-07-26 18:01 UTC, Xabier Rodríguez Calvar
committed Details | Review

Description Xabier Rodríguez Calvar 2016-07-11 16:42:23 UTC
Both [gl]videoflip (and now also rpicamsrc) implement the same property based interface to set the orientation/flip.

The intention of this rework is to unify the values and add the property to the interface so that classes implementing it only have to override it.
Comment 1 Xabier Rodríguez Calvar 2016-07-11 17:48:59 UTC
Created attachment 331250 [details] [review]
gst-plugins-base 1/3
Comment 2 Xabier Rodríguez Calvar 2016-07-11 17:49:24 UTC
Created attachment 331251 [details] [review]
gst-plugins-base 2/3
Comment 3 Xabier Rodríguez Calvar 2016-07-11 17:49:42 UTC
Created attachment 331252 [details] [review]
gst-plugins-base 3/3
Comment 4 Xabier Rodríguez Calvar 2016-07-11 17:50:01 UTC
Created attachment 331253 [details] [review]
gst-plugins-good 1/2
Comment 5 Xabier Rodríguez Calvar 2016-07-11 17:50:23 UTC
Created attachment 331254 [details] [review]
gst-plugins-good 2/2
Comment 6 Xabier Rodríguez Calvar 2016-07-11 17:50:40 UTC
Created attachment 331255 [details] [review]
gst-plugins-bad 1/2
Comment 7 Xabier Rodríguez Calvar 2016-07-11 17:50:55 UTC
Created attachment 331257 [details] [review]
gst-plugins-bad 2/2
Comment 8 Nicolas Dufresne (ndufresne) 2016-07-11 18:40:50 UTC
Review of attachment 331253 [details] [review]:

::: gst/videofilter/gstvideoflip.c
@@ -60,1 +60,1 @@
 

This would be an ABI break though. Identity is like none, while auto is orientation tag driven.
Comment 9 Sebastian Dröge (slomo) 2016-07-12 06:04:46 UTC
Review of attachment 331252 [details] [review]:

This also breaks ABI: any implementor of the interface will fail now because the property is not implemented. It should become a new interface to prevent that
Comment 10 Xabier Rodríguez Calvar 2016-07-12 08:14:22 UTC
Review of attachment 331253 [details] [review]:

I was puzzled by this and that's why I set to AUTO, but I can change it back

static void
gst_video_flip_init (GstVideoFlip * videoflip)
{
  /* AUTO is not valid for active method, this is just to ensure we setup the
   * method in gst_video_flip_set_method() */
  videoflip->active_method = GST_VIDEO_ORIENTATION_AUTO;
}
Comment 11 Nicolas Dufresne (ndufresne) 2016-07-12 13:04:36 UTC
(In reply to Xabier Rodríguez Calvar from comment #10)
> Review of attachment 331253 [details] [review] [review]:
> 
> I was puzzled by this and that's why I set to AUTO, but I can change it back
> 
> static void
> gst_video_flip_init (GstVideoFlip * videoflip)
> {
>   /* AUTO is not valid for active method, this is just to ensure we setup the
>    * method in gst_video_flip_set_method() */
>   videoflip->active_method = GST_VIDEO_ORIENTATION_AUTO;
> }

We have the method and a copy (the active one) of that method. This is to be able to remember we are in auto mode, and so the get_property() return what the user have set. The active method cannot be AUTO since it would mean we have no idea what to do. During negotiation, if there was no tag, we change that into identity. If there is a tag, we keep the tag. We also need the copy to remember in the first. So auto here is used as a tempory "invalid" value, to signal that we are not negotiated.
Comment 12 Xabier Rodríguez Calvar 2016-07-12 14:07:25 UTC
Created attachment 331336 [details] [review]
gst-plugins-base 2/5
Comment 13 Xabier Rodríguez Calvar 2016-07-12 14:07:45 UTC
Created attachment 331337 [details] [review]
gst-plugins-base 3/5
Comment 14 Xabier Rodríguez Calvar 2016-07-12 14:08:04 UTC
Created attachment 331338 [details] [review]
gst-plugins-base 4/5
Comment 15 Xabier Rodríguez Calvar 2016-07-12 14:08:23 UTC
Created attachment 331339 [details] [review]
gst-plugins-base 5/5
Comment 16 Xabier Rodríguez Calvar 2016-07-12 14:09:03 UTC
Created attachment 331340 [details] [review]
gst-plugins-good 1/2
Comment 17 Xabier Rodríguez Calvar 2016-07-12 14:09:20 UTC
Created attachment 331341 [details] [review]
gst-plugins-good 2/2
Comment 18 Xabier Rodríguez Calvar 2016-07-12 14:09:47 UTC
Created attachment 331342 [details] [review]
gst-plugins-bad 1/2
Comment 19 Xabier Rodríguez Calvar 2016-07-12 14:10:05 UTC
Created attachment 331343 [details] [review]
gst-plugins-bad 2/2
Comment 20 Sebastian Dröge (slomo) 2016-07-25 07:30:39 UTC
Review of attachment 331336 [details] [review]:

::: gst-libs/gst/video/video.h
@@ +71,3 @@
+ * @GST_VIDEO_ORIENTATION_CUSTOM: Current status depends on plugin internal setup
+ *
+ * The different video orientation methods.

Since: 1.10
Comment 21 Sebastian Dröge (slomo) 2016-07-25 07:31:52 UTC
Review of attachment 331337 [details] [review]:

::: gst-libs/gst/video/videodirection.c
@@ +43,3 @@
+{
+  g_object_interface_install_property (iface,
+      g_param_spec_enum ("direction", "Direction",

Maybe "video-direction", less likelyness of name conflict.

I don't like "direction" here in general but what can we do :)
Comment 22 Sebastian Dröge (slomo) 2016-07-25 07:32:47 UTC
Comment on attachment 331339 [details] [review]
gst-plugins-base 5/5

And squash all the base patches together into one please :)
Comment 23 Sebastian Dröge (slomo) 2016-07-25 07:34:20 UTC
Comment on attachment 331340 [details] [review]
gst-plugins-good 1/2

This breaks ABI. The names of the enum values are changing (none -> identity, upper-left-horizonal -> ul-lr), etc.
Comment 24 Sebastian Dröge (slomo) 2016-07-25 07:35:01 UTC
Comment on attachment 331341 [details] [review]
gst-plugins-good 2/2

squash together with the other -good change.

For the enum, I think we need to keep both and translate internally.
Comment 25 Sebastian Dröge (slomo) 2016-07-25 07:35:24 UTC
Comment on attachment 331342 [details] [review]
gst-plugins-bad 1/2

same as for the -good change
Comment 26 Xabier Rodríguez Calvar 2016-07-26 14:17:23 UTC
(In reply to Sebastian Dröge (slomo) from comment #23)
> Comment on attachment 331340 [details] [review] [review]
> gst-plugins-good 1/2
> 
> This breaks ABI. The names of the enum values are changing (none ->
> identity, upper-left-horizonal -> ul-lr), etc.

(In reply to Sebastian Dröge (slomo) from comment #24)
> Comment on attachment 331341 [details] [review] [review]
> gst-plugins-good 2/2
> 
> For the enum, I think we need to keep both and translate internally.

How can I do this? Won't it duplicate the names? The only solution I can come up for this is that we keep the original enums for the old properties...
Comment 27 Xabier Rodríguez Calvar 2016-07-26 18:00:18 UTC
Created attachment 332171 [details] [review]
gst-plugins-base 2/2
Comment 28 Xabier Rodríguez Calvar 2016-07-26 18:00:50 UTC
Created attachment 332172 [details] [review]
gst-plugins-good 1/1
Comment 29 Xabier Rodríguez Calvar 2016-07-26 18:01:41 UTC
Created attachment 332173 [details] [review]
gst-plugins-bad 1/1
Comment 30 Xabier Rodríguez Calvar 2016-08-16 15:32:32 UTC
Btw, Sebastian, we didn't talk about this during GUADEC, but what about this? O:)
Comment 31 Sebastian Dröge (slomo) 2016-08-16 16:03:31 UTC
Does it keep the old enum? Apart from that it all looked good to me last time. Are you proposing this for 1.10?

It would also be nice to have playbin/playsink implement that, and automatically insert videoflip if the sink does not support it. Just like colorbalance :)
Comment 32 Xabier Rodríguez Calvar 2016-08-17 09:24:13 UTC
(In reply to Sebastian Dröge (slomo) from comment #31)
> Does it keep the old enum?

I am keeping the old enums in order not to break ABI but I changed them internally cause values are the same.

> Apart from that it all looked good to me last
> time. Are you proposing this for 1.10?

Yep, why not? :)

> It would also be nice to have playbin/playsink implement that, and
> automatically insert videoflip if the sink does not support it. Just like
> colorbalance :)

Though I can't now, it would be nice yes.
Comment 33 Sebastian Dröge (slomo) 2016-08-25 07:19:51 UTC
commit 0341f04ce161e9a09345ffe84036bdb023c4e94f
Author: Xabier Rodriguez Calvar <calvaris@igalia.com>
Date:   Tue Jul 26 19:14:40 2016 +0200

    videodirection: interface for rotation and flip
    
    A GstVideoOrientationMethod enumeration is also provided for the
    admitted property values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768687
Comment 34 Sebastian Dröge (slomo) 2016-08-25 07:20:28 UTC
Comment on attachment 332172 [details] [review]
gst-plugins-good 1/1

commit 569820598f3ca29a9f62685da6e745329608c2dd
Author: Xabier Rodriguez Calvar <calvaris@igalia.com>
Date:   Tue Jul 26 19:39:58 2016 +0200

    videoflip: added GstVideoDirection interface
    
    It implements now this interface with its video-direction
    property. Values are changed to GstVideoOrientationMethod but they have
    the same value than the originals.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768687
Comment 35 Sebastian Dröge (slomo) 2016-08-25 07:20:53 UTC
Comment on attachment 332173 [details] [review]
gst-plugins-bad 1/1

commit 8ada38e8f4b92842f9a3cc7243c262b3d9b7d7f8
Author: Xabier Rodriguez Calvar <calvaris@igalia.com>
Date:   Tue Jul 26 19:55:13 2016 +0200

    glvideoflip: implement GstVideoDirection interface
    
    It implements now this interface with its video-direction
    property. Values are changed to GstVideoOrientationMethod but they have
    the same value than the originals.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768687