[vlc-devel] [PATCH] Support multiple video player instances.

Rémi Denis-Courmont remi at remlab.net
Sat Jul 26 12:43:11 CEST 2014


Hello,

Le vendredi 25 juillet 2014, 03:18:55 Paulo Vitor Magacho da Silva a écrit :
> @@ -178,19 +178,19 @@ static int Open(vlc_object_t *p_this)
>      if (fmt.i_chroma == VLC_CODEC_ANDROID_OPAQUE)
>          return VLC_EGENERIC;
> 
> -    /* */
> -    if (vlc_mutex_trylock(&single_instance) != 0) {
> -        msg_Err(vd, "Can't start more than one instance at a time");
> -        return VLC_EGENERIC;
> -    }
> -
>      /* Allocate structure */
>      vout_display_sys_t *sys = (struct vout_display_sys_t*) calloc(1,
> sizeof(*sys)); if (!sys) {
> -        vlc_mutex_unlock(&single_instance);
>          return VLC_ENOMEM;
>      }
> 
> +    sys->object = var_CreateGetAddress (vd, "drawable-surfacevalue");

var_InheritAddress()

> +    if (!sys->object) {
> +        free(sys);
> +        msg_Err(vd, "No android_surf_value_t set.");

No dot.

> +        return VLC_EGENERIC;
> +    }
> +
>      /* */
>      sys->p_library = LoadNativeWindowAPI(&sys->native_window);
>      sys->s_unlockAndPost =
> (Surface_unlockAndPost)sys->native_window.unlockAndPost; @@ -199,7 +199,6
> @@ -298,9 +296,11 @@ static void Close(vlc_object_t *p_this)
>      picture_pool_Delete(sys->pool);
>      if (sys->window)
>          sys->native_window.winRelease(sys->window);
> +
> +    var_Destroy (vd, "drawable-surfacevalue");

Not needed.

> +
>      dlclose(sys->p_library);
>      free(sys);
> -    vlc_mutex_unlock(&single_instance);
>  }
> 
>  static picture_pool_t *Pool(vout_display_t *vd, unsigned count)

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list