Changeset 1d67f7b18284ba4268998880d2e40bd4ed933dee
- 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
| r4c0e203 |
r1d67f7b |
|
| 409 | 409 | ADD( "vcrop", STRING, VideoConfig ) |
|---|
| 410 | 410 | ADD( "vzoom", STRING, VideoConfig ) |
|---|
| | 411 | ADD( "snapshot", VOID, VideoConfig ) |
|---|
| 411 | 412 | |
|---|
| 412 | 413 | /* audio commands */ |
|---|
| … | … | |
| 884 | 885 | msg_rc(_("| vcrop [X] . . . . . . . . . . . set/get video crop")); |
|---|
| 885 | 886 | msg_rc(_("| vzoom [X] . . . . . . . . . . . set/get video zoom")); |
|---|
| | 887 | msg_rc(_("| snapshot . . . . . . . . . . . . take video snapshot")); |
|---|
| 886 | 888 | msg_rc(_("| strack [X] . . . . . . . . . set/get subtitles track")); |
|---|
| 887 | 889 | msg_rc(_("| key [hotkey name] . . . . . . simulate hotkey press")); |
|---|
| … | … | |
| 1635 | 1637 | vout_thread_t * p_vout; |
|---|
| 1636 | 1638 | const char * psz_variable; |
|---|
| 1637 | | vlc_value_t val_name; |
|---|
| 1638 | 1639 | int i_error; |
|---|
| 1639 | 1640 | |
|---|
| … | … | |
| 1655 | 1656 | psz_variable = "aspect-ratio"; |
|---|
| 1656 | 1657 | } |
|---|
| 1657 | | else /* if( !strcmp( psz_cmd, "vzoom" ) ) */ |
|---|
| | 1658 | else if( !strcmp( psz_cmd, "vzoom" ) ) |
|---|
| 1658 | 1659 | { |
|---|
| 1659 | 1660 | psz_variable = "zoom"; |
|---|
| 1660 | 1661 | } |
|---|
| 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 | } |
|---|
| 1667 | 1666 | |
|---|
| 1668 | 1667 | if( newval.psz_string && *newval.psz_string ) |
|---|
| … | … | |
| 1680 | 1679 | } |
|---|
| 1681 | 1680 | } |
|---|
| | 1681 | else if( !strcmp( psz_cmd, "snapshot" ) ) |
|---|
| | 1682 | { |
|---|
| | 1683 | i_error = var_Set( p_vout, psz_variable, newval ); |
|---|
| | 1684 | } |
|---|
| 1682 | 1685 | else |
|---|
| 1683 | 1686 | { |
|---|
| 1684 | 1687 | /* get */ |
|---|
| | 1688 | vlc_value_t val_name; |
|---|
| 1685 | 1689 | vlc_value_t val, text; |
|---|
| 1686 | 1690 | int i; |
|---|
| … | … | |
| 1708 | 1712 | return VLC_EGENERIC; |
|---|
| 1709 | 1713 | } |
|---|
| | 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); |
|---|
| 1710 | 1719 | |
|---|
| 1711 | 1720 | msg_rc( "+----[ %s ]", val_name.psz_string ); |
|---|
| r1995f88 |
r1d67f7b |
|
| 444 | 444 | #define SNAP_SEQUENTIAL_LONGTEXT N_( \ |
|---|
| 445 | 445 | "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." ) |
|---|
| 446 | 456 | |
|---|
| 447 | 457 | #define CROP_TEXT N_("Video cropping") |
|---|
| … | … | |
| 1476 | 1486 | add_bool( "snapshot-sequential", VLC_FALSE, NULL, SNAP_SEQUENTIAL_TEXT, |
|---|
| 1477 | 1487 | 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 ); |
|---|
| 1478 | 1492 | |
|---|
| 1479 | 1493 | set_section( N_("Window properties" ), NULL ); |
|---|
| re23d890 |
r1d67f7b |
|
| 203 | 203 | var_Create( p_vout, "snapshot-num", VLC_VAR_INTEGER ); |
|---|
| 204 | 204 | 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 ); |
|---|
| 205 | 207 | |
|---|
| 206 | 208 | var_Create( p_vout, "width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| … | … | |
| 517 | 519 | /* FIXME: should not be hardcoded. We should be able to |
|---|
| 518 | 520 | 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" ); |
|---|
| 521 | 523 | fmt_out.i_chroma = VLC_FOURCC( 'p','n','g',' ' ); |
|---|
| | 524 | |
|---|
| 522 | 525 | p_block = ( block_t* ) image_Write( p_image, p_pic, &fmt_in, &fmt_out ); |
|---|
| 523 | 526 | if( !p_block ) |
|---|
| … | … | |
| 571 | 574 | return VLC_SUCCESS; |
|---|
| 572 | 575 | } |
|---|
| 573 | | |
|---|
| 574 | 576 | |
|---|
| 575 | 577 | #if defined(__APPLE__) || defined(SYS_BEOS) |
|---|
| … | … | |
| 659 | 661 | */ |
|---|
| 660 | 662 | path = utf8_opendir ( (const char *)val.psz_string ); |
|---|
| 661 | | |
|---|
| 662 | 663 | if ( path != NULL ) |
|---|
| 663 | 664 | { |
|---|
| … | … | |
| 1194 | 1195 | return VLC_SUCCESS; |
|---|
| 1195 | 1196 | } |
|---|
| 1196 | | |
|---|