Sebastian Dröge
7fa4616598
omx: Fix refcount problem with frames being dropped because of decoder bugs
2012-11-12 15:14:09 +01:00
Sebastian Dröge
2481ceb8c4
omx: Update to new GLib thread API
2012-11-12 11:29:48 +01:00
Sebastian Dröge
bced70525a
omx: Use open/close vfuncs
2012-10-22 14:34:53 +02:00
Sebastian Dröge
9d0e582484
omx: Handle video meta correctly
2012-10-22 14:28:04 +02:00
Sebastian Dröge
5fdb490f1a
omx: Port to video base classes from -base
2012-10-22 14:20:41 +02:00
Sebastian Dröge
e84fee6488
omx: Fix compilation after gst_pad_start_task() API changes
2012-06-20 11:09:13 +01:00
George Kiagiadakis
158775f497
Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed.
...
According to the OMX specification, implementations are allowed to call
callbacks in the context of their function calls. However, our callbacks
take locks and this causes deadlocks if the unerlying OMX implementation
uses this kind of in-context calls.
A solution to the problem would be a recursive mutex. However, a normal
recursive mutex does not fix the problem because it is not guaranteed
that the callbacks are called from the same thread. What we see in Broadcom's
implementation for example is:
- OMX_Foo is called
- OMX_Foo waits on a condition
- A callback is executed in a different thread
- When the callback returns, its calling function
signals the condition that OMX_Foo waits on
- OMX_Foo wakes up and returns
The solution I came up with here is to take a second lock inside the callback,
but only if recursion is expected to happen. Therefore, all calls to OMX
functions are guarded by calls to gst_omx_rec_mutex_begin_recursion() / _end_recursion(),
which effectively tells the mutex that at this point we want to allow calls
to _recursive_lock() to succeed, although we are still holding the master lock.
2012-05-07 17:01:16 +03:00
Olivier Crête
ff2603a727
Port to Gst 0.11
2012-04-13 12:16:34 -04:00
Jonas Larsson
2cab5b5db5
omxvideoenc: Fix deadlock when using the EOS hack
2011-12-14 10:07:29 +01:00
Sebastian Dröge
3db75118dd
omxvideoenc: Remove workaround for basevideocodec bug
2011-12-12 14:26:48 +01:00
Sebastian Dröge
9e6665e8f8
omx: Add hack for encoder components that don't allow empty EOS buffers
2011-12-09 12:24:01 +01:00
Sebastian Dröge
bd60f141e9
omxvideoenc: Use correct timestamp, duration and filled length for the EOS buffers
2011-12-06 12:46:51 +01:00
Sebastian Dröge
781e61d569
omxvideoenc: Drop EOS events in ::finish()
...
The event will be forwarded downstream from the srcpad
loop function after the last buffer was generated by the
component. Forwarding it after ::finish() will use the
sinkpad streaming thread and does not guarantee that
the encoder is completely drained.
2011-12-05 08:12:48 +01:00
Sebastian Dröge
be4e1e184e
omxvideoenc: First set ports to flushing before waiting for the srcpad streaming thread to finish
2011-11-18 09:59:43 -08:00
Sebastian Dröge
1ba8ec3d37
omxvideoenc: Signal the drain GCond even if downstream returned an error
2011-11-17 11:29:39 -08:00
Sebastian Dröge
2408e0d33a
omxvideoenc: Shutdown component in PAUSED->READY and deallocate buffers
2011-11-17 10:19:47 -08:00
Sebastian Dröge
879349ba11
omxvideoenc: Set force_keyframe to FALSE after handling it
...
There's no reason why the base class should forward the event
further downstream if we already handled it and will insert a
keyframe.
2011-11-16 12:02:08 -08:00
Sebastian Dröge
22ba4e1b9e
omxvideoenc: Add vfunc for handling the output frames
...
This can be used by subclasses to override the buffer flags
or to handle some frames differently than the default behaviour.
2011-11-15 08:28:32 -08:00
Sebastian Dröge
0a4e222e60
omxvideoenc: Make srcpad caps setting threadsafe
2011-11-10 15:17:56 +01:00
Sebastian Dröge
fbe171ee2c
omxvideoenc: Always flush the ports and make sure no processing is happening in ::reset
...
This fixes a race condition that happened when seeking
very often in a short period of time.
2011-11-10 15:02:22 +01:00
Sebastian Dröge
e56cff5f2a
omxvideoenc: Fix minor race condition when draining after upstream signalled EOS
2011-11-10 15:01:36 +01:00
Sebastian Dröge
56bcfc0397
omxvideoenc: Improve EOS handling
...
If downstream return UNEXPECTED we should still signal the
drain cond because nothing will trigger this again later.
2011-11-10 14:56:11 +01:00
Sebastian Dröge
abd399ecbc
omxvideoenc: Improve debugging of EOS and draining
2011-11-10 14:54:17 +01:00
Sebastian Dröge
de7d237851
omxvideoenc: No need to signal the drain cond when going from READY to PAUSED
...
Also the component is not started in READY.
2011-11-10 14:41:50 +01:00
Sebastian Dröge
fb5d700ec9
omxvideoenc: Release the video codec stream lock before acquiring an input buffer
...
Otherwise the srcpad task might block on this lock and
no buffers ever become available again.
2011-11-08 12:47:00 +01:00
Sebastian Dröge
2d6239678f
omxvideoenc: Don't try to drain the component after EOS
...
And don't send EOS twice in any case. This most likely
will cause the component to not output it again and
is not necessary anyway.
2011-11-08 11:10:52 +01:00
Sebastian Dröge
ae6616ad0d
omxvideoenc: Minor code refactoring
2011-11-08 08:31:43 +01:00
Sebastian Dröge
0b301021de
omxvideoenc: Free pending frames after draining the component
2011-11-07 14:00:35 +01:00
Sebastian Dröge
636cdd31bf
omxvideoenc: Make handling and usage of the base video codec frames threadsafe
2011-11-07 11:07:01 +01:00
Sebastian Dröge
9a6cea5af3
omxvideoenc: Fix deadlock between srcpad stream lock and ::reset()
2011-11-07 11:05:29 +01:00
Sebastian Dröge
a80ca97ec3
omxvideoenc: Free all pending frames after draining the component
2011-11-07 10:58:44 +01:00
Sebastian Dröge
3a17d11109
omxvideoenc: Only drain the component a single time and only after processing started
2011-11-04 09:44:04 +01:00
Sebastian Dröge
ef67a43702
omxvideoenc: Better handling of encoder parameters
...
Only set them if necessary and allow to use the component
defaults.
2011-11-02 13:50:14 +01:00
Sebastian Dröge
08fabd6a07
omxvideoenc: Make unsupported bitrate/quantizer settings less fatal
2011-11-02 13:22:50 +01:00
Sebastian Dröge
7ebef2941b
omxvideoenc: If no stride was set for the OMX input port assume GStreamer stride
...
This is not really correct but there's nothing else we could do.
2011-11-02 10:39:10 +01:00
Sebastian Dröge
8eaf25c10e
omxvideoenc: Implement draining of the component and use it
...
This makes sure that all buffers are encoded and pushed downstream
before flushing the ports and losing some buffers.
2011-11-01 16:41:46 +01:00
Sebastian Dröge
21faf556ff
omxvideoenc: Forward downstream flow returns to upstream
2011-11-01 15:10:01 +01:00
Sebastian Dröge
6689faa661
omxvideoenc: Fix deadlock caused by calling reset while the loop function does something with the base video codec stream lock
2011-10-20 15:20:47 +02:00
Sebastian Dröge
ac8085dce9
omxvideoenc: If one parameter/configuration is not supported don't skip the next
2011-10-10 10:38:29 +02:00
Sebastian Dröge
e364088596
omxvideoenc: Switch to Idle first and wait before switching to Loaded and deallocating buffers
...
Allocating buffers before the Idle state is reached can lead to crashes.
2011-09-28 10:35:37 +02:00
Sebastian Dröge
d5452a53b0
omxvideoenc: Add some more checks for correct OMX buffer sizes
2011-09-23 17:04:14 +02:00
Sebastian Dröge
f0fe1148b7
omx: Wait until the Executing state is reached before calling OMX_FillThisBuffer()
...
This correctly works around the QCOM race condition that happens when calling
FTB after setting the new state and before reaching it.
2011-09-14 10:16:41 +02:00
Sebastian Dröge
9eb39ceef2
omxvideoenc: Release basevideocodec stream lock while waiting for a buffer
...
This prevents deadlocks if no empty input buffers are available and
releasing input buffers requires the loop function to handle some
output buffers first.
2011-08-19 09:23:58 +02:00
Sebastian Dröge
75c843670f
omxvideoenc: Use "video/x-raw-yuv" as sink template caps instead of strict I420 caps
2011-08-10 10:24:48 +02:00
Sebastian Dröge
8e422b7cc2
omxvideoenc: Set the state back to StateLoaded even if an error happened
2011-08-10 09:56:30 +02:00
Sebastian Dröge
714ba59b11
omxvideoenc: Don't fail if setting the bitrate or profile is not supported by the component
...
Also always set/get the profile, even if there are no peer caps.
2011-08-02 15:14:37 +02:00
Sebastian Dröge
4329821a0b
omxvideoenc: Add support for forcing the next frame to be a keyframe
2011-07-28 12:58:25 +02:00
Sebastian Dröge
e7b421c131
omxvideoenc: Add support for setting bitrate/quantization related parameters
2011-07-28 12:52:24 +02:00
Sebastian Dröge
decf765502
omxvideoenc: Don't output 0-byte buffers
2011-07-28 12:16:38 +02:00
Sebastian Dröge
8ac445abd8
omxvideo{enc,dec}: Only set/unset flushing state on ports if they were created already
2011-07-25 13:19:06 +02:00
Sebastian Dröge
ae7ed44e6b
omxvideoenc: Try harder to deallocate the buffers after errors happened
2011-07-25 10:47:28 +02:00
Sebastian Dröge
7350dcc8cd
omxvideoenc: Add initial support for stride conversion
2011-07-21 11:15:14 +02:00
Sebastian Dröge
644fa35789
omxvideoenc: Add support for setting codec_data on the srcpad caps
2011-07-21 07:53:25 +02:00
Sebastian Dröge
182a488f49
omxvideoenc: Free/drop GstVideoFrames that resulted in an empty buffer
2011-07-21 07:44:34 +02:00
Sebastian Dröge
c0d304f819
omxvideoenc: Remove obsolete TODO comment
2011-07-21 07:31:05 +02:00
Sebastian Dröge
2343decb3c
omxvideoenc: Add video encoder base class and MPEG4 video encoder
...
Unfortunately requires lots of hacks again to work properly with
Bellagio.
2011-07-20 11:08:18 +02:00