[FFmpeg-soc] [soc]: r2146 - in dvbmuxer: mpegenc.c mpegpes.h mpegpesenc.c mpegtsenc.c
bcoudurier
subversion at mplayerhq.hu
Tue Apr 22 18:36:41 CEST 2008
Author: bcoudurier
Date: Tue Apr 22 18:36:41 2008
New Revision: 2146
Log:
rename PESStream to StreamInfo to minimize diff with svn trunk
Modified:
dvbmuxer/mpegenc.c
dvbmuxer/mpegpes.h
dvbmuxer/mpegpesenc.c
dvbmuxer/mpegtsenc.c
Modified: dvbmuxer/mpegenc.c
==============================================================================
--- dvbmuxer/mpegenc.c (original)
+++ dvbmuxer/mpegenc.c Tue Apr 22 18:36:41 2008
@@ -157,7 +157,7 @@ static int put_system_header(AVFormatCon
int P_STD_max_mpeg_PS1 = 0;
for(i=0;i<ctx->nb_streams;i++) {
- PESStream *stream = ctx->streams[i]->priv_data;
+ StreamInfo *stream = ctx->streams[i]->priv_data;
id = stream->id;
if (id == 0xbd && stream->max_buffer_size > P_STD_max_mpeg_PS1) {
@@ -199,7 +199,7 @@ static int put_system_header(AVFormatCon
/* audio stream info */
private_stream_coded = 0;
for(i=0;i<ctx->nb_streams;i++) {
- PESStream *stream = ctx->streams[i]->priv_data;
+ StreamInfo *stream = ctx->streams[i]->priv_data;
/* For VCDs, only include the stream info for the stream
@@ -243,7 +243,7 @@ static int put_system_header(AVFormatCon
static int get_system_header_size(AVFormatContext *ctx)
{
int buf_index, i, private_stream_coded;
- PESStream *stream;
+ StreamInfo *stream;
MpegMuxContext *s = ctx->priv_data;
if (s->is_dvd)
@@ -268,7 +268,7 @@ static int mpeg_mux_init(AVFormatContext
MpegMuxContext *s = ctx->priv_data;
int bitrate, i, mpa_id, mpv_id, mps_id, ac3_id, dts_id, lpcm_id, j;
AVStream *st;
- PESStream *stream;
+ StreamInfo *stream;
int audio_bitrate;
int video_bitrate;
@@ -298,12 +298,12 @@ static int mpeg_mux_init(AVFormatContext
lpcm_id = LPCM_ID;
for(i=0;i<ctx->nb_streams;i++) {
st = ctx->streams[i];
- stream = av_mallocz(sizeof(PESStream));
+ stream = av_mallocz(sizeof(StreamInfo));
if (!stream)
goto fail;
st->priv_data = stream;
- /* set PESStream format */
+ /* set StreamInfo format */
if (s->is_dvd)
stream->format = PES_FMT_DVD;
if (s->is_svcd)
@@ -374,7 +374,7 @@ static int mpeg_mux_init(AVFormatContext
for(i=0;i<ctx->nb_streams;i++) {
int codec_rate;
st = ctx->streams[i];
- stream = (PESStream*) st->priv_data;
+ stream = (StreamInfo*) st->priv_data;
if(st->codec->rc_max_rate || stream->id==VIDEO_ID)
codec_rate= st->codec->rc_max_rate;
@@ -511,7 +511,7 @@ static int get_packet_payload_size(AVFor
{
MpegMuxContext *s = ctx->priv_data;
int buf_index;
- PESStream *stream;
+ StreamInfo *stream;
stream = ctx->streams[stream_index]->priv_data;
@@ -611,7 +611,7 @@ static int flush_packet(AVFormatContext
int64_t pts, int64_t dts, int64_t scr, int trailer_size)
{
MpegMuxContext *s = ctx->priv_data;
- PESStream *stream = ctx->streams[stream_index]->priv_data;
+ StreamInfo *stream = ctx->streams[stream_index]->priv_data;
uint8_t *buf_ptr;
int size, payload_size, startcode, id, stuffing_size, i, header_len;
int packet_size;
@@ -888,7 +888,7 @@ static int64_t get_vcd_scr(AVFormatConte
static int output_packet(AVFormatContext *ctx, int flush){
MpegMuxContext *s = ctx->priv_data;
AVStream *st;
- PESStream *stream;
+ StreamInfo *stream;
int i, avail_space=0, es_size, trailer_size;
int best_i= -1;
int best_score= INT_MIN;
@@ -900,7 +900,7 @@ static int output_packet(AVFormatContext
retry:
for(i=0; i<ctx->nb_streams; i++){
AVStream *st = ctx->streams[i];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
const int avail_data= av_fifo_size(&stream->fifo);
const int space= stream->max_buffer_size - stream->buffer_index;
int rel_space= 1024*space / stream->max_buffer_size;
@@ -933,7 +933,7 @@ retry:
for(i=0; i<ctx->nb_streams; i++){
AVStream *st = ctx->streams[i];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
PacketDesc *pkt_desc= stream->predecode_packet;
if(pkt_desc && pkt_desc->dts < best_dts)
best_dts= pkt_desc->dts;
@@ -1015,7 +1015,7 @@ static int mpeg_mux_write_packet(AVForma
int size= pkt->size;
uint8_t *buf= pkt->data;
AVStream *st = ctx->streams[stream_index];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
int64_t pts, dts;
PacketDesc *pkt_desc;
const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE);
@@ -1062,7 +1062,7 @@ static int mpeg_mux_write_packet(AVForma
static int mpeg_mux_end(AVFormatContext *ctx)
{
// MpegMuxContext *s = ctx->priv_data;
- PESStream *stream;
+ StreamInfo *stream;
int i;
for(;;){
Modified: dvbmuxer/mpegpes.h
==============================================================================
--- dvbmuxer/mpegpes.h (original)
+++ dvbmuxer/mpegpes.h Tue Apr 22 18:36:41 2008
@@ -66,7 +66,7 @@ typedef struct {
int bytes_to_iframe;
int align_iframe;
int64_t vobu_start_pts;
-} PESStream;
+} StreamInfo;
#define AUDIO_ID 0xc0
@@ -122,7 +122,7 @@ int ff_pes_find_beststream(AVFormatConte
* @param[in] len PES packet size
* @return the number of frames have been muxed.
*/
-int ff_pes_get_nb_frames(AVFormatContext *ctx, PESStream *stream, int len);
+int ff_pes_get_nb_frames(AVFormatContext *ctx, StreamInfo *stream, int len);
/**
@@ -139,7 +139,7 @@ int ff_pes_get_nb_frames(AVFormatContext
* @param[in] trailer_size unwritten trailer size
* @param[in] pad_packet_bytes padding size for packet
*/
-void ff_pes_cal_header(int id, PESStream *stream,
+void ff_pes_cal_header(int id, StreamInfo *stream,
int *packet_size, int *header_len, int64_t *pts,int64_t *dts,
int *payload_size, int *startcode, int *stuffing_size,
int *trailer_size, int *pad_packet_bytes);
Modified: dvbmuxer/mpegpesenc.c
==============================================================================
--- dvbmuxer/mpegpesenc.c (original)
+++ dvbmuxer/mpegpesenc.c Tue Apr 22 18:36:41 2008
@@ -31,7 +31,7 @@
int ff_pes_muxer_init(AVFormatContext *ctx)
{
AVStream *st;
- PESStream *stream;
+ StreamInfo *stream;
int i;
for(i=0;i<ctx->nb_streams;i++) {
@@ -87,7 +87,7 @@ static inline void insert_timestamp(uint
* @param[in] len PES packet size
* @return the number of frames have been muxed.
*/
-int ff_pes_get_nb_frames(AVFormatContext *ctx, PESStream *stream, int len){
+int ff_pes_get_nb_frames(AVFormatContext *ctx, StreamInfo *stream, int len){
int nb_frames=0;
PacketDesc *pkt_desc= stream->premux_packet;
@@ -101,7 +101,7 @@ int ff_pes_get_nb_frames(AVFormatContext
return nb_frames;
}
-void ff_pes_cal_header(int id, PESStream *stream,
+void ff_pes_cal_header(int id, StreamInfo *stream,
int *packet_size, int *header_len, int64_t *pts, int64_t *dts,
int *payload_size, int *startcode, int *stuffing_size,
int *trailer_size, int *pad_packet_bytes)
@@ -192,7 +192,7 @@ int ff_pes_muxer_write(AVFormatContext *
uint8_t *pes_content, int pes_content_len,
int header_len, int packet_size, int payload_size, int stuffing_size)
{
- PESStream *stream = ctx->streams[stream_index]->priv_data;
+ StreamInfo *stream = ctx->streams[stream_index]->priv_data;
int pes_flags, i;
int data_size = payload_size - stuffing_size;
uint8_t *q = pes_buffer;
@@ -257,7 +257,7 @@ int ff_pes_remove_decoded_packets(AVForm
for(i=0; i<ctx->nb_streams; i++){
AVStream *st = ctx->streams[i];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
PacketDesc *pkt_desc;
while((pkt_desc= stream->predecode_packet)
@@ -289,7 +289,7 @@ int ff_pes_find_beststream(AVFormatConte
retry:
for(i=0; i<ctx->nb_streams; i++){
AVStream *st = ctx->streams[i];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
const int avail_data= av_fifo_size(&stream->fifo);
const int space= stream->max_buffer_size - stream->buffer_index;
int rel_space= 1024*space / stream->max_buffer_size;
@@ -322,7 +322,7 @@ retry:
for(i=0; i<ctx->nb_streams; i++){
AVStream *st = ctx->streams[i];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
PacketDesc *pkt_desc= stream->predecode_packet;
if(pkt_desc && pkt_desc->dts < best_dts)
best_dts= pkt_desc->dts;
@@ -354,7 +354,7 @@ void ff_pes_write_packet(AVFormatContext
int size= pkt->size;
uint8_t *buf= pkt->data;
AVStream *st = ctx->streams[stream_index];
- PESStream *stream = st->priv_data;
+ StreamInfo *stream = st->priv_data;
int64_t pts, dts;
PacketDesc *pkt_desc;
const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE);
@@ -384,7 +384,7 @@ void ff_pes_write_packet(AVFormatContext
void ff_pes_muxer_end(AVFormatContext *ctx)
{
- PESStream *stream;
+ StreamInfo *stream;
int i;
for(i=0;i<ctx->nb_streams;i++) {
Modified: dvbmuxer/mpegtsenc.c
==============================================================================
--- dvbmuxer/mpegtsenc.c (original)
+++ dvbmuxer/mpegtsenc.c Tue Apr 22 18:36:41 2008
@@ -152,7 +152,7 @@ static int pes_streamid[5] = {
};
typedef struct MpegTSWriteStream {
- PESStream pes_stream;
+ StreamInfo pes_stream;
int packet_size;
int packet_number;
int startcode; /**< PES header start code */
@@ -622,7 +622,7 @@ static int flush_packet(AVFormatContext
{
MpegTSWrite *s = ctx->priv_data;
MpegTSWriteStream *stream = ctx->streams[stream_index]->priv_data;
- PESStream *pes_stream = &stream->pes_stream;
+ StreamInfo *pes_stream = &stream->pes_stream;
int payload_size, id, startcode, stuffing_size, i, header_len;
int packet_size, es_size;
int zero_trail_bytes = 0;
@@ -683,7 +683,7 @@ static int flush_packet(AVFormatContext
static int output_packet(AVFormatContext *ctx, int flush){
MpegTSWrite *s = ctx->priv_data;
AVStream *st;
- PESStream *stream;
+ StreamInfo *stream;
int es_size, trailer_size;
int result;
int best_i= -1;
More information about the FFmpeg-soc
mailing list