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 667303 - systemclock: use CoreVideo on Mac OS X
systemclock: use CoreVideo on Mac OS X
Status: RESOLVED DUPLICATE of bug 758012
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-04 20:14 UTC by Håvard Graff (hgr)
Modified: 2015-11-13 08:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.98 KB, patch)
2012-01-04 20:14 UTC, Håvard Graff (hgr)
needs-work Details | Review

Description Håvard Graff (hgr) 2012-01-04 20:14:18 UTC
Created attachment 204621 [details] [review]
patch

CoreAudio and CoreVideo have a common clock, so using CoreVideo in
GstSystemClock means that Mac-specific elements will be able to use
timestamps from native APIs. It is also likely to be the best clock
source on this OS.

However, on iOS this does not work very well, so make sure it is
not being used there, even if available.
Comment 1 Sebastian Dröge (slomo) 2013-07-24 08:54:17 UTC
Review of attachment 204621 [details] [review]:

How good is the accuracy of the clock? Is it monotonic?

::: configure.ac
@@ +359,3 @@
+
+HAVE_IOS="no"
+AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])

What's the [-]? And why doesn't it work properly on iOS?

::: gst/gstsystemclock.c
@@ +202,3 @@
+    } else {
+      priv->cv_ratio_n = 1;
+      priv->cv_ratio_d = host_freq / GST_SECOND;

You mean cv_ratio_n = GST_SECOND; cv_ratio_d = host_freq; right? And the frequency is really reported in nanoseconds by CVGetHostClocKFrequency?
Comment 2 Håvard Graff (hgr) 2013-07-24 09:29:08 UTC
(In reply to comment #1)
> Review of attachment 204621 [details] [review]:
> 
> How good is the accuracy of the clock? Is it monotonic?
> 
> I don't remember those numbers anymore, but it was the clock we used for everything in Movi / Jabber Video on OSX.
> 
> What's the [-]? And why doesn't it work properly on iOS?
> 
> Don't remember, probably not needed, and you will have to ask Apple why. I just remember that it did not behave at all.

> ::: gst/gstsystemclock.c
> @@ +202,3 @@
> +    } else {
> +      priv->cv_ratio_n = 1;
> +      priv->cv_ratio_d = host_freq / GST_SECOND;
> 
> You mean cv_ratio_n = GST_SECOND; cv_ratio_d = host_freq; right? And the
> frequency is really reported in nanoseconds by CVGetHostClocKFrequency?

Well, do you do one large division initially, or do you do a large division every time you access the clock? Result is the same, consider it a small optimization. And yes, obviously in nanoseconds.
Comment 3 Sebastian Dröge (slomo) 2013-07-24 09:53:48 UTC
Ok, so what's the big advantage of doing this over just using the monotonic clock? Especially, is this clock monotonic or not? :)
Comment 4 Sebastian Dröge (slomo) 2015-11-13 08:25:25 UTC

*** This bug has been marked as a duplicate of bug 758012 ***