summaryrefslogtreecommitdiff
path: root/sys/v4l2codecs
Commit message (Collapse)AuthorAgeFilesLines
* v4l2codecs: h264: Add missing breakNicolas Dufresne2020-05-211-0/+1
| | | | | | | | | | There was a missing break for the 4:4:4 case which would break the sizeimage calculation. We don't currently have hardware that supports 4:4:4, so this code wasn't tested. This was detected by Coverity. CID 1463592 1463591 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1283>
* v4l2slh264dec: Request large enough bitstream bufferNicolas Dufresne2020-05-194-4/+43
| | | | | | | | | The Cedrus driver would otherwise choose 1KB buffer, which is too small. This follows what some drivers do, which is simply to use the size a packed raw image would have. Specifications do not really guaranty any minimum compression ratio. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
* v4l2slh264dec: Add slice based decoder supportNicolas Dufresne2020-05-194-36/+263
| | | | | | | | | This adds support for slice based decoder like the Allwinner/Cedrus driver. In order to keep things efficient, we hold the sink buffer until we reach the end of the picture. Note that as we don't know which one is last, we lazy queue the slices. This effectively introduces one slice latency. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
* v4l2codecdec: Fix error handlingNicolas Dufresne2020-05-192-0/+10
| | | | | | | If none of the format the HW produce is supported, the fiter will be NULL, which would lead to assertion when trying to release it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
* v4l2decoder: Add legacy non-multiplanar supportNicolas Dufresne2020-05-192-54/+136
| | | | | | | | The Cedrus driver uses the lagacy buffer type (non-mplane). This automatically detect and use the right v4l2_buf_type. This also affect code using v4l2_buffer and v4l2_format structures. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
* v4l2codecs: Update kernel headersNicolas Dufresne2020-05-195-9/+82
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
* codecs: h264decoder: ref pic lists as decode_slice parametersVíctor Manuel Jáquez Leal2020-05-191-1/+2
| | | | | | | | Pass reference picture lists to decode_slice() vmethods Change gstv4l2codech264dec and gstnvh264dec accordingly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
* v4l2codecs: Fix compilation error on FreeBSDTing-Wei Lan2020-05-114-2/+21
| | | | | | | | | | | | This commit does the following things to fix compilation on FreeBSD: 1. Add required typedefs to linux/types-compat.h. 2. Remove unnecessary include linux/ioctl.h and replace linux/types.h with linux/types-compat.h. Both files do not exist on FreeBSD. 3. Check the header including makedev macro. FreeBSD does not have sys/sysmacros.h, and including it unconditionally causes error. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1259>
* v4l2slvp8dec: Flip the meaning of segment_feature_modeNicolas Dufresne2020-05-051-1/+1
| | | | | | | | | | | | | | | In section 9.3.4 a), segment_feature_mode have 0 for absolute and 1 for delta, while in 19.2, it says the opposite. But the reference code, which usually rules over the text state that 1 means absolute: if (hdr->update_data) { hdr->abs = bool_get_bit(bool); And uses it with that meaning to decide weither to override the existing value or just add the detla. This fixes multiple decoding issues. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
* v4l2slvp8dec: Copy header versionNicolas Dufresne2020-05-051-0/+1
| | | | | | This field was not copied. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
* v4l2slvp8dec: Add debugging for reference framesNicolas Dufresne2020-05-051-0/+5
| | | | | | This simply trace the frame number of the references used for decoding. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
* v4l2slvp8dec: Ensure width/height is always setNicolas Dufresne2020-05-051-2/+2
| | | | | | | | Our parser strictly read the bitstream. As it's known from DXVA that always having a valid width/height might be needed, use the cached width/height instead of the value from the parser. This didn't impact Hantro driver. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
* v4l2slvp8dec: Fix debug category nameNicolas Dufresne2020-05-051-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
* v4l2codecs: Factor out plugin registrationNicolas Dufresne2020-04-285-72/+59
| | | | | | | This introduce a common place for generic functions and factor out the plugin registration code. This code is nearly identical between implementation. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
* v4l2decoder: Relax width/height return value checkNicolas Dufresne2020-04-281-2/+1
| | | | | | | The driver adjust the width/height to coded size. This was not an issue for H264, as the coded size is in the bitstream, but is an issue with VP8. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
* v4l2codecs: Add VP8 decoderNicolas Dufresne2020-04-285-0/+1082
| | | | | | | This is derived from the H264 decoder, some boiler plate will be factored out in the following commits. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
* v4l2slh264dec: Support avc and avc3 formatsSeungha Yang2020-04-231-1/+2
| | | | | | | | h264decoder baseclass provides parsed sps/pps (from codec data) for subclass. Also, since current implementation is putting start code prefix manually, the format of stream should not be matter for subclass. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1214>
* v4l2codecs: allocator: use gst_clear_objectVíctor Manuel Jáquez Leal2020-04-201-1/+1
| | | | So tracer can do its job.
* v4l2codecs: fix v4l2codecdevice get typeVíctor Manuel Jáquez Leal2020-04-102-4/+2
| | | | | Currently the GType of v4l2codecdevice is hardcoded to zero, but it rather should be delivered by the GType system.
* v4l2codecs: Fix FD leak during device enumerationNicolas Dufresne2020-04-081-1/+6
| | | | | | This was revealed by Coverity. CID 1461248
* v4l2decoder: Fix file descriptor leakNicolas Dufresne2020-04-071-1/+1
| | | | | | | A copy paste error was leading to file descriptor leak. This was detected by Coverity. CID 1461285
* v4l2codecs: Only build this plugin on LinuxNicolas Dufresne2020-03-311-1/+14
| | | | | This is not useful on any other OSs, it will also avoid potential build failure as this code uses Linux specific calls.
* v4l2codecs: Add plugin dependencyNicolas Dufresne2020-03-311-0/+7
| | | | | This ensure that the registry cache get updated when a meaningful change is made in /dev for files named media*.
* v4l2codecs: Wait for buffers to come backNicolas Dufresne2020-03-313-17/+89
| | | | | | This code add required mechanism to try and allocate (not implemented yet) otherwise wait for more buffers. This also comes with mechanism to terminate the wait on flush or PAUSED_TO_READY transitions.
* v4l2codecs: Implement flushing sequenceNicolas Dufresne2020-03-313-0/+27
| | | | | This simply consit of cycling through STREAMOFF/STREAMON with stateless decoders.
* v4l2codecs: allocator: Add method to wait for more buffersNicolas Dufresne2020-03-312-0/+48
| | | | | This add function to wait for buffers to get back into the pool along with a set_flushing() method to allow unblocking this wait.
* v4l2codecs: pool: Create new buffer when pool is emptyNicolas Dufresne2020-03-311-9/+19
| | | | | This simply create an empty GstBuffer when the pool is empty. This way it's up to the allocator to grow or wait if we ran out of memory.
* v4l2slh264dec: Improve end_picture() robustnessNicolas Dufresne2020-03-311-21/+27
| | | | | | Use a goto to ensure that for all cases we cleanup the current picture state. And move the src buffer allocation higher, so we don't queue a bitstream buffer if we don't have a picture buffer to decode into.
* v4l2slh264dec: Add output format negotiationNicolas Dufresne2020-03-314-9/+123
| | | | | | This allow negotiating the output format through caps. Some drivers can pipeline the decoder buffer through an image processor. This only support colorspace conversion for now.
* v4l2format: Convert between V4L2 and GST video formatNicolas Dufresne2020-03-312-0/+46
| | | | This will be needed in the output format negotiation.
* v4l2codecs: Read driver provided strideNicolas Dufresne2020-03-311-3/+41
| | | | | | This implements driver stride support but only for single allocation buffers. This code is imported from the original v4l2 plugin and adapted to the new helper context.
* v4l2h264dec: Copy frames when GstVideoMeta is not supportedNicolas Dufresne2020-03-311-0/+74
| | | | | | | In some case, when downstream does not support GstVideoMeta, we need to normalize the stride and offset of the buffer so that downstream can render properly with a GstVideoMeta. This code is not called when GstVideoMeta is supported downstream.
* v4l2codec: Add initial GstVideoMeta supportNicolas Dufresne2020-03-312-2/+30
| | | | | | In this patch we strictly set the GstVideoMeta width/height to the coded width and height. Further patches will add stride support and frame copying when downstream does not support GstVideoMeta.
* v4l2slh264dec: Prevent spurious renegotiationNicolas Dufresne2020-03-311-0/+7
| | | | | Don't let downstream cause a renegotiation at random point in time. This would lead to spurious renegotiation and the decoder state may not be recoverable.
* v4l2slh264dec: Hold on picture buffersNicolas Dufresne2020-03-311-2/+4
| | | | | These buffers should not be reused for decoding until they are no longer referenced.
* v4l2codecs: Fix bytesused valueNicolas Dufresne2020-03-313-5/+13
| | | | | Pass the actual amount of bytes we have copied into the bitstream buffer. Also unmap the memory before queuing.
* v4l2codech264dec: Implement finish frameNicolas Dufresne2020-03-311-5/+82
| | | | | This enables the request to be processed by the HW (STREAMON) and to be pushed downstream for further processing.
* v4l2codecdecoder: Add support for dequeuing buffersNicolas Dufresne2020-03-312-17/+146
| | | | This includings polling of the request and streamon/streamoff.
* v4l2codech264dec: Implement queuingNicolas Dufresne2020-03-311-0/+105
| | | | | | We now pass the controls, associated to a request, queue the bitstream, qeueue a picture buffer to decode into and finally queue the request. This now runs until the buffer pool is exhausted. The next step will be to dequeue.
* v4l2decoder: Add helpers to queue buffer and requestsNicolas Dufresne2020-03-312-0/+190
|
* v4l2codec: Add getter for buffer index in allocator and poolNicolas Dufresne2020-03-314-0/+23
|
* v4l2h264codecdec: Copy bitstream parameter and dataNicolas Dufresne2020-03-312-4/+232
| | | | | | In this patch we fill the control structure with the bitstream paramter and copy the bitstream data into V4L2 memory. Slice paramters are only the subset of what Hantro needs, without any support for interlaced content.
* v4l2slh264dec: Use the newly introduced allocator / poolNicolas Dufresne2020-03-311-1/+54
| | | | We now allocate and free the memory needed for streaming.
* v4l2codec: Add allocator and pool implementationNicolas Dufresne2020-03-315-1/+523
| | | | | | This is a pooling allocator and the buffer pool does nothing other then reusing the GstBuffer structure. Note that the pool is an internal pool, so the start/stop/set_config virtual functions are not implemented.
* v4l2codec: decoder: Add allocation helperNicolas Dufresne2020-03-312-0/+92
|
* v4l2codecs: Implement H264 format negotiationNicolas Dufresne2020-03-313-10/+178
|
* v4l2codecs: Add initial formats helpersNicolas Dufresne2020-03-313-0/+108
|
* v4l2codecs: Add skeleton of H264 decoderNicolas Dufresne2020-03-316-4/+393
| | | | | | | This introduces the skeleton of the H264 decoder. The plugin will list the devices and register a subclass of the GstV4L2CodecH264Dec base class. The subclass will pick the required specific information from the GstV4L2Device stored in the subclass structure.
* v4l2codec: Add GstV4L2Deocder helper objectNicolas Dufresne2020-03-313-0/+267
| | | | | | | This is a GstObject which will be used to hold on media and video device file descriptor and provide abstracted ioctl calls with these descriptor. At the moment this helper contains just enough to enumerate the supported format. This part will be used by the plugin to register the CODEC specific elements..
* v4l2codecs: Copy all needed Linux kernel headersNicolas Dufresne2020-03-316-0/+4449
| | | | | | Most of the features we need are very early or not expose yet in the uAPI. Using an internal copy ensure that we everything we need is defined avoiding to add load of checks and conditionnal code.