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 747378 - avfvideosrc: orientation property
avfvideosrc: orientation property
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal enhancement
: git master
Assigned To: Ilya Konstantinov
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-05 16:39 UTC by Ilya Konstantinov
Modified: 2018-11-03 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avfvideosrc: Add orientation property (4.47 KB, patch)
2015-04-05 16:40 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: Add orientation property (4.53 KB, patch)
2015-04-09 05:57 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: Add orientation property (4.53 KB, patch)
2015-04-09 06:14 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: factor 'orientation' into caps (5.32 KB, patch)
2015-04-09 07:43 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: factor 'orientation' into caps (6.99 KB, patch)
2015-04-09 08:25 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: factor 'orientation' into caps (6.99 KB, patch)
2015-04-09 20:50 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: Add orientation property (4.81 KB, patch)
2015-04-10 23:16 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: factor 'orientation' into caps (7.05 KB, patch)
2015-04-10 23:17 UTC, Ilya Konstantinov
none Details | Review
avfvideosrc: factor 'orientation' into caps (6.10 KB, patch)
2015-04-12 16:23 UTC, Ilya Konstantinov
none Details | Review

Description Ilya Konstantinov 2015-04-05 16:39:42 UTC
Adding orientation property.

According to docs:
https://developer.apple.com/library/ios/qa/qa1744/_index.html

"Clients may receive physically rotated CVPixelBuffers in their AVCaptureVideoDataOutput -captureOutput:didOutputSampleBuffer:fromConnection: delegate callback. All 4 AVCaptureVideoOrientation modes are supported, and rotation is hardware accelerated."
Comment 1 Ilya Konstantinov 2015-04-05 16:40:09 UTC
Created attachment 300991 [details] [review]
avfvideosrc: Add orientation property
Comment 2 Tim-Philipp Müller 2015-04-05 17:42:49 UTC
There's a GstVideoOrientation interface fwiw, and orientation may also be signalled in tags (don't think we have a meta for that yet).
Comment 3 Ilya Konstantinov 2015-04-05 18:11:55 UTC
(In reply to Tim-Philipp Müller from comment #2)
> There's a GstVideoOrientation interface fwiw

I actually did look for one, before introducing mine.
GstVideoOrientation deals with hflip, vflip, hcenter, vcenter. Does this somehow represent 90-cw rotation?

Also, Apple talks in terms of device orientation, in helpful terms of "portrait" and "landscape", so I'd rather offer this than "int rotation" (or even worse "float rotation" in radians :) cause, like, rotation from what?

When someone records from an iPhone and says "Portrait", they understand right away what it means.

> and orientation may also be signalled in tags (don't think we have a meta for that yet)

I think attaching an orientation tag is a job of a GstElement that polls a position sensor. I think it'll be nice for GStreamer to have one, yes.

(Curiously, in the Apple Technical Q&A linked above, they discuss that on AVCaptureMovieFileOutput they don't actually rotate buffers but rather set a transform matrix so the video gets rotated on playback.)

In GStreamer, one could theoretically apply a glshader to rotate on playback too, but I just wanted to expose this unique hardware-accelerated feature of rotating the physical video buffer.

We can always still use glshader when it serves our pipelines best.
Comment 4 Ilya Konstantinov 2015-04-09 05:57:32 UTC
Created attachment 301177 [details] [review]
avfvideosrc: Add orientation property

Ooops, g_value_set_int -> g_value_set_enum and g_value_get_int -> g_value_get_enum.
Comment 5 Ilya Konstantinov 2015-04-09 06:14:29 UTC
Created attachment 301179 [details] [review]
avfvideosrc: Add orientation property

Follow GStreamer style of enum names corresponding to the in-code names
Comment 6 Ilya Konstantinov 2015-04-09 06:25:02 UTC
Or... what's actually better? Either pick attachment 301179 [details] [review] or attachment 301177 [details] [review] (original "documenting" names).
Comment 7 Ilya Konstantinov 2015-04-09 07:43:13 UTC
Created attachment 301184 [details] [review]
avfvideosrc: factor 'orientation' into caps

Use the orientation early on, and also consider it when getting caps.
Comment 8 Ilya Konstantinov 2015-04-09 08:25:05 UTC
Created attachment 301188 [details] [review]
avfvideosrc: factor 'orientation' into caps

Oops, should test before submitting patches.

This patch also takes out the [connection setVideoOrientation] out of gotSampleBuffer:... since then it only applies on the next buffer. Instead, change the connection as soon as the property is changed.
Comment 9 Ilya Konstantinov 2015-04-09 20:50:29 UTC
Created attachment 301239 [details] [review]
avfvideosrc: factor 'orientation' into caps

Rebase to apply on git master.
Comment 10 Ilya Konstantinov 2015-04-10 23:16:39 UTC
Created attachment 301337 [details] [review]
avfvideosrc: Add orientation property

Forgot to initialize orientation in init
Comment 11 Ilya Konstantinov 2015-04-10 23:17:49 UTC
Created attachment 301338 [details] [review]
avfvideosrc: factor 'orientation' into caps

Forgot to retain. (We're not using ARC in this file.)
Comment 12 Ilya Konstantinov 2015-04-12 16:23:28 UTC
Created attachment 301413 [details] [review]
avfvideosrc: factor 'orientation' into caps

Final version. Not retaining needed.
Comment 13 GStreamer system administrator 2018-11-03 13:33:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/231.