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

Jean-Baptiste Kempf jb at videolan.org
Mon Apr 7 19:56:42 CEST 2014


On 04 Apr, Julian Scheel wrote :
> +#define MMAL_ZEROCOPY_NAME "mmal-zerocopy"
> +#define MMAL_ZEROCOPY_TEXT N_("Decode frames directly into RPI VideoCore instead of host memory.")
> +#define MMAL_ZEROCOPY_LONGTEXT N_("Decode frames directly into RPI VideoCore instead of host memory. This option must only be used with the MMAL video output plugin.")

I think we should get a string more generic for this, to avoid every
hw-decoder to add a useless string to translate :)

But that's beside this patch.

> +static int OpenDecoder(decoder_t *dec);
> +static void CloseDecoder(decoder_t *dec);
> +
> +vlc_module_begin()
> +    set_shortname(N_("MMAL decoder"))
> +    set_description(N_("MMAL-based decoder plugin for Raspberry Pi"))

MMAL only exists on rPi ?

> +    sys->input_pool = mmal_pool_create_with_allocator(sys->input->buffer_num, sys->input->buffer_size, sys->input, (mmal_pool_allocator_alloc_t)mmal_port_payload_alloc, (mmal_pool_allocator_free_t)mmal_port_payload_free);

You can do longer :) :D

> +static void fill_output_port(decoder_t *dec)
> +{
> +    decoder_sys_t *sys = dec->p_sys;
> +    unsigned buffers_available = mmal_queue_length(sys->output_pool->queue);
> +    unsigned buffers_in_transit = sys->output_pool->headers_num - buffers_available - mmal_queue_length(sys->decoded_pictures);
> +    unsigned buffers_to_send = sys->output->buffer_num_recommended - buffers_in_transit;
> +    unsigned i;
> +
> +    if (buffers_to_send > buffers_available)
> +        buffers_to_send = buffers_available;
> +
> +    for (i = 0; i < buffers_to_send; ++i)

You can use C99 for.

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list