Commit graph

43 commits

Author SHA1 Message Date
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