Commit c17287dc authored by Christophe Massiot's avatar Christophe Massiot

* Added -a, -c and -s options. (-a doesn't work but I will let the people

who thought it would be cleaner to put config in environment variables
correct what's wrong in my code).
parent abcabca6
......@@ -70,7 +70,7 @@ Urgency: Important
Description: Write input_programs.c
We need a centralized manner of creating new programs, es, and
spawning new decoders.
Status: Todo
Status: Done 20 Dec 2000 (Meuuh)
Task: 0x40
Difficulty: Medium
......@@ -79,7 +79,7 @@ Description: Fix the PS plugin
The PS plugin should be able to recover from packet loss, to
read MPEG-1 .mpg files, and to pre-parse the stream (if possible)
to build the ES table. Check what's wrong and fix it. Now.
Status: Todo
Status: Done
Task: 0x3f
Difficulty: Easy
......@@ -89,7 +89,7 @@ Description: Enhance intf_*Msg
warning/error:" and \n automatically. The new input already
uses such a behaviour, so we must hurry. It might be necessary
to modify all messages in all modules...
Status: Todo
Status: Todo 20 Dec 2000 (Meuuh)
# end of input-II tasks, thanks for being with us
......
......@@ -171,42 +171,15 @@
* interface, and is in fact an interface limitation */
#define INPUT_MAX_THREADS 10
/* Maximum number of programs definitions in a TS stream */
#define INPUT_MAX_PGRM 10
/* Maximum number of ES definitions in a TS stream */
#define INPUT_MAX_ES 10
/* Maximum number of ES in a single program */
#define INPUT_MAX_PROGRAM_ES 10
#define INPUT_MAX_ES 42
/* Maximum number of selected ES in an input thread */
#define INPUT_MAX_SELECTED_ES 10
#define INPUT_MAX_SELECTED_ES 42
/* Maximum size of a data packet (128 kB) */
#define INPUT_MAX_PACKET_SIZE 131072
/* Maximum number of TS packets in the client at any time
* INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
* operation with a &INPUT_MAX_TS in the case of a fifo netlist.
* It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
#define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
/* Same thing with PES packets */
#define INPUT_MAX_PES 16383
/* Maximum number of TS packets we read from the socket in one readv().
* Since you can't put more than 7 TS packets in an Ethernet frame,
* the maximum value is 7. This number should also limit the stream server,
* otherwise any supplementary packet is lost. */
#define INPUT_TS_READ_ONCE 7
/* Use a LIFO or FIFO for TS netlist ? */
#undef INPUT_LIFO_TS_NETLIST
/* Use a LIFO or FIFO for PES netlist ? */
#undef INPUT_LIFO_PES_NETLIST
/* Maximum length of a hostname or source name */
#define INPUT_MAX_SOURCE_LENGTH 100
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.4 2000/12/20 16:04:31 massiot Exp $
* $Id: input_ext-intf.h,v 1.5 2000/12/20 17:49:40 massiot Exp $
*
* Authors:
*
......@@ -27,6 +27,11 @@
* Communication input -> interface
*/
#define INPUT_MAX_PLUGINS 1
/* FIXME ! */
#define REQUESTED_MPEG 0
#define REQUESTED_AC3 1
#define REQUESTED_LPCM 2
#define REQUESTED_NOAUDIO 255
/*****************************************************************************
* es_descriptor_t: elementary stream descriptor
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.5 2000/12/20 16:04:31 massiot Exp $
* $Id: input_programs.c,v 1.6 2000/12/20 17:49:40 massiot Exp $
*
* Authors:
*
......@@ -41,6 +41,8 @@
#include "input_ext-dec.h"
#include "input.h"
#include "main.h" /* --noaudio --novideo */
/*
* NOTICE : all of these functions expect you to have taken the lock on
* p_input->stream.lock
......@@ -88,6 +90,7 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input,
/* Init this entry */
p_input->stream.pp_programs[i_pgrm_index]->i_number = i_pgrm_id;
p_input->stream.pp_programs[i_pgrm_index]->b_is_ok = 0;
p_input->stream.pp_programs[i_pgrm_index]->i_version = 0;
p_input->stream.pp_programs[i_pgrm_index]->i_es_number = 0;
p_input->stream.pp_programs[i_pgrm_index]->pp_es = NULL;
......@@ -431,20 +434,36 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
{
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
p_es->thread_id = adec_CreateThread( GetAdecConfig( p_input, p_es ) );
if( p_main->b_audio )
{
p_es->thread_id = adec_CreateThread( GetAdecConfig( p_input,
p_es ) );
}
break;
case MPEG1_VIDEO_ES:
case MPEG2_VIDEO_ES:
p_es->thread_id = vpar_CreateThread( GetVdecConfig( p_input, p_es ) );
if( p_main->b_video )
{
p_es->thread_id = vpar_CreateThread( GetVdecConfig( p_input,
p_es ) );
}
break;
case AC3_AUDIO_ES:
p_es->thread_id = ac3dec_CreateThread( GetAdecConfig( p_input, p_es ) );
if( p_main->b_audio )
{
p_es->thread_id = ac3dec_CreateThread( GetAdecConfig( p_input,
p_es ) );
}
break;
case DVD_SPU_ES:
p_es->thread_id = spudec_CreateThread( GetVdecConfig( p_input, p_es ) );
if( p_main->b_video )
{
p_es->thread_id = spudec_CreateThread( GetVdecConfig( p_input,
p_es ) );
}
break;
default:
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.10 2000/12/20 16:04:31 massiot Exp $
* $Id: mpeg_system.c,v 1.11 2000/12/20 17:49:40 massiot Exp $
*
* Authors:
*
......@@ -41,9 +41,10 @@
#include "input_ext-dec.h"
#include "input.h"
#include "mpeg_system.h"
#include "main.h" /* AC3/MPEG channel, SPU channel */
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......@@ -815,25 +816,47 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
/* MPEG audio */
p_es->i_type = MPEG2_AUDIO_ES;
#ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR,
REQUESTED_MPEG )
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== (p_es->i_stream_id & 0x1F) )
{
input_SelectES( p_input, p_es );
}
#endif
}
else if( (i_id & 0xF0FF) == 0x80BD )
{
/* AC3 audio */
/* AC3 audio (0x80->0x8F) */
p_es->i_type = AC3_AUDIO_ES;
#ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR,
REQUESTED_AC3 )
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== ((p_es->i_stream_id & 0xF00) >> 8) )
{
input_SelectES( p_input, p_es );
}
#endif
}
else if( (i_id & 0xF0FF) == 0x20BD )
else if( (i_id & 0xE0FF) == 0x20BD )
{
/* Subtitles video */
/* Subtitles video (0x20->0x3F) */
p_es->i_type = DVD_SPU_ES;
#ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_DVD_SUBTITLE_VAR, 0 )
== ((p_es->i_stream_id & 0x1F00) >> 8) )
{
input_SelectES( p_input, p_es );
}
#endif
}
else if( (i_id & 0xF0FF) == 0xA0BD )
{
/* LPCM audio (0xA0->0xAF) */
p_es->i_type = LPCM_AUDIO_ES;
/* FIXME : write the decoder */
}
else
{
p_es->i_type = UNKNOWN_ES;
......
......@@ -31,8 +31,6 @@
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* FILE */
#include <string.h> /* strerror() */
#include <sys/types.h> /* on BSD, uio.h needs types.h */
#include <sys/uio.h> /* for input.h */
#include "config.h"
#include "common.h"
......@@ -40,6 +38,7 @@
#include "mtime.h"
#include "plugins.h"
#include "playlist.h"
#include "stream_control.h"
#include "input_ext-intf.h"
......
......@@ -432,11 +432,14 @@ void main_PutIntVariable( char *psz_name, int i_value )
static void SetDefaultConfiguration( void )
{
/*
* All features are activated by default execpted vlans
* All features are activated by default except vlans
*/
p_main->b_audio = 1;
p_main->b_video = 1;
p_main->b_vlans = 0;
/* This is |_|lt1m4t3 |<l|_|d63 */
main_PutIntVariable( INPUT_DVD_SUBTITLE_VAR, -1 );
}
/*****************************************************************************
......@@ -537,20 +540,17 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutPszVariable( YUV_METHOD_VAR, optarg );
break;
/* FIXME */
#if 0
/* DVD options */
case 'a':
if ( ! strcmp(optarg, "mpeg") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG );
if ( ! strcmp(optarg, "ac3") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
else if ( ! strcmp(optarg, "lpcm") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_LPCM );
else if ( ! strcmp(optarg, "off") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
else
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG );
break;
#endif
case 'c':
main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );
break;
......
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