Commit graph

2170 commits

Author SHA1 Message Date
Ilya Konstantinov
6101fc57b8 vtenc: free input buffer ASAP
VTCompressionSessionEncodeFrame retains the CVPixelBuffer during
encoding, and will release it as soon as it can (e.g. before it even
calls our callback). This means we can safely release input buffer
at this point, possibly allowing the system to reuse it sooner.

https://bugzilla.gnome.org/show_bug.cgi?id=750671
2015-06-10 10:30:23 +02:00
Ilya Konstantinov
f5c29c7379 vtenc: Add missing gst_vtenc_frame_free() in error path
https://bugzilla.gnome.org/show_bug.cgi?id=750668
2015-06-10 10:26:28 +02:00
Ilya Konstantinov
5db08a8b89 vtenc: add alignment=au to sink caps
VT compression callback gets a CMSampleBuffer per frame, so vtenc_h264
should set 'alignment=au' in sink caps to indicate this.

https://bugzilla.gnome.org/show_bug.cgi?id=750635
2015-06-10 10:20:44 +02:00
Chris Clayton
376d831178 uvch264src: fix compiler warnings
https://bugzilla.gnome.org/show_bug.cgi?id=750601
2015-06-09 18:30:55 +01:00
Ilya Konstantinov
05cc418ca2 avfassetsrc: fix huge memory leak
CMSampleBuffers were retained -> huge memory leak.

https://bugzilla.gnome.org/show_bug.cgi?id=750638
2015-06-09 16:36:41 +02:00
Ilya Konstantinov
faf903720a vtenc: no need for queue_length with try_pop 2015-06-09 16:20:06 +02:00
Ilya Konstantinov
1f7681dd0a vtdec: don't copy meta from input to output
Copying arbitrary metas is going to cause problems and this should really be
handled by the base class. It overrides most other things already anyway,
including timestamp and duration. Those are just set here now so we can
insert the frame sorted into the queue.

https://bugzilla.gnome.org/show_bug.cgi?id=748922
2015-06-09 16:20:06 +02:00
Thiago Santos
045bfa10fe Fix a common typo: retreive -> retrieve
Seems to have been copy pasted around a few places
2015-06-05 09:43:35 -03:00
Tim-Philipp Müller
96d1331679 ksvideosrc: fix logic and timestamp non-muxed streams again
https://bugzilla.gnome.org/show_bug.cgi?id=750381
2015-06-04 13:31:56 +01:00
Sebastian Dröge
d221108857 amc: Only lower ranks of OMX.Exynos. audio codecs, the video codecs are actually working 2015-06-01 20:03:22 +02:00
Sebastian Dröge
bf07b52477 amc: Give marginal rank to codecs that start with OMX.Exynos.
OMX.Exynos. codecs are existing on some devices like the
Galaxy S5 mini, and cause random crashes (of the device,
not the app!) and generally misbehave. That specific device
has other codecs that work with a different name, but let's
just give them marginal rank in case there are devices that
have no other codecs and these are actually the only working
ones
2015-06-01 19:41:21 +02:00
Sebastian Dröge
2e0395aa59 androidmedia: Give lower ranks to codecs not starting with OMX.
On some devices there are codecs that don't start with OMX., while
there are also some that do. And on some of these devices the ones
that don't start with OMX. just crash during initialization while
the others work. To make things even more complicated other devices
have codecs with the same name that work and no alternatives.
So just give a lower rank to these non-OMX codecs and hope that
there's an alternative with a higher rank.

Also stagefright gives codecs starting with OMX. a higher rank too and
considers other codecs that don't start with OMX. as software codecs.
2015-06-01 19:41:21 +02:00
Nicolas Dufresne
4cca6efda8 vtdec: Require width and height field for H264
This decoder does not work if width and height field are not set
in the sinkpad caps. Let's make this explicit by adding them to
the template caps.

https://bugzilla.gnome.org/show_bug.cgi?id=749655
2015-06-01 11:23:41 -04:00
Ilya Konstantinov
94e7ed1323 vtenc: fix keyframe request race condition
It is incorrect to modify the frame properties after passing them, since
VTCompressionSessionEncodeFrame takes reference and we have no control
over when it's being used.

