Commit graph

2040 commits

Author SHA1 Message Date
Matthew Waters
c873c57430 vtdec: only attempt use of the texture cache with GLMemory caps features
Otherwise we send rectangle textures to glimagesink
2015-02-25 00:03:34 +11:00
Sebastian Dröge
e36c27cd46 d3dvideosink: Don't initialize the render window swap chain while the device is lost and we're waiting for reset
https://bugzilla.gnome.org/show_bug.cgi?id=744615
2015-02-24 11:19:48 +02:00
Sebastian Dröge
f53bc227a8 d3dvideosink: Deactivate the fallback buffer pool when replacing it during caps changes
https://bugzilla.gnome.org/show_bug.cgi?id=744615
2015-02-24 11:19:48 +02:00
Matthew Waters
e505f6257c applemedia: new AVSampleBufferLayerSink
Renders buffers using the CALayer subclass AVSampleBufferDisplayLayer
which can be placed inside a Core Animation render tree.
2015-02-24 19:12:10 +11:00
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
Sebastian Dröge
d1d31dae6d d3dvideosink: Deactivate the fallback pool and unref the fallback buffer when resetting
Otherwise we will still have a reference to the surface left, which would
prevent activating the sink again later. E.g. after we lost the device.

Hopefully fixes https://bugzilla.gnome.org/show_bug.cgi?id=744615
2015-02-18 12:45:22 +02:00
Sebastian Dröge
0c9f35653f vtenc: Check if VTSessionCopyProperty() succeeds before using the result
https://bugzilla.gnome.org/show_bug.cgi?id=744585
2015-02-16 12:35:09 +02:00
Arun Raghavan
df43022899 opensles: Make debug category naming a bit more consistent 2015-02-13 15:05:07 +05:30
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
Sebastian Dröge
4ccd425772 openslesringbuffer: Only allocate at most half the number of internal buffers as external audioringbuffer ones
Otherwise we might end up reading too much from the audioringbuffer, which
would result in reading silence.
2015-02-10 16:18:34 +01:00
Sebastian Dröge
9ed4054a94 decklinkvideosrc: Apply the diff between element and pipeline "base" time in all cases
Even if both clocks have the same rate, we need to apply this diff. Only when
it's the same clock we don't, as it's our clock then.
2015-02-10 16:01:19 +01:00
Sebastian Dröge
f83ac624e3 decklinkvideosrc: Add the diff between the pipeline base time and when we start to play
Add the diff between the external time when we went to playing and
the external time when the pipeline went to playing. Otherwise we
will always start outputting from 0 instead of the current running
time.
2015-02-10 15:30:44 +01:00
Sebastian Dröge
d4575e759b decklinkvideosink: Actually include the change mentioned in the last commit 2015-02-10 14:53:55 +01:00
Sebastian Dröge
e8167dd118 decklinkvideo{src,sink}: Sample the internal clock immediately after starting the device
Otherwise we might stay at 0.0s for too long because we will take the first
timestamp we ever see as 0.0... which will be after we started the device.
2015-02-10 14:48:09 +01:00
Sebastian Dröge
b739cf8b7f decklink: Fix compiler warning with gcc
gstdecklink.cpp: In member function 'virtual HRESULT GStreamerDecklinkInputCallback::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)':
gstdecklink.cpp:498:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (capture_time > m_input->clock_start_time)
                      ^
gstdecklink.cpp:503:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (capture_time > m_input->clock_offset)
                      ^
2015-02-09 21:04:17 +01:00
Sebastian Dröge
f0e85023c2 decklink{audio,video}src: Implement clock slaving if the pipeline clock is not the decklink clock 2015-02-09 17:17:37 +01:00
Sebastian Dröge
408f0870a6 decklinkaudio{src,sink}: Only start streams / scheduled playback if there is a videosrc at this point 2015-02-09 17:15:21 +01:00
Sebastian Dröge
349113d15a decklinkaudiosrc: Don't provide a clock
The audio source only works together with the video source, and the video
source is already providing a clock.
2015-02-09 17:04:27 +01:00
Sebastian Dröge
4de7fdfa3a decklinkaudiosink: Throttle reading from the ringbuffer
The driver has an internal buffer of unspecified and unconfigurable size, and
it will pull data from our ring buffer as fast as it can until that is full.
Unfortunately that means that we pull silence from the ringbuffer unless its
size is by conincidence larger than the driver's internal ringbuffer.

The good news is that it's not required to completely fill the buffer for
proper playback. So we now throttle reading from the ringbuffer whenever
the driver has buffered more than half of our ringbuffer size by waiting
on the clock for the amount of time until it has buffered less than that
again.
2015-02-09 16:22:39 +01:00
Sebastian Dröge
a6bcd09b6c decklinkaudiosink: Start scheduled playback when going to PLAYING
The ringbuffer's acquire() is too early, and ringbuffer's start() will only be
called after the clock has advanced a bit... which it won't unless we start
scheduled playback.
2015-02-09 16:22:39 +01:00
Alessandro Decina
052e4804eb vtdec: fix texture sharing on iOS
Move GLES calls to the context thread. Fix
CVOpenGLESTextureCacheCreateTextureFromImage usage on iOS.
2015-02-09 21:18:24 +11:00
Sebastian Dröge
22b0a4dad5 decklink{audio,video}src: Take the capture times from the pipeline clock
Not from the decklink clock. Both will return exactly the same time once the
decklink clock got slaved to the pipeline clock and received the first
observation, but until then it will return bogus values. But as both return
exactly the same values, we can as well use the pipeline clock directly.
2015-02-08 21:56:04 +01:00
Sebastian Dröge
83e5fe2f70 openslesringbuffer: Only pre-roll a single buffer
There is no reason to pre-roll more buffers here as we have our own ringbuffer
with more segments around it, and we can immediately provide more buffers to
OpenSL ES when it requests that from the callback.

