version 1.3, 2001/04/03 21:14:33
|
version 1.4, 2001/04/09 15:26:03
|
Line 21
|
Line 21
|
#include "input.h" |
#include "input.h" |
#include "splice.h" |
#include "splice.h" |
|
|
|
/* Guess a stream type. |
|
* Return: a stream type according to ISO 13818-1 table 2-29, 0 if none such |
|
*/ |
int guess_streamtype (int streamid) |
int guess_streamtype (int streamid) |
{ |
{ |
if ((streamid >= PES_CODE_AUDIO) |
if ((streamid >= PES_CODE_AUDIO) |
Line 50 int guess_streamtype (int streamid)
|
Line 53 int guess_streamtype (int streamid)
|
} |
} |
} |
} |
|
|
|
/* Skip to find a PES/PS stream prefix |
|
* Precondition: f!=NULL |
|
* Postcondition: if found: f->data.out indicates the prefix. |
|
* Return: TRUE, if found, FALSE otherwise. |
|
*/ |
boolean pes_skip_to_prefix (file_descr *f) |
boolean pes_skip_to_prefix (file_descr *f) |
{ |
{ |
unsigned int p; |
unsigned int p; |
Line 74 boolean pes_skip_to_prefix (file_descr *
|
Line 82 boolean pes_skip_to_prefix (file_descr *
|
return (r); |
return (r); |
} |
} |
|
|
|
/* Determine the stream id of a packet. |
|
* Precondition: d!=NULL points to a package. |
|
* Return: stream id. |
|
*/ |
int pes_stream_id (refr_data *d) |
int pes_stream_id (refr_data *d) |
{ |
{ |
int i; |
int i; |
Line 83 int pes_stream_id (refr_data *d)
|
Line 95 int pes_stream_id (refr_data *d)
|
return (d->ptr[i]); |
return (d->ptr[i]); |
} |
} |
|
|
|
/* Determine the length of a packet. |
|
* Precondition: d!=NULL points to a package. |
|
* Return: packet length. |
|
*/ |
int pes_packet_length (refr_data *d) |
int pes_packet_length (refr_data *d) |
{ /* special case len = 0: to do 2.4.3.7 */ |
{ /* special case len = 0: to do 2.4.3.7 */ |
#define MAX_PACKETSIZE_PROCESSABLE \ |
#define MAX_PACKETSIZE_PROCESSABLE \ |
Line 102 int pes_packet_length (refr_data *d)
|
Line 118 int pes_packet_length (refr_data *d)
|
return (l); |
return (l); |
} |
} |
|
|
|
/* Copy data from a raw data input buffer to a stream buffer. |
|
* wrapping is done for the raw data input buffer. |
|
* If the data does not fit at the end of the buffer, break to the start |
|
* of the buffer and put it there. |
|
* Precondition: src!=NULL providing at least size bytes |
|
* dst!=NULL with free unbroken space of a least size bytes. |
|
* Return: Pointer to copied data. |
|
*/ |
int pes_transfer (refr_data *src, |
int pes_transfer (refr_data *src, |
refr_data *dst, |
refr_data *dst, |
int size) |
int size) |
Line 125 int pes_transfer (refr_data *src,
|
Line 149 int pes_transfer (refr_data *src,
|
return (r); |
return (r); |
} |
} |
|
|
|
/* Split data from a PES stream. |
|
* Precondition: f!=NULL |
|
* Return: TRUE, if something was processed, FALSE if no data/space available |
|
*/ |
boolean split_pes (file_descr *f) |
boolean split_pes (file_descr *f) |
{ |
{ |
int l, p, q; |
int l, p, q; |