Commit graph

43 commits

Author SHA1 Message Date
Sebastian Dröge
84ab11afdb avfvideosrc: Only set latency if we already know our caps
Otherwise we might set bogus values or GST_CLOCK_TIME_NONE.

Also make sure to reset the caps field to NULL after unreffing
the caps to prevent accidential use afterwards, and unref any
old caps before we remember new caps.
2015-02-19 01:03:35 +02:00
Alessandro Decina
6e325be516 applemedia: avfvideosrc: fix crash when non-GL memory is used 2015-02-13 19:12:54 +11:00
Sebastian Dröge
31f59cb344 avfvideosrc: Only use the duration of the sample if it is valid 2015-02-12 11:12:09 +02:00
Alessandro Decina
f577b52e5d applemedia: rework GL texture sharing
Use YUV instead of RGB textures, then convert using the new apple specific
shader in GstGLColorConvert. Also use GLMemory directly instead of using the
GL upload meta, avoiding an extra texture copy we used to have before.
2015-01-30 00:34:08 +11:00
Alessandro Decina
8734abb1ce applemedia: don't call CVPixelBufferLockBaseAddress when doing texture sharing
When doing texture sharing we don't need to call CVPixelBufferLockBaseAddress to
map the buffer in CPU. This cuts about 10% relative cpu time from a vtdec !
glimagesink pipeline.
2015-01-30 00:34:08 +11:00
Alessandro Decina
cdfe90aaba avfvideosrc: implement the GL texture upload meta 2015-01-15 14:10:43 +11:00
Alessandro Decina
5496fd3e75 avfvideosrc: improve timestamp code
Use a combination of the running time and CMClockGetTime from AVF to compute
timestamps.
2014-12-27 12:43:45 +11:00
Alessandro Decina
0156725480 avfvideosrc: improve timestamping and latency reporting
Use AVF provided timings to timestamp output buffers. Use the running time at
the time the first buffer is produced to base timestamps on. Report 1-frame
latency based on the negotiated framerate instead of hardcoding 4ms latency.
2014-12-17 12:24:05 +11:00
Sebastian Dröge
98b856d630 avfvideosrc: Don't pretend to support reconfiguration
We will run into an assertion in set_caps() if we try to change
caps while the source is already running. Don't try to find new
caps in GstBaseSrc::negotiate() to prevent caps changes.
2014-11-09 10:41:52 +01:00
Tim-Philipp Müller
ffe59820d8 avfvideosrc: fix bogus BGRA caps
Remove 0.10-style endianness/*_mask/bpp/depth fields.
2014-09-10 16:38:52 +01:00
Matthieu Bouron
e728ee8208 coremediabuffer: handle stride alignment
Handle stride alignment through the use of the video meta API. The
code is based on the corevideobuffer implementation.

If the video meta API is not supported and the underlying buffer
contains padding, the core media buffer is copied to a system memory
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=727885
2014-04-24 12:27:59 +02:00
Matthieu Bouron
c6572df9ff avfvideosrc: check if downstream supports the video meta API
Check if downstream supports the video meta API, so we can use it later
with the core media buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=727953
2014-04-24 10:46:51 +01:00
Matthieu Bouron
58be5ce16d avfvideosrc: declare missing instance variables
Fixes build on 32-bit system.

https://bugzilla.gnome.org/show_bug.cgi?id=711844
2013-11-11 14:36:19 +01:00
Andoni Morales Alastruey
98e849a092 avfvideosrc: fix build in iOS with isEqualTo doesn't exists 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
a2b90eeb8c avfvideosrc: fix build with older SDK not supporting AVDeviceFormat
AVDeviceFormat and AVFrameRateRange are available in iOS since 7.0
so we need a more dynamic approach to support compilation with older
SDK's. We use a NSObject to avoid referencing those types and key-value
coding or preformSelector to access properties.
2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
46a61ea036 avfvideosrc: fix checks for HAVE_IOS 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
81cb13be64 avfvideosrc: include config.h 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
ef7f6e4654 avfvideosrc: add more debug 2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
606a50e550 avfvideosrc: fix compilation with gcc
The synthesize block needs to be moved to fix a compiler error
2013-11-07 15:24:28 +01:00
Andoni Morales Alastruey
94d77829a4 avfvideosrc: sort caps with the highest resolution first
When started without any caps filter we prefer the highest
supported resolution.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
66334591cc avfvideosrc: support screen capture on OSX
https://bugzilla.gnome.org/show_bug.cgi?id=711432
2013-11-07 15:24:28 +01:00
Matthieu Bouron
88b5ff76f6 avfvideosrc: minor cosmetic 2013-11-07 15:24:28 +01:00
Matthieu Bouron
752d74b31f avfvideosrc: use input device formats to set/get caps if available
https://bugzilla.gnome.org/show_bug.cgi?id=711211
2013-11-07 15:24:28 +01:00
Matthieu Bouron
35587efdc9 avfvideosrc: update caps if frame size has changed
On OSX, setting the pixel format on the output reset the capture device
to its native resolution, so we need to update the caps if the output
frame size has changed before a proper solution is found.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
fae79751ad avfvideosrc: check if low preset is available 2013-11-07 15:24:28 +01:00
Matthieu Bouron
7f807270fa avfvideosrc: use a dedicated queue for AVFoundation calls
Replace the main queue with a dedicated queue for AVFoundation calls
so the execution on this queue won't block if the main queue
is not running.
2013-11-07 15:24:28 +01:00
Matthieu Bouron
5d612768a4 avfvideosrc: remove trailing space 2013-11-07 15:24:28 +01:00
Matthieu Bouron
19844fab47 avfvideosrc: dispatch AVFoundation calls synchronously in the main queue 2013-11-07 15:24:27 +01:00
Matthieu Bouron
b6925d5c56 avfvideosrc: only enable 1920x1080 preset on iOS 2013-11-07 15:24:27 +01:00
Matthieu Bouron
06d59e7829 applemedia: port avfvideosrc to 1.0 2013-11-07 15:24:27 +01:00
Matthieu Bouron
22eaf39c1a avfvideosrc: fix truncated line
https://bugzilla.gnome.org/show_bug.cgi?id=710657
2013-10-30 16:27:58 +00:00
Andoni Morales Alastruey
9b168e6b4d applemedia: remove the unneeded buffer factory 2013-05-20 13:31:02 +02:00
Andoni Morales Alastruey
27c546ad1e avfvideosrc: fix deadlock draining queue from the same thread 2013-04-15 09:02:37 +02:00
Ole André Vadla Ravnås
519cefdeee applemedia: update contact information 2013-02-16 02:51:52 +01:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Olivier Crête
9a328a8f71 avfvideosrc: Negotiate format, also support more resolutions
This should enable supprt for old and new iPhones with the same code.
2012-10-30 19:32:59 +01:00
Mark Nauwelaerts
578861abea replace gst_element_class_set_details_simple with gst_element_class_set_metadata 2012-09-14 17:27:49 +02:00
Wim Taymans
de1f89bf07 GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 16:37:13 +01:00
Ole André Vadla Ravnås
8402211bac applemedia: make video source element details consistent
Inspired by the v4l2src element details.
2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
445d7502c4 applemedia: consistently use gst_element_class_set_details_simple 2010-11-04 19:27:25 +01:00
Ole André Vadla Ravnås
8b22f855ec avfvideosrc: don't explicitly empty the buffer queue
We're holding the only reference to it so there's no need to explicitly
empty it right before letting go of our reference.
2010-11-04 17:58:59 +01:00
Ole André Vadla Ravnås
89e5b60130 avfvideosrc: make buffer offset start from zero 2010-11-04 17:52:05 +01:00
Ole André Vadla Ravnås
3ba76f825d applemedia: add new iOS video source based on AVFoundation
This element makes use of the documented AVFoundation framework made
available starting with iOS 4.0, and hence this means we can finally
capture video using a public API.
2010-11-04 14:32:10 +01:00