• Philipp Zabel's avatar
    [media] coda: add CODA7541 decoding support · 918c66fd
    Philipp Zabel authored
    This patch enables decoding of h.264 and mpeg4 streams on CODA7541.
    Queued output buffers are immediately copied into the bitstream
    ringbuffer. A device_run can be scheduled whenever there is either
    enough compressed bitstream data, or the CODA is in stream end mode.
    Each successful device_run, data is read from the bitstream ringbuffer
    and a frame is decoded into a free internal framebuffer. Depending on
    reordering, a possibly previously decoded frame is marked as display
    frame, and at the same time the display frame from the previous run
    is copied out into a capture buffer by the rotator hardware.
    The dequeued capture buffers are counted to send the EOS signal to
    userspace with the last frame. When userspace sends the decoder stop
    command or enqueues an empty output buffer, the stream end flag is
    set to allow decoding the remaining frames in the bitstream
    ringbuffer.
    The enum_fmt/try_fmt functions return fixed capture buffer sizes
    while the output queue is streaming, to allow better autonegotiation
    in userspace.
    A per-context buffer mutex is used to lock the picture run against
    buffer dequeueing: if a job gets queued, then streamoff dequeues
    the last buffer, and then device_run is called, bail out. For that
    the interrupt handler has to be threaded.
    Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
    918c66fd
coda.h 12.8 KB