In fact, the code can be simplified. We just preallocate the frame
properties for keyframe requests, and pass NULL otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=748467
2015-06-01 13:32:03 +02:00
Sebastian Dröge
a6fb482247 androidmedia: Conditionally use get_{input,output}_buffer() Android 21 APIs
Also properly set limit/position on byte buffer, some codecs prefer to have
correct values there.
2015-05-31 21:27:27 +02:00
Jan Schmidt
e7381ed17a wasapi: Fix flags order for uninstalled build 2015-05-21 13:42:29 +10:00
Sebastian Dröge
8bacecfb08 amcaudiodec: Add an output adapter for chunking the output into codec frames
Otherwise the base class will be confused.
See https://bugzilla.gnome.org/show_bug.cgi?id=685730
2015-05-19 19:12:41 +03:00
Ilya Konstantinov
c948484c7f avfvideosrc: fix unconditional buffer queue unlock
Unless stopRequest is set, we should unlock conditionally -- otherwise,
the 'create:' method can wake up to an empty buffer queue
and pull a nil buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=748054
2015-05-11 21:11:30 +10:00
Heinrich Fink
6007829e77 decklink: Rename mode 2048p to 1556p
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:20:11 +03:00
Heinrich Fink
1dabd7c5b8 decklink: Use correct frame rate for mode 2160p50
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:14:39 +03:00
Heinrich Fink
e6d82dec32 decklink: Rename mode 3184p to 2160p
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:14:15 +03:00
Sebastian Dröge
7020154f1c vtdec: We shouldn't manually check reconfigure flag on pads but instead implement ::negotiate()
Add FIXME comment related to that.
2015-05-08 15:08:18 +02:00
Matthieu Bouron
3c77fbda87 androidmedia: Add suport for COLOR_FormatYV12
Reference: http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12

https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 12:45:12 +02:00
Matthieu Bouron
bd21df1056 androidmedia: Declare QOMX_COLOR_FORMATYVU420PackedSemiPlanar32mMultiView constant
This color format is the same as QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m
but stores two images one after the other in a top-bottom layout.

https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 12:44:56 +02:00
Matthieu Bouron
21ff3ae0b0 androidmedia: Fix slice-height for Tegra 3 devices
https://bugzilla.gnome.org/show_bug.cgi?id=748867
2015-05-04 10:39:38 +02:00
Edward Hervey
8d41c3e393 androidmedia: Add support for COLOR_FormatYUV420Flexible
https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 09:34:29 +02:00
Edward Hervey
0654442c8f androidmedia: Add suport for Intel color formats
https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 09:34:15 +02:00
Andoni Morales Alastruey
1991b5bb6f ksvideosrc: don't timestamp buffers for muxed streams 2015-04-29 21:41:55 +02:00
Andoni Morales Alastruey
20e5a4a498 ksvideosrc: fix header size for muxed streams 2015-04-29 21:41:48 +02:00
Руслан Ижбулатов
a31855d618 GstDeviceProvider implementation for WIN Kernel Streaming plugin
gst_ks_device_provider_probe() is a no-braier, just runs ks_enumerate_devices()
and reports the results.

Monitoring is a bit more tricky. We have to create a dummy message-processing
window and register device change notifications for it.

As kernel streaming can (and should) be used for audio capture and audio
playback, this change also has certain placeholders for such.

https://bugzilla.gnome.org/show_bug.cgi?id=747757
2015-04-28 20:24:26 -04:00
Ilya Konstantinov
528871f571 avfvideosrc: drop frames we get before we have a clock
https://bugzilla.gnome.org/show_bug.cgi?id=748054
2015-04-26 20:37:11 +02:00
Tim-Philipp Müller
699452ef31 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:59:32 +01:00
Yujin Lee
a8ea7a9cfb vtdec: fix build error with clang
This commit fixes a simple build error by clang with
by clang with [-Werror,-Wtautological-pointer-compare] options.

https://bugzilla.gnome.org/show_bug.cgi?id=748110
2015-04-26 19:23:06 +02:00
Josep Torra
cf66541850 decklinkvideosrc: fix mode autodetection
The autodetection mode was broken because a race condition in the input mode
setting. The mode could be reverted back when it was replaced in
the streaming thread by the old mode in the middle of mode changed callback.
2015-04-22 17:20:22 +02:00
Josep Torra
6b70b848ee decklink: do not repeat first video format in caps template
The first entry in the modes array is used as default mode for autodetection.
There's no need to copy it into the caps template.
2015-04-22 17:20:21 +02:00
Edward Hervey
af49c109e4 shmpipe: Ensure string received from recv() is NULL-terminated
We will be doing string operations on it later.

CID #1292830
2015-04-20 14:21:09 +02:00
Alessandro Decina
edf9035d02 applemedia: avoid implicit color conversions
Rework the GL texture code a little to avoid implicit color conversion inside
AVF/VT on both iOS and OSX.
2015-04-20 17:09:58 +10:00
Ilya Konstantinov
c98eb6f2f5 corevideotexturecache: free texture cache on iOS
https://bugzilla.gnome.org/show_bug.cgi?id=748122
2015-04-19 14:48:43 +02:00
Ilya Konstantinov
472d1959a2 avfvideosrc: check for failure to create buffer
gst_core_media_buffer_new and gst_core_video_texture_cache_get_gl_buffer
can fail for various platform reasons.

https://bugzilla.gnome.org/show_bug.cgi?id=748122
2015-04-19 14:48:11 +02:00
Yujin Lee
4a88951c52 avfvideosrc: fix build failure with clang
Use fabs for floating point input.

https://bugzilla.gnome.org/show_bug.cgi?id=748128
2015-04-19 12:54:32 +01:00
Sebastian Dröge
774866ad62 androidmedia: Handle queue/release errors non-fatal
They can happen sometimes as a transient problem, e.g. if there
is a problem in the stream. Only handle them as fatal if many of
them happen in a row.
2015-04-17 20:11:46 +02:00
Ilya Konstantinov
a02a948a5d avfvideosrc: get connection and input clock early 2015-04-18 00:33:42 +10:00
Ilya Konstantinov
d1120c591c avfvideosrc: remove unused variables
Complement commit 5496fd3e75 by removing
the involved variables.
2015-04-15 10:16:17 +10:00
Alessandro Decina
a10232f7da applemedia: vtdec: fix GL negotiation 2015-04-14 20:33:25 +10:00
Alessandro Decina
3e0391a1f1 avfvideosrc: log timestamps 2015-04-14 18:05:58 +10:00
Ilya Konstantinov
5bc17dac29 avfvideosrc: subtract time spent in AVF queues
The time spent in AVF queues was being incorrectly added to running time
rather than subtracted.
2015-04-14 18:05:58 +10:00
Ilya Konstantinov
1b27538648 avfvideosrc: fix GL texture negotiation
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE should no longer be used.
Instead, just get the GL context.

https://bugzilla.gnome.org/show_bug.cgi?id=747352
2015-04-14 18:05:57 +10:00
Sebastian Dröge
91853015b7 winks: Reset DTS to GST_CLOCK_TIME_NONE
Otherwise we might get a previous DTS set from a recycled buffer that we get
back from a buffer pool, which then confuses synchronization.

https://bugzilla.gnome.org/show_bug.cgi?id=747722
2015-04-12 13:01:56 +02:00
Sebastian Dröge
265538ac6e amc: Use new JNI utils almost everywhere 2015-04-11 19:44:34 +02:00
Sebastian Dröge
7fb0fafed2 amc: Allow creating global and local references of objects 2015-04-11 19:37:34 +02:00
Sebastian Dröge
6c7b64f90c amc: Make GError argument order more consistent 2015-04-11 19:37:34 +02:00
Sebastian Dröge
448867f0aa amc: Add helper function for getting a direct buffer array 2015-04-11 19:37:20 +02:00
Sebastian Dröge
0dbf5d322f amc: Java longs are gint64s 2015-04-11 19:37:20 +02:00
Sebastian Dröge
0914ee4a07 amc: Improve JNI utilities and add some missing ones
We now fill GErrors for everything that could throw an exception, and method
calls now always return a gboolean and their value in an out-parameter to
distinguish failures from other values.
2015-04-11 19:37:20 +02:00
Tim-Philipp Müller
ea58a2138d winks: fix debug message parameter format
The first part of the GUID structure is a DWORD
which is defined as an unsigned long, so we need
to either cast or use %08lx.
2015-04-11 12:12:57 +01:00
Andoni Morales Alastruey
83a54e07fd ksvideosrc: fix support for DV devices 2015-04-08 18:54:52 +02:00
Andoni Morales Alastruey
7bc0fa5d70 ksvideosrc: only list capture devices 2015-04-08 18:45:08 +02:00
Arun Raghavan
b40adec9c1 opensles: Explicitly specify layout=interleaved in caps
This is fine to hard-code. Section 9.1.8 of the OpenSL ES 1.1
specification, it is expected that multi-channel audio is always
interleaved.
2015-04-08 15:38:17 +05:30
Ilya Konstantinov
4fd0f7277a avfvideosrc: fix setting of buffer offset end
Don't set offset end to random values off the stack.

