[vlc-devel] [PATCH 08/12] bluray: Adding support for overlay.

Laurent Aimar fenrir at elivagar.org
Sun Jan 22 01:13:00 CET 2012


Hi,

On Sun, Jan 22, 2012 at 12:31:03AM +0100, Hugo Beauzée-Luyssen wrote:
> @@ -568,6 +723,20 @@ static int blurayDemuxMenu( demux_t *p_demux )
>      }
>      p_block->i_buffer = nread;
>  
> +    if ( p_sys->current_overlay != -1 )
> +    {
> +        if ( p_sys->p_vout == NULL )
> +            p_sys->p_vout = input_GetVout( p_sys->p_input );
> +        if ( p_sys->p_vout != NULL )
> +        {
> +            p_sys->p_pic[p_sys->current_overlay]->i_start =
> +                    p_sys->p_pic[p_sys->current_overlay]->i_stop = mdate();
> +            p_sys->p_pic[p_sys->current_overlay]->i_channel =
> +                    vout_RegisterSubpictureChannel( p_sys->p_vout );
> +            vout_PutSubpicture( p_sys->p_vout, p_sys->p_pic[p_sys->current_overlay] );
 Becareful, once you send a picture using vout_PutSubpicture() you must not
dereference it nor release it anymore. The vout take ownership of the
subpicture.

If you need to update it later, you have 2 choices:
 - you can send a new one to invalid the previous one (if you use ephemere
 subpictures)
 - you can use the subpicture_updater_t facility. In this case, you need to
 properly lock and refcount things as subpicture_updater_t functions will
 be called asynchronously from the vout thread.

> +            p_sys->current_overlay = -1;
> +        }
> +    }
>      stream_DemuxSend( p_sys->p_parser, p_block );
>      return 1;
>  }

Regards,

-- 
fenrir



More information about the vlc-devel mailing list