Commit a608a120 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/pvr/pvr.c: added missing pvr-caching option.

parent 43e94311
...@@ -47,41 +47,58 @@ static void Close( vlc_object_t * ); ...@@ -47,41 +47,58 @@ static void Close( vlc_object_t * );
#define DEVICE_LONGTEXT N_( "PVR video device" ) #define DEVICE_LONGTEXT N_( "PVR video device" )
#define NORM_TEXT N_( "Norm" ) #define NORM_TEXT N_( "Norm" )
#define NORM_LONGTEXT N_( "Defines the norm of the stream (Automatic, SECAM, PAL, or NTSC)" ) #define NORM_LONGTEXT N_( "Defines the norm of the stream " \
static int i_norm_list[] = { V4L2_STD_UNKNOWN, V4L2_STD_SECAM, V4L2_STD_PAL, "(Automatic, SECAM, PAL, or NTSC)" )
V4L2_STD_NTSC };
static char *psz_norm_list_text[] = { N_("Automatic"), N_("SECAM"),
N_("PAL"), N_("NTSC") };
#define WIDTH_TEXT N_( "Width" ) #define WIDTH_TEXT N_( "Width" )
#define WIDTH_LONGTEXT N_( "Width of the stream to capture (-1 for " \ #define WIDTH_LONGTEXT N_( "Width of the stream to capture " \
"autodetect)" ) "(-1 for autodetect)" )
#define HEIGHT_TEXT N_( "Height" ) #define HEIGHT_TEXT N_( "Height" )
#define HEIGHT_LONGTEXT N_( "Height of the stream to capture (-1 for " \ #define HEIGHT_LONGTEXT N_( "Height of the stream to capture " \
"autodetect)" ) "(-1 for autodetect)" )
#define FREQUENCY_TEXT N_( "Frequency" ) #define FREQUENCY_TEXT N_( "Frequency" )
#define FREQUENCY_LONGTEXT N_( "Frequency to capture (in kHz), if applicable" ) #define FREQUENCY_LONGTEXT N_( "Frequency to capture (in kHz), if applicable" )
#define FRAMERATE_TEXT N_( "Framerate" ) #define FRAMERATE_TEXT N_( "Framerate" )
#define FRAMERATE_LONGTEXT N_( "Framerate to capture, if applicable (-1 for " \ #define FRAMERATE_LONGTEXT N_( "Framerate to capture, if applicable " \
"auto)" ) "(-1 for auto)" )
#define KEYINT_TEXT N_( "Key interval" ) #define KEYINT_TEXT N_( "Key interval" )
#define KEYINT_LONGTEXT N_( "Interval between keyframes (-1 for " \ #define KEYINT_LONGTEXT N_( "Interval between keyframes (-1 for auto)" )
" auto)" )
#define BFRAMES_TEXT N_( "B Frames" ) #define BFRAMES_TEXT N_( "B Frames" )
#define BFRAMES_LONGTEXT N_("If this option is set, B-Frames will be used. " \ #define BFRAMES_LONGTEXT N_("If this option is set, B-Frames will be used. " \
"Use this option to set the number of B-Frames.") "Use this option to set the number of B-Frames.")
#define BITRATE_TEXT N_( "Bitrate" ) #define BITRATE_TEXT N_( "Bitrate" )
#define BITRATE_LONGTEXT N_( "Bitrate to use (-1 for default)" ) #define BITRATE_LONGTEXT N_( "Bitrate to use (-1 for default)" )
#define BITRATE_PEAK_TEXT N_( "Bitrate peak" ) #define BITRATE_PEAK_TEXT N_( "Bitrate peak" )
#define BITRATE_PEAK_LONGTEXT N_( "Peak bitrate in VBR mode" ) #define BITRATE_PEAK_LONGTEXT N_( "Peak bitrate in VBR mode" )
#define BITRATE_MODE_TEXT N_( "Bitrate mode (vbr or cbr)" ) #define BITRATE_MODE_TEXT N_( "Bitrate mode (vbr or cbr)" )
#define BITRATE_MODE_LONGTEXT N_( "Bitrate mode to use" ) #define BITRATE_MODE_LONGTEXT N_( "Bitrate mode to use" )
#define BITMASK_TEXT N_( "Audio bitmask" ) #define BITMASK_TEXT N_( "Audio bitmask" )
#define BITMASK_LONGTEXT N_("This option allows setting of bitmask that will get used by the audio part of the card." ) #define BITMASK_LONGTEXT N_("This option allows setting of bitmask that will "\
"get used by the audio part of the card." )
#define CHAN_TEXT N_( "Channel" ) #define CHAN_TEXT N_( "Channel" )
#define CHAN_LONGTEXT N_( "Channel of the card to use (Usually, 0 = tuner, " \ #define CHAN_LONGTEXT N_( "Channel of the card to use (Usually, 0 = tuner, " \
"1 = composite, 2 = svideo)" ) "1 = composite, 2 = svideo)" )
#define CACHING_TEXT N_("Caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for pvr streams. This " \
"value should be set in millisecond units." )
static int i_norm_list[] =
{ V4L2_STD_UNKNOWN, V4L2_STD_SECAM, V4L2_STD_PAL, V4L2_STD_NTSC };
static char *psz_norm_list_text[] =
{ N_("Automatic"), N_("SECAM"), N_("PAL"), N_("NTSC") };
static int i_bitrates[] = { 0, 1 }; static int i_bitrates[] = { 0, 1 };
static char *psz_bitrates_list_text[] = { N_("vbr"), N_("cbr") }; static char *psz_bitrates_list_text[] = { N_("vbr"), N_("cbr") };
...@@ -95,11 +112,9 @@ vlc_module_begin(); ...@@ -95,11 +112,9 @@ vlc_module_begin();
add_string( "pvr-device", "/dev/video0", NULL, DEVICE_TEXT, add_string( "pvr-device", "/dev/video0", NULL, DEVICE_TEXT,
DEVICE_LONGTEXT, VLC_FALSE ); DEVICE_LONGTEXT, VLC_FALSE );
add_integer( "pvr-norm", V4L2_STD_UNKNOWN , NULL, NORM_TEXT, add_integer( "pvr-norm", V4L2_STD_UNKNOWN , NULL, NORM_TEXT,
NORM_LONGTEXT, VLC_FALSE ); NORM_LONGTEXT, VLC_FALSE );
change_integer_list( i_norm_list, psz_norm_list_text, 0 ); change_integer_list( i_norm_list, psz_norm_list_text, 0 );
add_integer( "pvr-width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE ); add_integer( "pvr-width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
add_integer( "pvr-height", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, add_integer( "pvr-height", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT,
VLC_TRUE ); VLC_TRUE );
...@@ -120,8 +135,9 @@ vlc_module_begin(); ...@@ -120,8 +135,9 @@ vlc_module_begin();
change_integer_list( i_bitrates, psz_bitrates_list_text, 0 ); change_integer_list( i_bitrates, psz_bitrates_list_text, 0 );
add_integer( "pvr-audio-bitmask", -1, NULL, BITMASK_TEXT, add_integer( "pvr-audio-bitmask", -1, NULL, BITMASK_TEXT,
BITMASK_LONGTEXT, VLC_TRUE ); BITMASK_LONGTEXT, VLC_TRUE );
add_integer( "pvr-channel", -1, NULL, CHAN_TEXT, add_integer( "pvr-channel", -1, NULL, CHAN_TEXT, CHAN_LONGTEXT, VLC_TRUE );
CHAN_LONGTEXT, VLC_TRUE ); add_integer( "pvr-caching", DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
vlc_module_end(); vlc_module_end();
...@@ -699,7 +715,6 @@ static int Read( access_t * p_access, uint8_t * p_buffer, int i_len ) ...@@ -699,7 +715,6 @@ static int Read( access_t * p_access, uint8_t * p_buffer, int i_len )
*****************************************************************************/ *****************************************************************************/
static int Control( access_t *p_access, int i_query, va_list args ) static int Control( access_t *p_access, int i_query, va_list args )
{ {
access_sys_t *p_sys = p_access->p_sys;
vlc_bool_t *pb_bool; vlc_bool_t *pb_bool;
int *pi_int; int *pi_int;
int64_t *pi_64; int64_t *pi_64;
...@@ -729,7 +744,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -729,7 +744,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_PTS_DELAY: case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * ); pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = (int64_t)var_GetInteger( p_access, "pvr-caching" ) * I64C(1000); *pi_64 = (int64_t)var_GetInteger( p_access, "pvr-caching" ) * 1000;
break; break;
/* */ /* */
...@@ -750,4 +765,3 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -750,4 +765,3 @@ static int Control( access_t *p_access, int i_query, va_list args )
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
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