Pre-rolling a single buffer before starting is necessary though, as otherwise
we will only output silence.

Lowers latency a bit, depending on latency-time and buffer-time settings.
2015-02-05 12:28:22 +01:00
Sebastian Dröge
141fb455e8 openslesringbuffer: Allocate at most 4 internal buffers
4 is the "typical" number of buffers defined by Android's OpenSL ES
implementation, and its code is optimized for this. Also because we
have our own ringbuffer around this, we will always have enough
buffering on our side already.

Allows for more efficient processing.
2015-02-05 12:28:13 +01:00
Sebastian Dröge
616cb1bdc6 openslessink/src: Lower default buffer time to 200ms like alsasink 2015-02-05 12:21:55 +01:00
Nicolas Dufresne
5aa292b588 ksvideosrc: Fix missing brace warning
There is more but it's from ks.h GUID initializer, which is shipped
this way with mingw.
2015-02-03 18:16:51 -05:00
Nicolas Dufresne
bd5e9a5442 ksvideosrc: Fix buffer handling
The pseudo buffer pool code was using gst_buffer_is_writable()
alone to try and figure-out if cached buffer could be reused.
It needs to check for memory writability too. Also check map
result and fix map flags.

https://bugzilla.gnome.org/show_bug.cgi?id=734264
2015-02-03 18:16:50 -05:00
Sebastian Dröge
d4d02c6f9d corevideotexturecache: Add some assertions instead of just dereferencing NULL 2015-02-03 17:32:24 +01:00
Sebastian Dröge
b51254395a corevideotexturecache: Don't unconditionally use the CoreMedia meta on iOS
We might instead have a CoreVideo meta.
2015-02-03 17:32:24 +01:00
Sebastian Dröge
dac3e4ca06 vtdec: Don't dereference NULL frames when draining/flushing 2015-02-03 15:38:40 +01: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
77d48abfab applemedia: vtdec: fix CMBlockBufferRef leak
Fix huge leak that went unnoticed for too long. Oops.
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
e91989136a applemedia: corevideobuffer: make mapping the CVPixelBuffer in CPU optional
Mapping is not necessary and impacts performance when doing texture sharing with
downstream
2015-01-30 00:34:08 +11:00
Sebastian Dröge
e9b49018ed decklinkvideosink: Always lock the mutex before starting the streams 2015-01-28 17:02:59 +01:00
Sebastian Dröge
837eee7085 decklinkvideosink: Fix deadlock 2015-01-28 16:59:30 +01:00
Sebastian Dröge
4eb5cd9156 decklink{audio,video}sink: Only start scheduled playback once both sources are ready and we are in PLAYING
Otherwise we might start the scheduled playback before the audio or video streams are
actually enabled, and then error out later because they are enabled to late.

We enable the streams when getting the caps, which might be *after* we were
set to PLAYING state.
2015-01-28 16:13:16 +01:00
Sebastian Dröge
e2ff5587fe decklink{audio,video}src: Only start the streams once both sources are ready and we are in PLAYING
Otherwise we might start the streams before the audio or video streams are
actually enabled, and then error out later because they are enabled to late.

We enable the streams when getting the caps, which might be *after* we were
set to PLAYING state.
2015-01-28 16:13:16 +01:00
Sebastian Dröge
00176a1ddf decklink: Make sure our clock never returns NONE, always advances and does not jump when going from PAUSED to PLAYING
It basically behaves the same as the audio clocks.
2015-01-28 16:13:16 +01:00
Sebastian Dröge
b3a4772834 decklinkvideosink: Handle the clock returning GST_CLOCK_TIME_NONE properly 2015-01-28 16:13:16 +01:00
Sebastian Dröge
8a5d2c561c decklinkvideo{sink,src}: Make elements more similar to the audio elements by enabling the video input/output only when getting the actual caps
This will also make it easier later to support caps changes and support
selecting the mode based on the caps if that should ever be implemented.
2015-01-28 16:13:16 +01:00
Sebastian Dröge
f3ae93e504 decklinkvideosrc: Properly report caps if mode!=auto and handle caps changes properly for mode=auto 2015-01-28 16:13:16 +01:00
Sebastian Dröge
7fb57938c1 decklinkaudiosrc: Don't release input device twice on errors in set_caps() 2015-01-28 16:13:16 +01:00
Sebastian Dröge
c6d5c4c2e1 decklinkaudiosrc: Release the audio input on errors, not the video input 2015-01-26 15:33:45 +01:00
Tim-Philipp Müller
199ce92474 Remove unported directdraw plugin
This API has been deprecated for eternities and microsoft
stopped shipping the headers in 2010 accoding to wikipedia,
so let's just remove it and focus on bringing the plugins
based on the newer APIs up to snuff.
2015-01-24 20:28:16 +00:00
Matthew Waters
c6056b0dd5 applemedia: update for gstgl cocoa -> cgl change 2015-01-23 16:12:24 +11:00
Sebastian Dröge
80e02cbdf9 Constify some static arrays everywhere 2015-01-21 10:18:50 +01:00
Sebastian Dröge
e734c3cf13 decklinkvideosink: Also consider max-lateness property value before dropping late frames 2015-01-15 12:49:46 +01:00
Alessandro Decina
d95a12e185 vtdec: implement the GL texture upload meta 2015-01-15 14:10:43 +11:00