Exemplo n.º 1
0
//  fifo_init_internal(path)
// If path is NULL, reopen existing fifo, else open anew.
static int fifo_init_internal(const char *fifo_path)
{
  if (fifo_path) {
    fifo_deinit();
    fifo_name = expand_filename(fifo_path);

    if (!check_fifo(fifo_name)) {
      scr_LogPrint(LPRINT_LOGNORM, "WARNING: Cannot create the FIFO. "
                   "%s already exists and is not a pipe", fifo_name);
      g_free(fifo_name);
      fifo_name = NULL;
      return -1;
    }
  } else if (fifo_name)
    g_source_remove_by_user_data(fifo_channel);
  else
    return -1;

  if (!attach_fifo(fifo_name)) {
    scr_LogPrint(LPRINT_LOGNORM, "Error: Cannot open fifo");
    return -1;
  }

  setenv(FIFO_ENV_NAME, fifo_name, 1);

  scr_LogPrint(LPRINT_LOGNORM, "FIFO initialized (%s)", fifo_path);
  return 1;
}
Exemplo n.º 2
0
static void
Close( vlc_object_t *p_this )
{
    vout_display_t *vd = (vout_display_t *)p_this;
    vout_display_sys_t *sys = vd->sys;
    struct event *p_event;

    if (!sys)
        return;

    EcoreMainLoopCallSync( vd, EvasDeinitMainloopCb );

    BuffersClean( vd );
    fifo_deinit( &sys->buffer_fifo );

    if( sys->p_pool )
        picture_pool_Release(sys->p_pool);

    while( ( p_event = EVENT_FIFO_POP() ) )
        free( p_event );

    vlc_mutex_destroy( &sys->cb_lock );
    vlc_cond_destroy( &sys->cb_wait );

    free( sys );
}
Exemplo n.º 3
0
static gchar *fifo_guard(const gchar *key, const gchar *new_value)
{
  if (new_value)
    fifo_init_internal(new_value);
  else
    fifo_deinit();
  return g_strdup(new_value);
}