Changeset 57980f409c3aa8df7a61ef42d489b5b4323f21ac

Show
Ignore:
Timestamp:
05/06/06 20:23:56 (2 years ago)
Author:
Filippo Carone <littlejohn@videolan.org>
git-committer:
Filippo Carone <littlejohn@videolan.org> 1149531836 +0000
git-parent:

[65c56bb9d8ba7b0789d16407b81836af0bcd367a]

git-author:
Filippo Carone <littlejohn@videolan.org> 1149531836 +0000
Message:

libvlc input and video update:
* video.c: added 1 release object in GetVout?
* input.c: added libvlc_get_input_thread helper

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/control/input.c

    r13c6123 r57980f4  
    3333} 
    3434 
     35/* 
     36 * Retrieve the input thread. Be sure to release the object 
     37 * once you are done with it. 
     38 */ 
     39input_thread_t *libvlc_get_input_thread( libvlc_input_t *p_input, 
     40                                         libvlc_exception_t *p_e )  
     41{ 
     42    input_thread_t *p_input_thread; 
     43 
     44    if( !p_input ) 
     45    { 
     46        libvlc_exception_raise( p_e, "Input is NULL" ); 
     47        return -1; 
     48    } 
     49 
     50    p_input_thread = (input_thread_t*)vlc_object_get( 
     51                                 p_input->p_instance->p_vlc, 
     52                                 p_input->i_input_id ); 
     53    if( !p_input_thread ) 
     54    { 
     55        libvlc_exception_raise( p_e, "Input does not exist" ); 
     56        return NULL; 
     57    } 
     58 
     59    return p_input_thread; 
     60} 
     61 
     62     
     63 
    3564/************************************************************************** 
    3665 * Getters for stream information 
     
    4271    vlc_value_t val; 
    4372 
    44     if( !p_input ) 
    45     { 
    46         libvlc_exception_raise( p_exception, "Input is NULL" ); 
    47         return -1; 
    48     } 
     73    p_input_thread = libvlc_get_input_thread ( p_input, p_exception); 
    4974 
    50     p_input_thread = (input_thread_t*)vlc_object_get( 
    51                                  p_input->p_instance->p_vlc, 
    52                                  p_input->i_input_id ); 
    53     if( !p_input_thread ) 
    54     { 
    55         libvlc_exception_raise( p_exception, "Input does not exist" ); 
    56         return -1; 
    57     } 
     75    if ( libvlc_exception_raised( p_exception ) ) 
     76        return -1.0; 
     77        
    5878    var_Get( p_input_thread, "length", &val ); 
    5979    vlc_object_release( p_input_thread ); 
     
    6888    vlc_value_t val; 
    6989 
    70     if( !p_input ) 
    71     { 
    72         libvlc_exception_raise( p_exception, "Input is NULL" ); 
    73         return -1; 
    74     } 
    7590 
    76     p_input_thread = (input_thread_t*)vlc_object_get( 
    77                                  p_input->p_instance->p_vlc, 
    78                                  p_input->i_input_id ); 
    79     if( !p_input_thread ) 
    80     { 
    81         libvlc_exception_raise( p_exception, "Input does not exist" ); 
    82         return -1; 
    83     } 
     91    p_input_thread = libvlc_get_input_thread ( p_input, p_exception); 
     92 
     93    if ( libvlc_exception_raised( p_exception ) ) 
     94        return -1.0; 
     95 
    8496    var_Get( p_input_thread , "time", &val ); 
    8597    vlc_object_release( p_input_thread ); 
     
    94106    vlc_value_t val; 
    95107 
    96     if( !p_input ) 
    97     { 
    98         libvlc_exception_raise( p_exception, "Input is NULL" ); 
    99         return -1; 
    100     } 
     108    p_input_thread = libvlc_get_input_thread ( p_input, p_exception); 
    101109 
    102     p_input_thread = (input_thread_t*)vlc_object_get( 
    103                             p_input->p_instance->p_vlc, 
    104                             p_input->i_input_id ); 
    105     if( !p_input_thread ) 
    106     { 
    107         libvlc_exception_raise( p_exception, "Input does not exist" ); 
     110    if ( libvlc_exception_raised( p_exception ) ) 
    108111        return -1.0; 
    109     } 
     112 
    110113    var_Get( p_input_thread, "position", &val ); 
    111114    vlc_object_release( p_input_thread ); 
     
    119122    input_thread_t *p_input_thread; 
    120123 
    121     if( !p_input ) 
    122     { 
    123         libvlc_exception_raise( p_exception, "Input is NULL" ); 
     124    p_input_thread = libvlc_get_input_thread ( p_input, p_exception); 
     125 
     126    if ( libvlc_exception_raised( p_exception ) ) 
    124127        return VLC_FALSE; 
    125     } 
    126  
    127     p_input_thread = (input_thread_t*)vlc_object_get( 
    128                             p_input->p_instance->p_vlc, 
    129                             p_input->i_input_id ); 
    130  
    131     if( !p_input_thread ) 
    132     { 
    133         libvlc_exception_raise( p_exception, "Input does not exist" ); 
    134         return VLC_FALSE; 
    135     } 
    136128 
    137129    if ( !p_input_thread->b_die && !p_input_thread->b_dead )  
  • src/control/video.c

    r13c6123 r57980f4  
    5252    if( !p_vout ) 
    5353    { 
     54        vlc_object_release( p_input_thread ); 
    5455        libvlc_exception_raise( p_exception, "No active video output" ); 
    5556        return NULL; 
    5657    } 
     58    vlc_object_release( p_input_thread ); 
     59     
    5760    return p_vout; 
    5861}