Commit ed003a4a authored by Cyril Deguet's avatar Cyril Deguet

Added a new packet allocation method that punish one's mother in PS input.
I hope there won't be too many segfaults because of it ;)
A few parameters must be adjusted to optimize this method; I'll do it later
because Proba Stat sucks ;)
parent cfbe8690
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders * input_ext-dec.h: structures exported to the VideoLAN decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.25 2001/03/06 19:33:58 massiot Exp $ * $Id: input_ext-dec.h,v 1.26 2001/04/05 14:00:28 asmax Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr> * Michel Kaempf <maxx@via.ecp.fr>
...@@ -33,6 +33,7 @@ typedef struct data_packet_s ...@@ -33,6 +33,7 @@ typedef struct data_packet_s
{ {
/* Nothing before this line, the code relies on that */ /* Nothing before this line, the code relies on that */
byte_t * p_buffer; /* raw data packet */ byte_t * p_buffer; /* raw data packet */
long l_size; /* buffer length */
/* Decoders information */ /* Decoders information */
byte_t * p_payload_start; byte_t * p_payload_start;
......
This diff is collapsed.
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
* input_ps.h: thread structure of the PS plugin * input_ps.h: thread structure of the PS plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ps.h,v 1.2 2001/03/21 13:42:34 sam Exp $ * $Id: input_ps.h,v 1.3 2001/04/05 14:00:28 asmax Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -29,3 +30,55 @@ typedef struct thread_ps_data_s ...@@ -29,3 +30,55 @@ typedef struct thread_ps_data_s
/* We're necessarily reading a file. */ /* We're necessarily reading a file. */
FILE * stream; FILE * stream;
} thread_ps_data_t; } thread_ps_data_t;
#define DATA_CACHE_SIZE 150
#define PES_CACHE_SIZE 150
#define SMALL_CACHE_SIZE 150
#define LARGE_CACHE_SIZE 300
#define MAX_SMALL_SIZE 50 // frontier between small and large packets
typedef struct
{
data_packet_t ** p_stack;
long l_index;
} data_packet_cache_t;
typedef struct
{
pes_packet_t ** p_stack;
long l_index;
} pes_packet_cache_t;
typedef struct
{
byte_t * p_data;
long l_size;
} packet_buffer_t;
typedef struct
{
packet_buffer_t * p_stack;
long l_index;
} small_buffer_cache_t;
typedef struct
{
packet_buffer_t * p_stack;
long l_index;
} large_buffer_cache_t;
typedef struct
{
data_packet_cache_t data;
pes_packet_cache_t pes;
small_buffer_cache_t small;
large_buffer_cache_t large;
} packet_cache_t;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management * mpeg_system.c: TS, PS and PES management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.45 2001/03/15 01:42:20 sam Exp $ * $Id: mpeg_system.c,v 1.46 2001/04/05 14:00:28 asmax Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -657,6 +657,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input, ...@@ -657,6 +657,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
es_descriptor_t * p_es = NULL; es_descriptor_t * p_es = NULL;
i_code = p_data->p_payload_start[3]; i_code = p_data->p_payload_start[3];
if( i_code > 0xBC ) /* ES start code */ if( i_code > 0xBC ) /* ES start code */
{ {
u16 i_id; u16 i_id;
......
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