Changeset 57980f409c3aa8df7a61ef42d489b5b4323f21ac
- 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
| r13c6123 |
r57980f4 |
|
| 33 | 33 | } |
|---|
| 34 | 34 | |
|---|
| | 35 | /* |
|---|
| | 36 | * Retrieve the input thread. Be sure to release the object |
|---|
| | 37 | * once you are done with it. |
|---|
| | 38 | */ |
|---|
| | 39 | input_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 | |
|---|
| 35 | 64 | /************************************************************************** |
|---|
| 36 | 65 | * Getters for stream information |
|---|
| … | … | |
| 42 | 71 | vlc_value_t val; |
|---|
| 43 | 72 | |
|---|
| 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); |
|---|
| 49 | 74 | |
|---|
| 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 | |
|---|
| 58 | 78 | var_Get( p_input_thread, "length", &val ); |
|---|
| 59 | 79 | vlc_object_release( p_input_thread ); |
|---|
| … | … | |
| 68 | 88 | vlc_value_t val; |
|---|
| 69 | 89 | |
|---|
| 70 | | if( !p_input ) |
|---|
| 71 | | { |
|---|
| 72 | | libvlc_exception_raise( p_exception, "Input is NULL" ); |
|---|
| 73 | | return -1; |
|---|
| 74 | | } |
|---|
| 75 | 90 | |
|---|
| 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 | |
|---|
| 84 | 96 | var_Get( p_input_thread , "time", &val ); |
|---|
| 85 | 97 | vlc_object_release( p_input_thread ); |
|---|
| … | … | |
| 94 | 106 | vlc_value_t val; |
|---|
| 95 | 107 | |
|---|
| 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); |
|---|
| 101 | 109 | |
|---|
| 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 ) ) |
|---|
| 108 | 111 | return -1.0; |
|---|
| 109 | | } |
|---|
| | 112 | |
|---|
| 110 | 113 | var_Get( p_input_thread, "position", &val ); |
|---|
| 111 | 114 | vlc_object_release( p_input_thread ); |
|---|
| … | … | |
| 119 | 122 | input_thread_t *p_input_thread; |
|---|
| 120 | 123 | |
|---|
| 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 ) ) |
|---|
| 124 | 127 | 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 | | } |
|---|
| 136 | 128 | |
|---|
| 137 | 129 | if ( !p_input_thread->b_die && !p_input_thread->b_dead ) |
|---|
| r13c6123 |
r57980f4 |
|
| 52 | 52 | if( !p_vout ) |
|---|
| 53 | 53 | { |
|---|
| | 54 | vlc_object_release( p_input_thread ); |
|---|
| 54 | 55 | libvlc_exception_raise( p_exception, "No active video output" ); |
|---|
| 55 | 56 | return NULL; |
|---|
| 56 | 57 | } |
|---|
| | 58 | vlc_object_release( p_input_thread ); |
|---|
| | 59 | |
|---|
| 57 | 60 | return p_vout; |
|---|
| 58 | 61 | } |
|---|