https://bugzilla.gnome.org/show_bug.cgi?id=747352
2015-04-07 12:57:44 +01:00
Guillaume Emont
48880ea6c7 shmsink: add an shm-area-name property
The shm-area-property tells the name of the shm area used by the element. This
is useful for cases where shmsink is not able to clean up (calling
shm_unlink()), e.g. if it is in a sandbox.

https://bugzilla.gnome.org/show_bug.cgi?id=675134
2015-04-02 18:11:37 -04:00
Victor Toso
1b564bfb8b directsoundsrc: Implement volume and mute
Using the MixerAPI as IDirectSoundCaptureBuffer doesn't implement volume
control.

https://bugzilla.gnome.org/show_bug.cgi?id=744383
2015-03-31 10:53:55 +01:00
Sebastian Dröge
35ef602b7d androidmedia: Add helpers for calling static methods 2015-03-15 16:59:25 +00:00
Sebastian Dröge
1580336152 androidmedia: Fix indention 2015-03-15 16:41:12 +00:00
Matthieu Bouron
66f315d6a6 androidmedia: Add more JNI helper functions 2015-03-15 16:28:03 +00:00
Matthieu Bouron
be2378a071 androidmedia: Split jni code to gstjniutils.c 2015-03-15 16:28:03 +00:00
Tim-Philipp Müller
bcde1a015c Remove unported and useless osxvideosrc element
There are other elements for this now.
2015-03-14 14:47:25 +00:00
ijsf
f62dda74cc Restricted activeVideoMaxFrameDuration to fix frame rate 2015-03-13 14:43:14 +00:00
Jan Schmidt
f150cf2d2e Remove a bunch of silly ';;' typos at the end of lines 2015-03-12 01:33:03 +11:00
Edward Hervey
4b5d3a97ba androidmedia: Remove unused label/variable 2015-03-11 10:17:53 +01:00
Sebastian Dröge
160df421ea vtdec: Register a hardware-only vtdec_hw on OSX and give it a higher rank
while having the default vtdec at secondary rank. This allows decodebin/playbin
to prefer the hardware based decoders, and if that fails to initialize because
hardware resources are busy to fall back to e.g. the libav based h264 decoder
instead of the software based vtdec (which is slower), and only fall back to
the software based vtdec if there is no higher ranked decoder available.
2015-03-07 10:31:26 +01:00
Florian Zwoch
a8ae57480c avfvideosrc: allow "capture-screen" mode to select which screen to capture via the "device-index" option
https://bugzilla.gnome.org/show_bug.cgi?id=745161
2015-03-06 10:37:37 +01:00
Sebastian Dröge
254337365a decklinkaudiosrc: Calculate the duration more accurately from the capture time and numbers of samples
This should prevent any accumulating rounding errors with the duration.
2015-03-04 16:13:30 +01:00
Sebastian Dröge
912e58c64c decklinkaudiosrc: Fix the timestamp and offset calculations even more 2015-03-04 16:07:10 +01:00
Sebastian Dröge
1f9d37c924 decklinkaudiosrc: Don't subtract the duration from the capture time
We already have the real capture time, not the time when we received
the end of the packet.
2015-03-04 16:04:18 +01:00
Matthew Waters
0593480381 applemedia/avsamplesink: utilise a pull based approach of displaying video frames
Using requestMediaDataWhenReadyOnQueue the layer will execute a block
when it would like more frames. Using this we can provide the current
frame and avoid needlessly filling the layer's buffer queue causing
older frames to be displayed when under resource pressure.
2015-03-04 14:48:03 +11:00
Sebastian Dröge
4521524de3 decklink: Reset the clock calibration when unsetting the master clock
Otherwise the old calibration will stick around for the next time we use it,
potentially giving us completely wrong times.
2015-03-02 16:45:45 +01:00
Sebastian Dröge
8e362aab14 decklink{audio,video}src: Add some more debug output 2015-03-02 13:57:24 +01:00
DanielD10
034ed48023 decklink: Incorrect frame rate for interlaced modes
https://bugzilla.gnome.org/show_bug.cgi?id=744386
2015-03-02 11:59:31 +01:00
Sebastian Dröge
72b440cc89 decklinkvideosrc: Fix scaling with rate of internal/external clock 2015-02-27 11:08:14 +02:00
Roman Nowicki
29098129be d3dvideosink: release existing D3D swap chain on init
https://bugzilla.gnome.org/show_bug.cgi?id=745159
2015-02-25 16:19:57 +02:00
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