[vlc-devel] [PATCH 3/3] codec/mmal: Add MMAL-based decoder plugin
Dennis Hamester
dennis.hamester at gmail.com
Mon Apr 7 20:31:01 CEST 2014
On 04/07/2014 07:56 PM, Jean-Baptiste Kempf wrote:
> 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 ?
As far as I am aware, yes.
>
>> + 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
Maybe you'll find some in the upcoming V2 patches... ;-)
>
>> +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.
Yeah you're right. However, we have variable declarations always at the
beginning of a function and I'd like to keep it consistent.. although I
personally prefer to declare stuff where I need it.
Best
Dennis
>
> With my kindest regards,
>
More information about the vlc-devel
mailing list