Changeset 1d67f7b18284ba4268998880d2e40bd4ed933dee

Show
Ignore:
Timestamp:
10/26/07 11:41:18 (11 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1193391678 +0000
git-parent:

[a8de7281d4590f2562f934849de40ab6e1669d5a]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1193391678 +0000
Message:

Add snapshot command to rc interface and make snapshot-width and snapshot-height user modifiable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/control/rc.c

    r4c0e203 r1d67f7b  
    409409    ADD( "vcrop", STRING, VideoConfig ) 
    410410    ADD( "vzoom", STRING, VideoConfig ) 
     411    ADD( "snapshot", VOID, VideoConfig ) 
    411412 
    412413    /* audio commands */ 
     
    884885    msg_rc(_("| vcrop [X]  . . . . . . . . . . .  set/get video crop")); 
    885886    msg_rc(_("| vzoom [X]  . . . . . . . . . . .  set/get video zoom")); 
     887    msg_rc(_("| snapshot . . . . . . . . . . . . take video snapshot")); 
    886888    msg_rc(_("| strack [X] . . . . . . . . . set/get subtitles track")); 
    887889    msg_rc(_("| key [hotkey name] . . . . . .  simulate hotkey press")); 
     
    16351637    vout_thread_t * p_vout; 
    16361638    const char * psz_variable; 
    1637     vlc_value_t val_name; 
    16381639    int i_error; 
    16391640 
     
    16551656        psz_variable = "aspect-ratio"; 
    16561657    } 
    1657     else /* if( !strcmp( psz_cmd, "vzoom" ) ) */ 
     1658    else if( !strcmp( psz_cmd, "vzoom" ) ) 
    16581659    { 
    16591660        psz_variable = "zoom"; 
    16601661    } 
    1661  
    1662  
    1663     /* Get the descriptive name of the variable */ 
    1664     var_Change( p_vout, psz_variable, VLC_VAR_GETTEXT, 
    1665                  &val_name, NULL ); 
    1666     if( !val_name.psz_string ) val_name.psz_string = strdup(psz_variable); 
     1662    else if( !strcmp( psz_cmd, "snapshot" ) ) 
     1663    { 
     1664        psz_variable = "video-snapshot"; 
     1665    } 
    16671666 
    16681667    if( newval.psz_string && *newval.psz_string ) 
     
    16801679        } 
    16811680    } 
     1681    else  if( !strcmp( psz_cmd, "snapshot" ) ) 
     1682    { 
     1683        i_error = var_Set( p_vout, psz_variable, newval ); 
     1684    } 
    16821685    else 
    16831686    { 
    16841687        /* get */ 
     1688        vlc_value_t val_name; 
    16851689        vlc_value_t val, text; 
    16861690        int i; 
     
    17081712            return VLC_EGENERIC; 
    17091713        } 
     1714 
     1715        /* Get the descriptive name of the variable */ 
     1716        var_Change( p_vout, psz_variable, VLC_VAR_GETTEXT, 
     1717                    &val_name, NULL ); 
     1718        if( !val_name.psz_string ) val_name.psz_string = strdup(psz_variable); 
    17101719 
    17111720        msg_rc( "+----[ %s ]", val_name.psz_string ); 
  • src/libvlc-module.c

    r1995f88 r1d67f7b  
    444444#define SNAP_SEQUENTIAL_LONGTEXT N_( \ 
    445445    "Use sequential numbers instead of timestamps for snapshot numbering") 
     446 
     447#define SNAP_WIDTH_TEXT N_("Video snapshot width") 
     448#define SNAP_WIDTH_LONGTEXT N_( \ 
     449    "You can enforce the width of the video snapshot. By default " \ 
     450    "it will be 320 pixels." ) 
     451 
     452#define SNAP_HEIGHT_TEXT N_("Video snapshot height") 
     453#define SNAP_HEIGHT_LONGTEXT N_( \ 
     454    "You can enforce the height of the video snapshot. By default " \ 
     455    "it will be 200 pixels." ) 
    446456 
    447457#define CROP_TEXT N_("Video cropping") 
     
    14761486    add_bool( "snapshot-sequential", VLC_FALSE, NULL, SNAP_SEQUENTIAL_TEXT, 
    14771487              SNAP_SEQUENTIAL_LONGTEXT, VLC_FALSE ); 
     1488    add_integer( "snapshot-width", 320, NULL, SNAP_WIDTH_TEXT, 
     1489                 SNAP_WIDTH_LONGTEXT, VLC_TRUE ); 
     1490    add_integer( "snapshot-height", 200, NULL, SNAP_HEIGHT_TEXT, 
     1491                 SNAP_HEIGHT_LONGTEXT, VLC_TRUE ); 
    14781492 
    14791493    set_section( N_("Window properties" ), NULL ); 
  • src/video_output/vout_intf.c

    re23d890 r1d67f7b  
    203203    var_Create( p_vout, "snapshot-num", VLC_VAR_INTEGER ); 
    204204    var_SetInteger( p_vout, "snapshot-num", 1 ); 
     205    var_Create( p_vout, "snapshot-width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
     206    var_Create( p_vout, "snapshot-height", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
    205207 
    206208    var_Create( p_vout, "width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
     
    517519        /* FIXME: should not be hardcoded. We should be able to 
    518520        specify the snapshot size (snapshot-width and snapshot-height). */ 
    519         fmt_out.i_width = 320
    520         fmt_out.i_height = 200
     521        fmt_out.i_width = var_GetInteger( p_vout, "snapshot-width" )
     522        fmt_out.i_height = var_GetInteger( p_vout, "snapshot-height" )
    521523        fmt_out.i_chroma = VLC_FOURCC( 'p','n','g',' ' ); 
     524 
    522525        p_block = ( block_t* ) image_Write( p_image, p_pic, &fmt_in, &fmt_out ); 
    523526        if( !p_block ) 
     
    571574        return VLC_SUCCESS; 
    572575    } 
    573  
    574576 
    575577#if defined(__APPLE__) || defined(SYS_BEOS) 
     
    659661     */ 
    660662    path = utf8_opendir ( (const char *)val.psz_string  ); 
    661  
    662663    if ( path != NULL ) 
    663664    { 
     
    11941195    return VLC_SUCCESS; 
    11951196} 
    1196