[vlc-devel] [PATCH 2/2] Add a simple raw hevc demux

Jean-Baptiste Kempf jb at videolan.org
Mon Feb 10 16:48:14 CET 2014


On 09 Feb, Denis Charmet wrote :
> +#define FPS_TEXT N_("Frames per Second")
> +#define FPS_LONGTEXT N_("Desired frame rate for the HEVC stream.")

I don't see the need for yet another string.

> +    set_description( N_("HEVC video demuxer" ) )

But not H.265?

> +/*****************************************************************************
> + * Open: initializes demux structures
> + *****************************************************************************/
> +static int Open( vlc_object_t * p_this )
> +{
> +    demux_t     *p_demux = (demux_t*)p_this;
> +    demux_sys_t *p_sys;
> +    const uint8_t *p_peek;
> +    es_format_t fmt;
> +
> +    if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
> +
> +    if( p_peek[0] != 0x00 || p_peek[1] != 0x00 ||
> +        p_peek[2] != 0x00 || p_peek[3] != 0x01 ||
> +        (p_peek[4]&0xFE) != 0x40 ) /* VPS & forbidden zero bit*/
> +    {
> +        if( !p_demux->b_force )
> +        {
> +            msg_Warn( p_demux, "hevc module discarded (no startcode)" );
> +            return VLC_EGENERIC;
> +        }
> +
> +        msg_Err( p_demux, "this doesn't look like a HEVC ES stream, "
> +                 "continuing anyway" );
> +    }
> +
> +    p_demux->pf_demux  = Demux;
> +    p_demux->pf_control= Control;

This should be down.

> +    p_demux->p_sys     = p_sys = malloc( sizeof( demux_sys_t ) );

Unchecked malloc

> +    /* Load the mpegvideo packetizer */
mpegvideo?

> +    /* m4v demuxer doesn't set pts/dts at all */
m4v ?

> +    bs_skip( bs, 2 + 1 + 5 + 32 + 1 + 1 + 1 + 1 + 44 + 8 );

Where do those come from? doc ref?

The rest looks good.

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