Commit 68d21786 authored by Laurent Aimar's avatar Laurent Aimar

* all: rework of the input.

parent 7d01a7e7
...@@ -25,33 +25,7 @@ ...@@ -25,33 +25,7 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/input.h> #include <vlc/input.h>
#include "ninput.h" #include "input_internal.h"
int access_vaControl( input_thread_t *p_input, int i_query, va_list args )
{
if( p_input->pf_access_control )
{
return p_input->pf_access_control( p_input, i_query, args );
}
return VLC_EGENERIC;
}
int access_Control( input_thread_t *p_input, int i_query, ... )
{
va_list args;
int i_result;
va_start( args, i_query );
i_result = access_vaControl( p_input, i_query, args );
va_end( args );
return i_result;
}
int access_vaControlDefault( input_thread_t *p_input, int i_query, va_list args )
{
return VLC_EGENERIC;
}
/***************************************************************************** /*****************************************************************************
* access2_New: * access2_New:
......
...@@ -22,22 +22,12 @@ ...@@ -22,22 +22,12 @@
*****************************************************************************/ *****************************************************************************/
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/input.h> #include <vlc/input.h>
#include "input_internal.h"
#include "vlc_playlist.h" #include "vlc_playlist.h"
#include "ninput.h"
#include "../../modules/demux/util/sub.h"
struct input_thread_sys_t
{
/* subtitles */
int i_sub;
subtitle_demux_t **sub;
int64_t i_stop_time;
};
static void UpdateBookmarksOption( input_thread_t * ); static void UpdateBookmarksOption( input_thread_t * );
...@@ -64,7 +54,6 @@ int input_Control( input_thread_t *p_input, int i_query, ... ) ...@@ -64,7 +54,6 @@ int input_Control( input_thread_t *p_input, int i_query, ... )
int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
{ {
int i_ret;
seekpoint_t *p_bkmk, ***ppp_bkmk; seekpoint_t *p_bkmk, ***ppp_bkmk;
int i_bkmk = 0; int i_bkmk = 0;
int *pi_bkmk; int *pi_bkmk;
...@@ -75,54 +64,50 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) ...@@ -75,54 +64,50 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
double f, *pf; double f, *pf;
int64_t i_64, *pi_64; int64_t i_64, *pi_64;
vlc_mutex_lock( &p_input->stream.stream_lock );
switch( i_query ) switch( i_query )
{ {
case INPUT_GET_POSITION: case INPUT_GET_POSITION:
pf = (double*)va_arg( args, double * ); pf = (double*)va_arg( args, double * );
*pf = var_GetFloat( p_input, "position" ); *pf = var_GetFloat( p_input, "position" );
i_ret = VLC_SUCCESS; return VLC_SUCCESS;
break;
case INPUT_SET_POSITION: case INPUT_SET_POSITION:
f = (double)va_arg( args, double ); f = (double)va_arg( args, double );
i_ret = var_SetFloat( p_input, "position", f ); return var_SetFloat( p_input, "position", f );
break;
case INPUT_GET_LENGTH: case INPUT_GET_LENGTH:
pi_64 = (int64_t*)va_arg( args, int64_t * ); pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetTime( p_input, "length" ); *pi_64 = var_GetTime( p_input, "length" );
i_ret = VLC_SUCCESS; return VLC_SUCCESS;
break;
case INPUT_GET_TIME: case INPUT_GET_TIME:
pi_64 = (int64_t*)va_arg( args, int64_t * ); pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetTime( p_input, "time" ); *pi_64 = var_GetTime( p_input, "time" );
i_ret = VLC_SUCCESS; return VLC_SUCCESS;
break;
case INPUT_SET_TIME: case INPUT_SET_TIME:
i_64 = (int64_t)va_arg( args, int64_t ); i_64 = (int64_t)va_arg( args, int64_t );
i_ret = var_SetTime( p_input, "time", i_64 ); return var_SetTime( p_input, "time", i_64 );
break;
case INPUT_GET_RATE: case INPUT_GET_RATE:
pi_int = (int*)va_arg( args, int * ); pi_int = (int*)va_arg( args, int * );
*pi_int = var_GetInteger( p_input, "rate" ); *pi_int = var_GetInteger( p_input, "rate" );
i_ret = VLC_SUCCESS; return VLC_SUCCESS;
break;
case INPUT_SET_RATE: case INPUT_SET_RATE:
i_int = (int)va_arg( args, int ); i_int = (int)va_arg( args, int );
i_ret = var_SetInteger( p_input, "rate", i_int ); return var_SetInteger( p_input, "rate", i_int );
break;
case INPUT_GET_STATE: case INPUT_GET_STATE:
pi_int = (int*)va_arg( args, int * ); pi_int = (int*)va_arg( args, int * );
*pi_int = var_GetInteger( p_input, "state" ); *pi_int = var_GetInteger( p_input, "state" );
i_ret = VLC_SUCCESS; return VLC_SUCCESS;
break;
case INPUT_SET_STATE: case INPUT_SET_STATE:
i_int = (int)va_arg( args, int ); i_int = (int)va_arg( args, int );
i_ret = var_SetInteger( p_input, "state", i_int ); return var_SetInteger( p_input, "state", i_int );
break;
#if 0
case INPUT_ADD_OPTION: case INPUT_ADD_OPTION:
{ {
psz_option = (char *)va_arg( args, char * ); psz_option = (char *)va_arg( args, char * );
...@@ -130,7 +115,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) ...@@ -130,7 +115,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_ret = VLC_EGENERIC; i_ret = VLC_EGENERIC;
vlc_mutex_lock( &p_input->p_item->lock ); vlc_mutex_lock( &p_input->p_item->lock );
/* Check if option already exists */ /* Check if option already exists */
for( i = 0; i < p_input->p_item->i_options; i++ ) for( i = 0; i < p_input->p_item->i_options; i++ )
{ {
if( !strncmp( p_input->p_item->ppsz_options[i], psz_option, if( !strncmp( p_input->p_item->ppsz_options[i], psz_option,
...@@ -500,22 +485,33 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) ...@@ -500,22 +485,33 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_ret = VLC_EGENERIC; i_ret = VLC_EGENERIC;
} }
break; break;
#endif
case INPUT_GET_BOOKMARKS:
case INPUT_CLEAR_BOOKMARKS:
case INPUT_ADD_BOOKMARK:
case INPUT_CHANGE_BOOKMARK:
case INPUT_DEL_BOOKMARK:
case INPUT_SET_BOOKMARK:
case INPUT_ADD_OPTION:
case INPUT_ADD_INFO:
case INPUT_GET_INFO:
case INPUT_SET_NAME:
case INPUT_GET_SUBDELAY:
case INPUT_SET_SUBDELAY:
/* FIXME */
msg_Err( p_input, "unimplemented query in input_vaControl" );
default: default:
msg_Err( p_input, "unknown query in input_vaControl" ); msg_Err( p_input, "unknown query in input_vaControl" );
i_ret = VLC_EGENERIC; return VLC_EGENERIC;
break;
} }
vlc_mutex_unlock( &p_input->stream.stream_lock );
return i_ret;
} }
static void UpdateBookmarksOption( input_thread_t *p_input ) static void UpdateBookmarksOption( input_thread_t *p_input )
{ {
int i, i_len = 0; int i, i_len = 0;
char *psz_value = NULL, *psz_next = NULL; char *psz_value = NULL, *psz_next = NULL;
/* FIXME */
#if 0
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
for( i = 0; i < p_input->i_bookmarks; i++ ) for( i = 0; i < p_input->i_bookmarks; i++ )
...@@ -546,4 +542,5 @@ static void UpdateBookmarksOption( input_thread_t *p_input ) ...@@ -546,4 +542,5 @@ static void UpdateBookmarksOption( input_thread_t *p_input )
psz_value ? psz_value : "" ); psz_value ? psz_value : "" );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
#endif
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/input.h> #include <vlc/input.h>
#include "ninput.h"
#ifdef HAVE_DIRENT_H #ifdef HAVE_DIRENT_H
# include <dirent.h> # include <dirent.h>
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment