Changeset 36b86f5b99933b478403e8231325e2392178a1f5

Show
Ignore:
Timestamp:
24/03/04 00:44:49 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1080085489 +0000
git-parent:

[75e43e2bb21d65c7bb965c0d1332177a2dd8aecd]

git-author:
Gildas Bazin <gbazin@videolan.org> 1080085489 +0000
Message:

* src/input/*:

+ new input_Control() function (doesn't do much for now).
+ started bookmarks support through input_Control().
+ new --bookmarks={name=foo,bytes=foo,time=foo},{...} config option.

* src/video_output/*:

+ started support for embeddable vouts (vout_RequestWindow()/vout_ReleaseWindow())
+ new --video-x/y config options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Makefile.am

    rbbb7928 r36b86f5  
    324324    src/playlist/info.c \ 
    325325    src/input/input.c \ 
     326    src/input/control.c \ 
    326327    src/input/es_out.c \ 
    327328    src/input/stream.c \ 
     
    340341    src/video_output/vout_subpictures.c \ 
    341342    src/video_output/vout_synchro.c \ 
     343    src/video_output/vout_intf.c \ 
    342344    src/audio_output/common.c \ 
    343345    src/audio_output/dec.c \ 
  • include/input_ext-intf.h

    rcb50d64 r36b86f5  
    344344 
    345345    count_t c_loops; 
     346 
     347    /* User bookmarks */ 
     348    int         i_bookmarks; 
     349    seekpoint_t **pp_bookmarks; 
    346350 
    347351    /* private, do not touch it */ 
  • include/ninput.h

    r743502e r36b86f5  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: ninput.h,v 1.29 2004/03/03 12:01:17 fenrir Exp
     5 * $Id
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    284284}; 
    285285 
    286  
     286struct seekpoint_t 
     287
     288    int64_t i_byte_offset; 
     289    int64_t i_time_offset; 
     290    char    *psz_name; 
     291}; 
     292 
     293static inline seekpoint_t *vlc_seekpoint_New( void ) 
     294
     295    seekpoint_t *point = (seekpoint_t*)malloc( sizeof( seekpoint_t ) ); 
     296    point->i_byte_offset = point->i_time_offset; 
     297    point->psz_name = NULL; 
     298    return point; 
     299
     300 
     301static inline void vlc_seekpoint_Delete( seekpoint_t *point ) 
     302
     303    if( !point ) return; 
     304    if( point->psz_name ) free( point->psz_name ); 
     305    free( point ); 
     306
     307 
     308static inline seekpoint_t *vlc_seekpoint_Duplicate( seekpoint_t *src ) 
     309
     310    seekpoint_t *point = vlc_seekpoint_New(); 
     311    if( src->psz_name ) point->psz_name = strdup( src->psz_name ); 
     312    point->i_time_offset = src->i_time_offset; 
     313    point->i_byte_offset = src->i_byte_offset; 
     314    return point; 
     315
    287316 
    288317/* Demux */ 
     
    319348} 
    320349 
    321  
    322350/* Subtitles */ 
    323351VLC_EXPORT( char **, subtitles_Detect, ( input_thread_t *, char* path, char *fname ) ); 
     
    327355 */ 
    328356 
     357 
     358/** 
     359 * \defgroup input Input 
     360 * @{ 
     361 */ 
     362enum input_query_e 
     363{ 
     364    INPUT_GET_POSITION,         /* arg1= double *       res=    */ 
     365    INPUT_SET_POSITION,         /* arg1= double         res=can fail    */ 
     366 
     367    INPUT_GET_TIME,             /* arg1= int64_t *      res=    */ 
     368    INPUT_SET_TIME,             /* arg1= int64_t        res=can fail    */ 
     369 
     370    INPUT_GET_LENGTH,           /* arg1= int64_t *      res=can fail    */ 
     371 
     372    INPUT_GET_FPS,              /* arg1= float *        res=can fail    */ 
     373    INPUT_GET_META,             /* arg1= vlc_meta_t **  res=can fail    */ 
     374 
     375    INPUT_GET_BOOKMARKS,   /* arg1= seekpoint_t *** arg2= int * res=can fail */ 
     376    INPUT_CLEAR_BOOKMARKS, /* res=can fail */ 
     377    INPUT_ADD_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */ 
     378    INPUT_DEL_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */ 
     379    INPUT_SET_BOOKMARK,    /* arg1= int  res=can fail    */ 
     380 
     381    INPUT_GET_DIVISIONS 
     382}; 
     383 
     384VLC_EXPORT( int, input_vaControl,( input_thread_t *, int i_query, va_list  ) ); 
     385VLC_EXPORT( int, input_Control,  ( input_thread_t *, int i_query, ...  ) ); 
     386 
     387/** 
     388 * @} 
     389 */ 
     390 
    329391#endif 
  • include/video_output.h

    rf982997 r36b86f5  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: video_output.h,v 1.108 2004/02/22 00:15:33 gbazin Exp
     5 * $Id
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    216216picture_t *     vout_RenderPicture  ( vout_thread_t *, picture_t *, 
    217217                                                       subpicture_t * ); 
     218VLC_EXPORT( void *, vout_RequestWindow, ( vout_thread_t *, int *, int *, unsigned int *, unsigned int * ) ); 
     219VLC_EXPORT( void,   vout_ReleaseWindow, ( vout_thread_t *, void * ) ); 
     220 
    218221/** 
    219222 * \addtogroup subpicture 
  • include/vlc_common.h

    r756605b r36b86f5  
    225225typedef struct pgrm_sys_t pgrm_sys_t; 
    226226typedef struct stream_descriptor_t stream_descriptor_t; 
     227typedef struct seekpoint_t seekpoint_t; 
    227228 
    228229/* Format */ 
  • include/vlc_interface.h

    rdcaa5aa r36b86f5  
    6363    void ( *pf_show_dialog ) ( intf_thread_t *, int, int, 
    6464                               intf_dialog_args_t * ); 
     65 
     66    /** Video window callbacks */ 
     67    void * ( *pf_request_window ) ( intf_thread_t *, int *, int *, 
     68                                    unsigned int *, unsigned int * ); 
     69    void   ( *pf_release_window ) ( intf_thread_t *, void * ); 
    6570 
    6671    /* XXX: new message passing stuff will go here */ 
     
    143148#define INTF_DIALOG_FILEINFO   12 
    144149#define INTF_DIALOG_PREFS      13 
     150#define INTF_DIALOG_BOOKMARKS  14 
    145151 
    146152#define INTF_DIALOG_POPUPMENU  20 
  • src/input/input.c

    rab94829 r36b86f5  
    7878static int RateCallback    ( vlc_object_t *p_this, char const *psz_cmd, 
    7979                             vlc_value_t oldval, vlc_value_t newval, void *p_data ); 
     80static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd, 
     81                             vlc_value_t oldval, vlc_value_t newval, void *p_data ); 
    8082 
    8183/***************************************************************************** 
     
    131133 
    132134    /* decoders */ 
    133     var_Create( p_input, "minimize-threads", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); 
     135    var_Create( p_input, "minimize-threads", VLC_VAR_BOOL|VLC_VAR_DOINHERIT ); 
    134136 
    135137    /* play status */ 
     
    195197    p_input->pf_demux  = NULL; 
    196198    p_input->pf_rewind = NULL; 
    197     p_input->pf_demux_control = NULL
     199    p_input->pf_demux_control = demux_vaControlDefault
    198200    p_input->i_cr_average = config_GetInt( p_input, "cr-average" ); 
    199201 
     
    249251 
    250252    msg_Info( p_input, "playlist item `%s'", p_input->psz_source ); 
     253 
     254    /* Bookmarks */ 
     255    var_Create( p_input, "bookmarks", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); 
     256    var_Create( p_input, "bookmark", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | 
     257                VLC_VAR_ISCOMMAND ); 
     258    val.psz_string = _("Bookmark"); 
     259    var_Change( p_input, "bookmark", VLC_VAR_SETTEXT, &val, NULL ); 
     260    var_AddCallback( p_input, "bookmark", BookmarkCallback, NULL ); 
     261 
     262    p_input->i_bookmarks = 0; 
     263    p_input->pp_bookmarks = NULL; 
     264 
     265    var_Get( p_input, "bookmarks", &val ); 
     266    if( val.psz_string ) 
     267    { 
     268        /* FIXME: have a common cfg parsing routine used by sout and others */ 
     269        char *psz_parser, *psz_start, *psz_end; 
     270        psz_parser = val.psz_string; 
     271        while( (psz_start = strchr( psz_parser, '{' ) ) ) 
     272        { 
     273            seekpoint_t seekpoint; 
     274            char backup; 
     275            psz_start++; 
     276            psz_end = strchr( psz_start, '}' ); 
     277            if( !psz_end ) break; 
     278            psz_parser = psz_end + 1; 
     279            backup = *psz_parser; 
     280            *psz_parser = 0; 
     281            *psz_end = ','; 
     282 
     283            seekpoint.psz_name = 0; 
     284            seekpoint.i_byte_offset = 0; 
     285            seekpoint.i_time_offset = 0; 
     286            while( (psz_end = strchr( psz_start, ',' ) ) ) 
     287            { 
     288                *psz_end = 0; 
     289                if( !strncmp( psz_start, "name=", 5 ) ) 
     290                { 
     291                    seekpoint.psz_name = psz_start + 5; 
     292                } 
     293                else if( !strncmp( psz_start, "bytes=", 6 ) ) 
     294                { 
     295                    seekpoint.i_byte_offset = atol(psz_start + 6); 
     296                } 
     297                else if( !strncmp( psz_start, "time=", 5 ) ) 
     298                { 
     299                    seekpoint.i_time_offset = atol(psz_start + 5) * 1000000; 
     300                } 
     301                psz_start = psz_end + 1; 
     302            } 
     303            msg_Dbg( p_input, "adding bookmark: %s, bytes="I64Fd", time="I64Fd, 
     304                     seekpoint.psz_name, seekpoint.i_byte_offset, 
     305                     seekpoint.i_time_offset ); 
     306            input_Control( p_input, INPUT_ADD_BOOKMARK, &seekpoint ); 
     307            *psz_parser = backup; 
     308        } 
     309        free( val.psz_string ); 
     310    } 
    251311 
    252312    /* Initialize input info */ 
     
    14211481    return VLC_SUCCESS; 
    14221482} 
     1483 
     1484static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd, 
     1485                         vlc_value_t oldval, vlc_value_t newval, void *p_data ) 
     1486{ 
     1487    input_thread_t *p_input = (input_thread_t *)p_this; 
     1488    return input_Control( p_input, INPUT_SET_BOOKMARK, newval ); 
     1489} 
  • src/interface/interface.c

    rc87d50d r36b86f5  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2004 VideoLAN 
    7  * $Id: interface.c,v 1.114 2004/03/03 20:39:53 gbazin Exp
     7 * $Id
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    8585        return NULL; 
    8686    } 
    87  
    88     /* XXX: workaround for a bug in VLC 0.5.0 where the dvdplay plugin was 
    89      * registering itself in $interface, which we do not want to happen. */ 
    90     psz_intf = config_GetPsz( p_intf, "intf" ); 
    91     if( psz_intf ) 
    92     { 
    93         if( !strcasecmp( psz_intf, "dvdplay" ) ) 
    94         { 
    95             config_PutPsz( p_intf, "intf", "" ); 
    96         } 
    97         free( psz_intf ); 
    98     } 
     87    p_intf->pf_request_window = NULL; 
     88    p_intf->pf_release_window = NULL; 
    9989 
    10090    /* Choose the best module */ 
  • src/libvlc.h

    r37c01b3 r36b86f5  
    196196    "adapt to the video characteristics.") 
    197197 
     198#define VIDEOX_TEXT N_("Video x coordinate") 
     199#define VIDEOX_LONGTEXT N_( \ 
     200    "You can enforce the position of the top left corner of the video window "\ 
     201    "here (x coordinate).") 
     202 
     203#define VIDEOY_TEXT N_("Video y coordinate") 
     204#define VIDEOY_LONGTEXT N_( \ 
     205    "You can enforce the position of the top left corner of the video window "\ 
     206    "here (y coordinate).") 
     207 
    198208#define ALIGN_TEXT N_("Video alignment") 
    199209#define ALIGN_LONGTEXT N_( \ 
     
    311321#define STOP_TIME_TEXT N_("Input stop time (second)") 
    312322#define STOP_TIME_LONGTEXT N_("Input stop time (second)") 
     323 
     324#define BOOKMARKS_TEXT N_("Bookmarks list for a stream") 
     325#define BOOKMARKS_LONGTEXT N_("You can specify a list of bookmarks for a stream in " \ 
     326    "the form \"{name=bookmark-name,time=optional-time-offset," \ 
     327    "bytes=optional-byte-offset},{etc...}\"") 
    313328 
    314329#define SUB_AUTO_TEXT N_("Autodetect subtitle files") 
     
    758773    add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE ); 
    759774    add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE ); 
     775    add_integer( "video-x", -1, NULL, VIDEOX_TEXT, VIDEOX_LONGTEXT, VLC_TRUE ); 
     776    add_integer( "video-y", -1, NULL, VIDEOY_TEXT, VIDEOY_LONGTEXT, VLC_TRUE ); 
    760777    add_integer( "align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT, VLC_TRUE ); 
    761778        change_integer_list( pi_align_values, ppsz_align_descriptions, 0 ); 
     
    809826    add_integer( "stop-time", 0, NULL, 
    810827                 STOP_TIME_TEXT, STOP_TIME_LONGTEXT, VLC_TRUE ); 
     828    add_string( "bookmarks", NULL, NULL, 
     829                 BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_TRUE ); 
    811830 
    812831    add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, 
  • src/video_output/video_output.c

    rc87d50d r36b86f5  
    66 ***************************************************************************** 
    77 * Copyright (C) 2000-2004 VideoLAN 
    8  * $Id: video_output.c,v 1.246 2004/03/03 20:39:53 gbazin Exp
     8 * $Id
    99 * 
    1010 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    317317    var_Create( p_vout, "zoom", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT ); 
    318318    var_Create( p_vout, "align", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
     319    var_Create( p_vout, "video-x", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
     320    var_Create( p_vout, "video-y", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
    319321 
    320322    p_vout->b_override_aspect = VLC_FALSE;