/** * Checks for help command line options such as --help or --version. * If one is found, print the corresponding text. * \return true if a command line options caused some help message to be * printed, false otherwise. */ bool config_PrintHelp (vlc_object_t *obj) { char *str; /* Check for short help option */ if (var_InheritBool (obj, "help")) { Help (obj, "help"); return true; } /* Check for version option */ if (var_InheritBool (obj, "version")) { Version(); return true; } /* Check for help on modules */ str = var_InheritString (obj, "module"); if (str != NULL) { Help (obj, str); free (str); return true; } /* Check for full help option */ if (var_InheritBool (obj, "full-help")) { var_Create (obj, "advanced", VLC_VAR_BOOL); var_SetBool (obj, "advanced", true); var_Create (obj, "help-verbose", VLC_VAR_BOOL); var_SetBool (obj, "help-verbose", true); Help (obj, "full-help"); return true; } /* Check for long help option */ if (var_InheritBool (obj, "longhelp")) { Help (obj, "longhelp"); return true; } /* Check for module list option */ if (var_InheritBool (obj, "list")) { ListModules (obj, false ); return true; } if (var_InheritBool (obj, "list-verbose")) { ListModules (obj, true); return true; } return false; }
static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse, const vlc_mouse_t *p_old, const vlc_mouse_t *p_new ) { filter_sys_t *p_sys = p_filter->p_sys; vlc_mutex_lock( &p_sys->lock ); logo_t *p_logo = LogoListCurrent( &p_sys->list ); const picture_t *p_pic = p_logo->p_pic; if( p_pic ) { const video_format_t *p_fmt = &p_pic->format; const int i_logo_w = p_fmt->i_visible_width; const int i_logo_h = p_fmt->i_visible_height; /* Check if we are over the logo */ const bool b_over = p_new->i_x >= p_sys->i_pos_x && p_new->i_x < p_sys->i_pos_x + i_logo_w && p_new->i_y >= p_sys->i_pos_y && p_new->i_y < p_sys->i_pos_y + i_logo_h; if( b_over && vlc_mouse_HasPressed( p_old, p_new, MOUSE_BUTTON_LEFT ) ) p_sys->b_mouse_grab = true; else if( vlc_mouse_HasReleased( p_old, p_new, MOUSE_BUTTON_LEFT ) ) p_sys->b_mouse_grab = false; if( p_sys->b_mouse_grab ) { int i_dx, i_dy; vlc_mouse_GetMotion( &i_dx, &i_dy, p_old, p_new ); p_sys->i_pos_x = __MIN( __MAX( p_sys->i_pos_x + i_dx, 0 ), p_filter->fmt_in.video.i_width - i_logo_w ); p_sys->i_pos_y = __MIN( __MAX( p_sys->i_pos_y + i_dy, 0 ), p_filter->fmt_in.video.i_height - i_logo_h ); /* object under mouse has moved */ var_SetBool( p_filter->p_parent, "mouse-object", true ); } else if( b_over ) { /* object under mouse stoped moving */ var_SetBool( p_filter->p_parent, "mouse-object", false ); } if( p_sys->b_mouse_grab || b_over ) { vlc_mutex_unlock( &p_sys->lock ); return VLC_EGENERIC; } } vlc_mutex_unlock( &p_sys->lock ); *p_mouse = *p_new; return VLC_SUCCESS; }
void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned timeout ) { if ( position != libvlc_position_disable ) { var_SetBool( p_mi, "video-title-show", true ); var_SetInteger( p_mi, "video-title-position", position ); var_SetInteger( p_mi, "video-title-timeout", timeout ); } else { var_SetBool( p_mi, "video-title-show", false ); } }
void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned timeout ) { assert( position >= libvlc_position_disable && position <= libvlc_position_bottom_right ); if ( position != libvlc_position_disable ) { var_SetBool( p_mi, "video-title-show", true ); var_SetInteger( p_mi, "video-title-position", position_subpicture_alignment[position] ); var_SetInteger( p_mi, "video-title-timeout", timeout ); } else { var_SetBool( p_mi, "video-title-show", false ); } }
void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen ) { /* This will work even if the video is not currently active */ var_SetBool (p_mi, "fullscreen", !!b_fullscreen); /* Apply to current video outputs (if any) */ size_t n; vout_thread_t **pp_vouts = GetVouts (p_mi, &n); for (size_t i = 0; i < n; i++) { var_SetBool (pp_vouts[i], "fullscreen", b_fullscreen); vlc_object_release (pp_vouts[i]); } free (pp_vouts); }
void libvlc_toggle_teletext( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e ) { input_thread_t *p_input_thread; vlc_object_t *p_vbi; int i_ret; p_input_thread = libvlc_get_input_thread(p_mi, p_e); if( !p_input_thread ) return; p_vbi = (vlc_object_t *) vlc_object_find_name( p_input_thread, "zvbi", FIND_ANYWHERE ); if( p_vbi ) { const int i_teletext_es = var_GetInteger( p_input_thread, "teletext-es" ); const int i_spu_es = var_GetInteger( p_input_thread, "spu-es" ); if( (i_teletext_es >= 0) && (i_teletext_es == i_spu_es) ) { int i_page = 100; i_page = var_GetInteger( p_vbi, "vbi-page" ); i_page = (i_teletext_es >= 0) ? i_page : 0; i_ret = var_SetInteger( p_vbi, "vbi-page", i_page ); if( i_ret ) libvlc_exception_raise( p_e, "Unexpected error while setting teletext page" ); } else if( i_teletext_es >= 0 ) { bool opaque = true; opaque = var_GetBool( p_vbi, "vbi-opaque" ); i_ret = var_SetBool( p_vbi, "vbi-opaque", !opaque ); if( i_ret ) libvlc_exception_raise( p_e, "Unexpected error while setting teletext transparency" ); } vlc_object_release( p_vbi ); } else { /* Teletext is not enabled yet, so enable it. * Only after it is enable it is possible to view teletext pages */ const int i_teletext_es = var_GetInteger( p_input_thread, "teletext-es" ); if( i_teletext_es >= 0 ) { const int i_spu_es = var_GetInteger( p_input_thread, "spu-es" ); if( i_teletext_es == i_spu_es ) var_SetInteger( p_input_thread, "spu-es", -1 ); else var_SetInteger( p_input_thread, "spu-es", i_teletext_es ); } } vlc_object_release( p_input_thread ); }
/***************************************************************************** * DesktopCallback: desktop mode variable callback *****************************************************************************/ static int DesktopCallback(vlc_object_t *object, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data) { vout_display_t *vd = (vout_display_t *)object; vout_display_sys_t *sys = vd->sys; VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data); vlc_mutex_lock(&sys->lock); const bool ch_desktop = !sys->desktop_requested != !newval.b_bool; sys->ch_desktop |= ch_desktop; sys->desktop_requested = newval.b_bool; vlc_mutex_unlock(&sys->lock); /* FIXME we should have a way to export variable to be saved */ if (ch_desktop) { /* Modify playlist as well because the vout might have to be * restarted */ var_Create(object->p_parent, "video-wallpaper", VLC_VAR_BOOL); var_SetBool(object->p_parent, "video-wallpaper", newval.b_bool); } return VLC_SUCCESS; }
bool VLCVarChoiceModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (!m_object->get()) return false; int row = index.row(); if (role == Qt::CheckStateRole && row >= 0 && row < m_values.count()) { //only update the variable when we select an entry if (!value.toBool()) return false; int ret = VLC_EGENERIC; switch (m_type & VLC_VAR_CLASS) { case VLC_VAR_STRING: ret = var_SetString(m_object->get(), qtu(m_varname), qtu(m_values[row].toString()) ); break; case VLC_VAR_INTEGER: ret = var_SetInteger(m_object->get(), qtu(m_varname), m_values[row].toInt() ); break; case VLC_VAR_FLOAT: ret = var_SetFloat(m_object->get(), qtu(m_varname), m_values[row].toFloat() ); break; case VLC_VAR_BOOL: ret = var_SetBool(m_object->get(), qtu(m_varname), m_values[row].toBool() ); break; default: break; } return ret == VLC_SUCCESS; } return false; }
int vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj, const char *psz_name ) { bool b_bool; if( lua_gettop( L ) > 1 ) return vlclua_error( L ); if( lua_gettop( L ) == 0 ) { b_bool = var_ToggleBool( p_obj, psz_name ); goto end; } /* lua_gettop( L ) == 1 */ const char *s = luaL_checkstring( L, -1 ); lua_pop( L, 1 ); if( s && !strcmp(s, "on") ) b_bool = true; else if( s && !strcmp(s, "off") ) b_bool = false; else { b_bool = var_GetBool( p_obj, psz_name ); goto end; } if( b_bool != var_GetBool( p_obj, psz_name ) ) var_SetBool( p_obj, psz_name, b_bool ); end: lua_pushboolean( L, b_bool ); return 1; }
/***************************************************************************** * InitWindow: get embedded window and init X11 *****************************************************************************/ static int InitWindow( vout_thread_t *p_vout ) { vout_sys_t *p_sys = (vout_sys_t *)p_vout->p_sys; if( p_sys->b_embed ) { p_sys->p_display = XOpenDisplay( NULL ); // Request window from interface p_sys->owner_window = vout_RequestXWindow( p_vout, &p_sys->embedded_window.i_x, &p_sys->embedded_window.i_y, &p_sys->embedded_window.i_width, &p_sys->embedded_window.i_height ); p_sys->main_window = p_sys->embedded_window; // We have to create a new window to get some events // (ButtonPress for example) CreateWindow( p_sys ); } else { // No embedding, fullscreen framebuffer overlay with no events handling p_sys->main_window.i_x = p_sys->main_window.i_y = 0; p_sys->main_window.i_width = p_sys->fb_vinfo.xres; p_sys->main_window.i_height = p_sys->fb_vinfo.yres; p_vout->b_fullscreen = true; var_SetBool( p_vout, "fullscreen", p_vout->b_fullscreen ); } return VLC_SUCCESS; }
static int WallpaperCallback(vlc_object_t *object, char const *cmd, vlc_value_t oldval, vlc_value_t newval, void *data) { vout_display_t *vd = (vout_display_t *)object; vout_display_sys_t *sys = vd->sys; VLC_UNUSED(cmd); VLC_UNUSED(oldval); VLC_UNUSED(data); vlc_mutex_lock(&sys->lock); const bool ch_wallpaper = !sys->wallpaper_requested != !newval.b_bool; sys->ch_wallpaper |= ch_wallpaper; sys->wallpaper_requested = newval.b_bool; vlc_mutex_unlock(&sys->lock); /* FIXME we should have a way to export variable to be saved */ if (ch_wallpaper) { playlist_t *p_playlist = pl_Get(vd); /* Modify playlist as well because the vout might have to be * restarted */ var_Create(p_playlist, "video-wallpaper", VLC_VAR_BOOL); var_SetBool(p_playlist, "video-wallpaper", newval.b_bool); } return VLC_SUCCESS; }
void ExtraPanel::OnEq2Pass( wxCommandEvent &event ) { aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); vlc_bool_t b_2p = event.IsChecked() ? VLC_TRUE : VLC_FALSE; if( p_aout == NULL ) { config_PutInt( p_intf, "equalizer-2pass", b_2p ); } else { var_SetBool( p_aout, "equalizer-2pass", b_2p ); config_PutInt( p_intf, "equalizer-2pass", b_2p ); if( eq_chkbox->IsChecked() ) { for( int i = 0; i < p_aout->i_nb_inputs; i++ ) { p_aout->pp_inputs[i]->b_restart = VLC_TRUE; } } vlc_object_release( p_aout ); } }
void input_SendEventProgramScrambled( input_thread_t *p_input, int i_group, bool b_scrambled ) { if( var_GetInteger( p_input, "program" ) != i_group ) return; var_SetBool( p_input, "program-scrambled", b_scrambled ); Trigger( p_input, INPUT_EVENT_PROGRAM ); }
void libvlc_playlist_loop( libvlc_instance_t *p_instance, int loop, libvlc_exception_t *p_e) { VLC_UNUSED(p_e); assert( PL ); var_SetBool( PL, "loop", loop ); }
/* Set the transparency on teletext */ void InputManager::telexSetTransparency( bool b_transparentTelextext ) { if( hasInput() && p_input_vbi ) { var_SetBool( p_input_vbi, "vbi-opaque", !b_transparentTelextext ); emit teletextTransparencyActivated( b_transparentTelextext ); } }
/***************************************************************************** * RunIntf: main loop *****************************************************************************/ static void RunIntf( intf_thread_t *p_intf ) { int canc = vlc_savecancel( ); /* Main loop */ while( vlc_object_alive( p_intf ) ) { vlc_mutex_lock( &p_intf->p_sys->lock ); /* Notify the interfaces */ if( p_intf->p_sys->b_triggered ) { var_SetBool( p_intf->p_libvlc, "intf-show", true ); p_intf->p_sys->b_triggered = false; } vlc_mutex_unlock( &p_intf->p_sys->lock ); /* Take care of the video output */ if( p_intf->p_sys->p_vout && !vlc_object_alive (p_intf->p_sys->p_vout) ) { var_DelCallback( p_intf->p_sys->p_vout, "mouse-moved", MouseEvent, p_intf ); var_DelCallback( p_intf->p_sys->p_vout, "mouse-button-down", MouseEvent, p_intf ); vlc_object_release( p_intf->p_sys->p_vout ); p_intf->p_sys->p_vout = NULL; } if( p_intf->p_sys->p_vout == NULL ) { p_intf->p_sys->p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); if( p_intf->p_sys->p_vout ) { var_AddCallback( p_intf->p_sys->p_vout, "mouse-moved", MouseEvent, p_intf ); var_AddCallback( p_intf->p_sys->p_vout, "mouse-button-down", MouseEvent, p_intf ); } } /* Wait a bit */ msleep( INTF_IDLE_SLEEP ); } if( p_intf->p_sys->p_vout ) { var_DelCallback( p_intf->p_sys->p_vout, "mouse-moved", MouseEvent, p_intf ); var_DelCallback( p_intf->p_sys->p_vout, "mouse-button-down", MouseEvent, p_intf ); vlc_object_release( p_intf->p_sys->p_vout ); } vlc_restorecancel( canc ); }
/** * TODO * This functions toggle the fullscreen mode * If there is no video, it should first activate Visualisations... * This has also to be fixed in enableVideo() */ void ActionsManager::fullscreen() { vout_thread_t *p_vout = THEMIM->getVout(); if( p_vout) { var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) ); vlc_object_release( p_vout ); } }
/** * Supply or update the current custom ("hardware") volume. * @note This only makes sense after calling aout_VolumeHardInit(). * @param setter volume setter callback * @param volume current custom volume * @param mute current mute flag * * @warning The caller (i.e. the audio output plug-in) is responsible for * interlocking and synchronizing call to this function and to the * audio_output_t.pf_volume_set callback. This ensures that VLC gets correct * volume information (possibly with a latency). */ void aout_VolumeHardSet (audio_output_t *aout, float volume, bool mute) { audio_volume_t vol = lroundf (volume * (float)AOUT_VOLUME_DEFAULT); /* We cannot acquire the volume lock as this gets called from the audio * output plug-in (it would cause a lock inversion). */ var_SetInteger (aout, "volume", vol); var_SetBool (aout, "mute", mute); var_TriggerCallback (aout, "intf-change"); }
void ExitFullscreen( vout_thread_t *p_vout ) { if( p_vout->b_fullscreen ) { msg_Dbg( p_vout, "Quitting fullscreen" ); Win32ToggleFullscreen( p_vout ); /* Force fullscreen in the core for the next video */ var_SetBool( p_vout, "fullscreen", true ); } }
/** * TODO * This functions toggle the fullscreen mode * If there is no video, it should first activate Visualisations... * This has also to be fixed in enableVideo() */ void ActionsManager::fullscreen() { bool fs = var_ToggleBool( THEPL, "fullscreen" ); vout_thread_t *p_vout = THEMIM->getVout(); if( p_vout) { var_SetBool( p_vout, "fullscreen", fs ); vlc_object_release( p_vout ); } }
static void VariablesInit( playlist_t *p_playlist ) { /* These variables control updates */ var_Create( p_playlist, "intf-change", VLC_VAR_BOOL ); var_SetBool( p_playlist, "intf-change", true ); var_Create( p_playlist, "item-change", VLC_VAR_ADDRESS ); var_Create( p_playlist, "leaf-to-parent", VLC_VAR_INTEGER ); var_Create( p_playlist, "playlist-item-deleted", VLC_VAR_INTEGER ); var_SetInteger( p_playlist, "playlist-item-deleted", -1 ); var_Create( p_playlist, "playlist-item-append", VLC_VAR_ADDRESS ); var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS ); /* Variables to control playback */ var_Create( p_playlist, "playlist-autostart", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_AddCallback( p_playlist, "random", RandomCallback, NULL ); var_Create( p_playlist, "repeat", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "loop", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "corks", VLC_VAR_INTEGER ); var_AddCallback( p_playlist, "corks", CorksCallback, NULL ); var_Create( p_playlist, "rate", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT ); var_AddCallback( p_playlist, "rate", RateCallback, NULL ); var_Create( p_playlist, "rate-slower", VLC_VAR_VOID ); var_AddCallback( p_playlist, "rate-slower", RateOffsetCallback, NULL ); var_Create( p_playlist, "rate-faster", VLC_VAR_VOID ); var_AddCallback( p_playlist, "rate-faster", RateOffsetCallback, NULL ); var_Create( p_playlist, "video-splitter", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); var_AddCallback( p_playlist, "video-splitter", VideoSplitterCallback, NULL ); /* sout variables */ var_Create( p_playlist, "sout", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "demux-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); /* */ var_Create( p_playlist, "album-art", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "metadata-network-access", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); /* Variables to preserve video output parameters */ var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "video-wallpaper", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); /* Audio output parameters */ var_Create( p_playlist, "audio-device", VLC_VAR_STRING ); var_Create( p_playlist, "mute", VLC_VAR_BOOL ); var_Create( p_playlist, "volume", VLC_VAR_FLOAT ); var_SetFloat( p_playlist, "volume", -1.f ); }
/********************************************************************** * Execute a var command on an object identified by its name **********************************************************************/ int var_Command( vlc_object_t *p_this, const char *psz_name, const char *psz_cmd, const char *psz_arg, char **psz_msg ) { vlc_object_t *p_obj = vlc_object_find_name( p_this->p_libvlc, psz_name ); int i_type, i_ret; if( !p_obj ) { if( psz_msg ) *psz_msg = strdup( "Unknown destination object." ); return VLC_ENOOBJ; } i_type = var_Type( p_obj, psz_cmd ); if( !( i_type&VLC_VAR_ISCOMMAND ) ) { vlc_object_release( p_obj ); if( psz_msg ) *psz_msg = strdup( "Variable doesn't exist or isn't a command." ); return VLC_EGENERIC; } i_type &= VLC_VAR_CLASS; switch( i_type ) { case VLC_VAR_INTEGER: i_ret = var_SetInteger( p_obj, psz_cmd, atoi( psz_arg ) ); break; case VLC_VAR_FLOAT: i_ret = var_SetFloat( p_obj, psz_cmd, us_atof( psz_arg ) ); break; case VLC_VAR_STRING: i_ret = var_SetString( p_obj, psz_cmd, psz_arg ); break; case VLC_VAR_BOOL: i_ret = var_SetBool( p_obj, psz_cmd, atoi( psz_arg ) ); break; default: i_ret = VLC_EGENERIC; break; } vlc_object_release( p_obj ); if( psz_msg ) { if( asprintf( psz_msg, "%s on object %s returned %i (%s)", psz_cmd, psz_name, i_ret, vlc_error( i_ret ) ) == -1) *psz_msg = NULL; } return i_ret; }
void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen, libvlc_exception_t *p_e ) { /* We only work on the first vout */ vout_thread_t *p_vout = GetVout( p_mi, p_e ); /* GetVout will raise the exception for us */ if( !p_vout ) return; var_SetBool( p_vout, "fullscreen", b_fullscreen ); vlc_object_release( p_vout ); }
void CmdFullscreen::execute() { bool fs = var_ToggleBool( pl_Get( getIntf() ), "fullscreen" ); if( getIntf()->p_sys->p_input == NULL ) return; vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input ); if( pVout ) { // Switch fullscreen var_SetBool( pVout, "fullscreen", fs ); vlc_object_release( pVout ); } }
void vout_SetInterlacingState(vout_thread_t *vout, vout_interlacing_support_t *state, bool is_interlaced) { /* Wait 30s before quiting interlacing mode */ const int interlacing_change = (!!is_interlaced) - (!!state->is_interlaced); if ((interlacing_change == 1) || (interlacing_change == -1 && state->date + 30000000 < mdate())) { msg_Dbg(vout, "Detected %s video", is_interlaced ? "interlaced" : "progressive"); var_SetBool(vout, "deinterlace-needed", is_interlaced); state->is_interlaced = is_interlaced; } if (is_interlaced) state->date = mdate(); }
void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e ) { /* We only work on the first vout */ vout_thread_t *p_vout = GetVout( p_mi, p_e ); bool ret; /* GetVout will raise the exception for us */ if( !p_vout ) return; ret = var_GetBool( p_vout, "fullscreen" ); var_SetBool( p_vout, "fullscreen", !ret ); vlc_object_release( p_vout ); }
static int EsSpuCallback( vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data ) { input_thread_t *p_input = (input_thread_t*)p_this; VLC_UNUSED( psz_cmd); VLC_UNUSED( oldval ); VLC_UNUSED( p_data ); if( newval.i_int < 0 ) newval.i_int = -SPU_ES; /* disable spu es */ else var_SetBool( p_input, "spu", true ); input_ControlPush( p_input, INPUT_CONTROL_SET_ES, &newval ); return VLC_SUCCESS; }
void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi ) { bool b_fullscreen = var_ToggleBool (p_mi, "fullscreen"); /* Apply to current video outputs (if any) */ size_t n; vout_thread_t **pp_vouts = GetVouts (p_mi, &n); for (size_t i = 0; i < n; i++) { vout_thread_t *p_vout = pp_vouts[i]; var_SetBool (p_vout, "fullscreen", b_fullscreen); vlc_object_release (p_vout); } free (pp_vouts); }
void vout_SetInterlacingState(vout_thread_t *vout, bool is_interlaced) { /* Wait 30s before quiting interlacing mode */ const int interlacing_change = (!!is_interlaced) - (!!vout->p->interlacing.is_interlaced); if (interlacing_change == 1 || (interlacing_change == -1 && vout->p->interlacing.date + VLC_TICK_FROM_SEC(30) < vlc_tick_now())) { msg_Dbg(vout, "Detected %s video", is_interlaced ? "interlaced" : "progressive"); var_SetBool(vout, "deinterlace-needed", is_interlaced); vout->p->interlacing.is_interlaced = is_interlaced; } if (is_interlaced) vout->p->interlacing.date = vlc_tick_now(); }
int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj, const char *psz_name ) { bool b_bool; if( lua_gettop( L ) > 1 ) return vlclua_error( L ); if( lua_gettop( L ) == 0 ) b_bool = var_ToggleBool( p_obj, psz_name ); else /* lua_gettop( L ) == 1 */ { b_bool = luaL_checkboolean( L, -1 ); lua_pop( L, 1 ); if( b_bool != var_GetBool( p_obj, psz_name ) ) var_SetBool( p_obj, psz_name, b_bool ); } lua_pushboolean( L, b_bool ); return 1; }