h264dec: Support for frame-processing for interlaced streams For interlaced streams h264parse sends input for both the fields in one pad_push. This results in dcuati decoder to consume data for one field. Settig processCallLevel to FrameLevel processing, decoder will consume both the fields. Signed-off-by: Ramprasad N <x0038811@ti.com>
h264dec: Add a property to set display-delay H264decoder supports display from 0 to 16. Default setting is AUTO where decoder selects display-delay based on the stream's property. For certain usecases like car-play, it requires low delay between decoder and display. Application can now configure display-delay of h264decoder with this property. Signed-off-by: Ramprasad N <x0038811@ti.com>
mpeg2dec: close meta-plane fd in finalize close file descriptor created for meta-plane buffer. omap_bo_dmabuf creates a dup file descriptor for the caller to use the buffers. The caller needs to explicitly close the dup fd to avoid any fd leak. Adding the close of fd for the meta-plane buffer and avoding explict call of dce_buf_lock for this fd. Signed-off-by: Ramprasad N <x0038811@ti.com>
gstducati:Enable error concealment for mpeg2dec For some erroneous streams, decoded output look shaky. Enabling error concealment resolves shakiness issue. MPEG2 decoder expects an MBInfo metata data buffer also to be allocated when error concealment is enabled. MBInfo metata buffer size depends on the resolution of the stream. The size is hardcoded for maximum resoltuion of 1920x1080 and around 3MB of buffer is allocated for metadata buffer. Signed-off-by: Ramprasad N <x0038811@ti.com>
mpeg4dec: skip frame processing for large frame size We have seen some cases where the mpeg4 parser element demuxes the file incorrectly and presents the nal_size as a very large chunk. In such cases, when the ducati plugin tries to copy the buffer into the input buffer it results in a SIGSEGV in the push_input function. The input buffer size is configured as height*width bytes (with some padding) and for the error case, we may overrun the buffer during the memcpy operation. This patch introduces a check to prevent copying beyond the input buffer size. Signed-off-by: Karthik Ramanan <a0393906@ti.com>
decoder: Increase number of buffers in pool In corner cases where the max-ref frames is 3, the pipeline may get locked-up. Ideally waylandsink holds 2 buffers at a time, but there can be cases where the render callback is delayed. This causes 3 buffers to be held by waylandsink. Increasing number of buffers in bufferpool prevents this lock-up. Signed-off-by: Pooja Prajod <a0132412@ti.com>
mpeg2dec: Fix negotiation issue with playbin For certain streams height, width etc are not available in the first parse. This results in playbin not picking ducati for decoding. This has been observed only for mpeg2 streams. So mpeg2dec caps is modified to accept streams even without height and width info. In such cases, the default resolution is assumed to be 1920x1080. Signed-off-by: Pooja Prajod <a0132412@ti.com>
gstducati: Fix memleak due to unreffed codec-data This patch fixes a memleak caused incase of streams with codecdata in the caps. This data is written into a buffer and stored as a part of the codec instance. The buffer needs to be freed after this. The patch also reduces the number of caps copy Signed-off-by: Pooja Prajod <a0132412@ti.com>
gstducati: Fix memleak due to unreffed events and caps There is a memory leak due to unreffed events on gst-ducati. Whenever there is the event is not propagated to the peer element we need to unref the events and then return. Same applies to caps in query. Signed-off-by: Pooja Prajod <a0132412@ti.com>
gstducati decoder: Disable externalpool acceptance The decoder can know the max-ref frames for a stream. This info can be used for optimizing buffer allocation. But this info is available only after first buffer is given to IVA-HD. Since this is a parameter known to the decoder, it is better to let the decoder manage it's own pool, rather than adapting all elements to parse the caps for this info. We used to allocate some extra buffers taking into consideration the buffers held by the sink (=n). This is mainly to avoid a deadlock in case of streams with <=n max-ref frames. To optimize buffer allocation, num_buffers is calculated as MAX(4, max-ref). This ensures no deadlock and minimize buffer allocated incase of streams with higher max-ref. Signed-off-by: Pooja Prajod <a0132412@ti.com>
gst-ducati: Migrate to gst 1.6.3 (V2) The patch has been reworked to apply cleanly on the top-most commit Signed-off-by: Pooja Prajod <a0132412@ti.com>
gst-ducati: Configure bufferpool to pre-allocate buffers A bufferpool can be configured pre-allocate buffers. This restricts the number of buffers available at any point of time to a fixed number. In case of decode this fixed number can be calculated based on max-ref-frames. Signed-off-by: Pooja Prajod <a0132412@ti.com>
viddec: Fix for performing cleanup only during error scenario The patch fixes the condition for initiating cleanup. Fixes issue with commit : ad82046 In the earlier case, the cleanup and exit was being invoked during normal flush case as well. Signed-off-by: Karthik Ramanan <a0393906@ti.com>
Exit application with cleanup for certain process call errors Certain process call return values signify underlying layer crash. In such cases playback would fail and there is no point of subsequent process calls unless restart and resume logic is not implemented. The codec_process return value is matched with DCE_EXDM_UNSUPPORTED, DCE_EIPC_CALL_FAIL, DCE_EINVALID_INPUT and matched with FAIL case to cleanup and exit. Signed-off-by: Pooja Prajod <a0132412@ti.com>