[vlc-devel] [PATCH 3/3] codec/mmal: Add MMAL-based decoder plugin

Julian Scheel julian at jusst.de
Mon Apr 7 09:06:45 CEST 2014


On 07.04.2014 08:52, Martin Storsjö wrote:
> On Fri, 4 Apr 2014, Julian Scheel wrote:
>
>> From: Dennis Hamester <dennis.hamester at gmail.com>
>>
>> This plugin is capable of decoding MPEG-2 and H264 video through the
>> Multi
>> Media Abstraction Layer (MMAL) by Broadcom. It is supported by recent
>> Broadcom
>> SoCs and found on the widely spread Raspberry Pi.
>>
>> Signed-off-by: Dennis Hamester <dennis.hamester at gmail.com>
>> Signed-off-by: Julian Scheel <julian at jusst.de>
>> ---
>> configure.ac              |  10 +
>> modules/codec/Makefile.am |  10 +
>> modules/codec/mmal.c      | 566
>> ++++++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 586 insertions(+)
>> create mode 100644 modules/codec/mmal.c
>
>> +    while (block->i_buffer > 0) {
>> +        buffer = mmal_queue_timedwait(sys->input_pool->queue, 2000);
>> +        if (!buffer) {
>> +            msg_Err(dec, "Failed to retrieve buffer header for input
>> data");
>> +            break;
>> +        }
>> +        mmal_buffer_header_reset(buffer);
>> +        buffer->cmd = 0;
>> +        buffer->pts = block->i_pts;
>> +        buffer->dts = block->i_dts;
>> +
>> +        len = block->i_buffer;
>> +        if (len > buffer->alloc_size)
>> +            len = buffer->alloc_size;
>> +
>> +        memcpy(buffer->data, block->p_buffer, len);
>> +        block->p_buffer += len;
>> +        block->i_buffer -= len;
>> +
>> +        buffer->length = len;
>> +        buffer->flags = flags;
>> +
>> +        status = mmal_port_send_buffer(sys->input, buffer);
>> +        if (status != MMAL_SUCCESS) {
>> +            msg_Err(dec, "Failed to send buffer to input port
>> (status=%"PRIx32" %s)", status, mmal_status_to_string(status));
>> +            break;
>> +        }
>> +    }
>
> Does the decoder support the MP4 NAL format of H264 as well, or is that
> untested and you'd need to reformat that into annex b, as we do in OMX?

MP4 NAL shall work out of the box with the decoder. I think Dennis has 
tested it. I did my testing mostly with annex b as seen in DVB broadcasts.

-Julian



More information about the vlc-devel mailing list