64 bit pts for writing - more const usage

Originally committed as revision 2255 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Fabrice Bellard 22 years ago
parent 8c653280bd
commit 490579042a
  1. 4
      libavformat/asf.c
  2. 2
      libavformat/au.c
  3. 2
      libavformat/audio.c
  4. 7
      libavformat/avformat.h
  5. 2
      libavformat/avienc.c
  6. 4
      libavformat/crc.c
  7. 4
      libavformat/dv.c
  8. 8
      libavformat/dvcore.c
  9. 6
      libavformat/dvcore.h
  10. 4
      libavformat/ffm.c
  11. 2
      libavformat/flvenc.c
  12. 8
      libavformat/gif.c
  13. 2
      libavformat/img.c
  14. 2
      libavformat/movenc.c
  15. 2
      libavformat/mp3.c
  16. 2
      libavformat/mpeg.c
  17. 4
      libavformat/mpegtsenc.c
  18. 4
      libavformat/mpjpeg.c
  19. 4
      libavformat/nut.c
  20. 4
      libavformat/raw.c
  21. 6
      libavformat/rm.c
  22. 14
      libavformat/rtp.c
  23. 6
      libavformat/swf.c
  24. 2
      libavformat/wav.c
  25. 2
      libavformat/yuv4mpeg.c

@ -584,7 +584,7 @@ static void put_frame_header(AVFormatContext *s, ASFStream *stream, int timestam
crap. They have misread the MPEG Systems spec ! crap. They have misread the MPEG Systems spec !
*/ */
static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp, static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
uint8_t *buf, int payload_size) const uint8_t *buf, int payload_size)
{ {
ASFContext *asf = s->priv_data; ASFContext *asf = s->priv_data;
int frag_pos, frag_len, frag_len1; int frag_pos, frag_len, frag_len1;
@ -617,7 +617,7 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
static int asf_write_packet(AVFormatContext *s, int stream_index, static int asf_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int timestamp) const uint8_t *buf, int size, int64_t timestamp)
{ {
ASFContext *asf = s->priv_data; ASFContext *asf = s->priv_data;
ASFStream *stream; ASFStream *stream;

@ -72,7 +72,7 @@ static int au_write_header(AVFormatContext *s)
} }
static int au_write_packet(AVFormatContext *s, int stream_index_ptr, static int au_write_packet(AVFormatContext *s, int stream_index_ptr,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
put_buffer(pb, buf, size); put_buffer(pb, buf, size);

@ -165,7 +165,7 @@ static int audio_write_header(AVFormatContext *s1)
} }
static int audio_write_packet(AVFormatContext *s1, int stream_index, static int audio_write_packet(AVFormatContext *s1, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
AudioData *s = s1->priv_data; AudioData *s = s1->priv_data;
int len, ret; int len, ret;

@ -7,8 +7,8 @@ extern "C" {
#define LIBAVFORMAT_VERSION_INT 0x000408 #define LIBAVFORMAT_VERSION_INT 0x000408
#define LIBAVFORMAT_VERSION "0.4.8" #define LIBAVFORMAT_VERSION "0.4.8"
#define LIBAVFORMAT_BUILD 4607 #define LIBAVFORMAT_BUILD 4608
#define LIBAVFORMAT_BUILD_STR "4607" #define LIBAVFORMAT_BUILD_STR "4608"
#define LIBAVFORMAT_IDENT "FFmpeg" LIBAVFORMAT_VERSION "b" LIBAVFORMAT_BUILD_STR #define LIBAVFORMAT_IDENT "FFmpeg" LIBAVFORMAT_VERSION "b" LIBAVFORMAT_BUILD_STR
@ -124,10 +124,9 @@ typedef struct AVOutputFormat {
enum CodecID audio_codec; /* default audio codec */ enum CodecID audio_codec; /* default audio codec */
enum CodecID video_codec; /* default video codec */ enum CodecID video_codec; /* default video codec */
int (*write_header)(struct AVFormatContext *); int (*write_header)(struct AVFormatContext *);
/* XXX: change prototype for 64 bit pts */
int (*write_packet)(struct AVFormatContext *, int (*write_packet)(struct AVFormatContext *,
int stream_index, int stream_index,
unsigned char *buf, int size, int force_pts); const uint8_t *buf, int size, int64_t pts);
int (*write_trailer)(struct AVFormatContext *); int (*write_trailer)(struct AVFormatContext *);
/* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */ /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */
int flags; int flags;

@ -590,7 +590,7 @@ static int avi_write_idx1(AVFormatContext *s)
} }
static int avi_write_packet(AVFormatContext *s, int stream_index, static int avi_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
AVIContext *avi = s->priv_data; AVIContext *avi = s->priv_data;
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;

@ -33,7 +33,7 @@
#define DO8(buf) DO4(buf); DO4(buf); #define DO8(buf) DO4(buf); DO4(buf);
#define DO16(buf) DO8(buf); DO8(buf); #define DO16(buf) DO8(buf); DO8(buf);
static uint32_t adler32(uint32_t adler, uint8_t *buf, unsigned int len) static uint32_t adler32(uint32_t adler, const uint8_t *buf, unsigned int len)
{ {
unsigned long s1 = adler & 0xffff; unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff; unsigned long s2 = (adler >> 16) & 0xffff;
@ -73,7 +73,7 @@ static int crc_write_header(struct AVFormatContext *s)
static int crc_write_packet(struct AVFormatContext *s, static int crc_write_packet(struct AVFormatContext *s,
int stream_index, int stream_index,
unsigned char *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
CRCState *crc = s->priv_data; CRCState *crc = s->priv_data;
crc->crcval = adler32(crc->crcval, buf, size); crc->crcval = adler32(crc->crcval, buf, size);

@ -102,8 +102,8 @@ int dv_write_header(struct AVFormatContext *s)
} }
int dv_write_packet(struct AVFormatContext *s, int dv_write_packet(struct AVFormatContext *s,
int stream_index, int stream_index,
unsigned char *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
DVMuxContext *c = s->priv_data; DVMuxContext *c = s->priv_data;

@ -418,7 +418,7 @@ void dv_format_frame(DVMuxContext *c, uint8_t* buf)
} }
} }
void dv_inject_audio(DVMuxContext *c, uint8_t* pcm, uint8_t* frame_ptr) void dv_inject_audio(DVMuxContext *c, const uint8_t* pcm, uint8_t* frame_ptr)
{ {
int i, j, d, of; int i, j, d, of;
for (i = 0; i < c->sys->difseg_size; i++) { for (i = 0; i < c->sys->difseg_size; i++) {
@ -434,7 +434,7 @@ void dv_inject_audio(DVMuxContext *c, uint8_t* pcm, uint8_t* frame_ptr)
} }
} }
void dv_inject_video(DVMuxContext *c, uint8_t* video_data, uint8_t* frame_ptr) void dv_inject_video(DVMuxContext *c, const uint8_t* video_data, uint8_t* frame_ptr)
{ {
int i, j; int i, j;
int ptr = 0; int ptr = 0;
@ -565,7 +565,7 @@ out:
} }
/* FIXME: The following three functions could be underengineered ;-) */ /* FIXME: The following three functions could be underengineered ;-) */
void dv_assemble_frame(DVMuxContext *c, uint8_t* video, uint8_t* audio, int asize) void dv_assemble_frame(DVMuxContext *c, const uint8_t* video, const uint8_t* audio, int asize)
{ {
uint8_t pcm[8192]; uint8_t pcm[8192];
uint8_t* frame = &c->frame_buf[0]; uint8_t* frame = &c->frame_buf[0];
@ -604,7 +604,7 @@ void dv_assemble_frame(DVMuxContext *c, uint8_t* video, uint8_t* audio, int asiz
/* FIXME: we have to have more sensible approach than this one */ /* FIXME: we have to have more sensible approach than this one */
if (fifo_size(&c->audio_data, c->audio_data.rptr) + asize >= AVCODEC_MAX_AUDIO_FRAME_SIZE) if (fifo_size(&c->audio_data, c->audio_data.rptr) + asize >= AVCODEC_MAX_AUDIO_FRAME_SIZE)
fprintf(stderr, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames); fprintf(stderr, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
fifo_write(&c->audio_data, audio, asize, &c->audio_data.wptr); fifo_write(&c->audio_data, (uint8_t *)audio, asize, &c->audio_data.wptr);
} }
} }

@ -59,14 +59,14 @@ typedef struct DVMuxContext {
} DVMuxContext; } DVMuxContext;
void dv_format_frame(DVMuxContext *, uint8_t*); void dv_format_frame(DVMuxContext *, uint8_t*);
void dv_inject_audio(DVMuxContext *, uint8_t*, uint8_t*); void dv_inject_audio(DVMuxContext *, const uint8_t*, uint8_t*);
void dv_inject_video(DVMuxContext *, uint8_t*, uint8_t*); void dv_inject_video(DVMuxContext *, const uint8_t*, uint8_t*);
int dv_extract_audio(uint8_t*, uint8_t*, AVCodecContext*); int dv_extract_audio(uint8_t*, uint8_t*, AVCodecContext*);
int dv_audio_frame_size(const DVprofile*, int); int dv_audio_frame_size(const DVprofile*, int);
void dv_assemble_frame(DVMuxContext *, uint8_t*, uint8_t*, int); void dv_assemble_frame(DVMuxContext *c, const uint8_t*, const uint8_t*, int);
int dv_core_init(DVMuxContext *, AVStream*[]); int dv_core_init(DVMuxContext *, AVStream*[]);
void dv_core_delete(DVMuxContext *); void dv_core_delete(DVMuxContext *);

@ -82,7 +82,7 @@ static void flush_packet(AVFormatContext *s)
/* 'first' is true if first data of a frame */ /* 'first' is true if first data of a frame */
static void ffm_write_data(AVFormatContext *s, static void ffm_write_data(AVFormatContext *s,
uint8_t *buf, int size, const uint8_t *buf, int size,
int64_t pts, int first) int64_t pts, int first)
{ {
FFMContext *ffm = s->priv_data; FFMContext *ffm = s->priv_data;
@ -215,7 +215,7 @@ static int ffm_write_header(AVFormatContext *s)
} }
static int ffm_write_packet(AVFormatContext *s, int stream_index, static int ffm_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t force_pts)
{ {
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];
FFMStream *fst = st->priv_data; FFMStream *fst = st->priv_data;

@ -242,7 +242,7 @@ static int flv_write_trailer(AVFormatContext *s)
} }
static int flv_write_packet(AVFormatContext *s, int stream_index, static int flv_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int timestamp) const uint8_t *buf, int size, int64_t timestamp)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
AVCodecContext *enc = &s->streams[stream_index]->codec; AVCodecContext *enc = &s->streams[stream_index]->codec;

@ -220,12 +220,12 @@ static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
static int gif_image_write_image(ByteIOContext *pb, static int gif_image_write_image(ByteIOContext *pb,
int x1, int y1, int width, int height, int x1, int y1, int width, int height,
uint8_t *buf, int linesize, int pix_fmt) const uint8_t *buf, int linesize, int pix_fmt)
{ {
PutBitContext p; PutBitContext p;
uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */ uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */
int i, left, w, v; int i, left, w, v;
uint8_t *ptr; const uint8_t *ptr;
/* image block */ /* image block */
put_byte(pb, 0x2c); put_byte(pb, 0x2c);
@ -331,7 +331,7 @@ static int gif_write_header(AVFormatContext *s)
} }
static int gif_write_video(AVFormatContext *s, static int gif_write_video(AVFormatContext *s,
AVCodecContext *enc, uint8_t *buf, int size) AVCodecContext *enc, const uint8_t *buf, int size)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
GIFContext *gif = s->priv_data; GIFContext *gif = s->priv_data;
@ -366,7 +366,7 @@ static int gif_write_video(AVFormatContext *s,
} }
static int gif_write_packet(AVFormatContext *s, int stream_index, static int gif_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
AVCodecContext *codec = &s->streams[stream_index]->codec; AVCodecContext *codec = &s->streams[stream_index]->codec;
if (codec->codec_type == CODEC_TYPE_AUDIO) if (codec->codec_type == CODEC_TYPE_AUDIO)

@ -301,7 +301,7 @@ static int img_write_header(AVFormatContext *s)
} }
static int img_write_packet(AVFormatContext *s, int stream_index, static int img_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
VideoData *img = s->priv_data; VideoData *img = s->priv_data;
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];

@ -675,7 +675,7 @@ static int Timestamp() {
} }
static int mov_write_packet(AVFormatContext *s, int stream_index, static int mov_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
MOVContext *mov = s->priv_data; MOVContext *mov = s->priv_data;
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;

@ -323,7 +323,7 @@ static int mp3_write_header(struct AVFormatContext *s)
} }
static int mp3_write_packet(struct AVFormatContext *s, int stream_index, static int mp3_write_packet(struct AVFormatContext *s, int stream_index,
unsigned char *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
put_buffer(&s->pb, buf, size); put_buffer(&s->pb, buf, size);
put_flush_packet(&s->pb); put_flush_packet(&s->pb);

@ -347,7 +347,7 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
} }
static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index, static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,
uint8_t *buf, int size, int pts) const uint8_t *buf, int size, int64_t pts)
{ {
MpegMuxContext *s = ctx->priv_data; MpegMuxContext *s = ctx->priv_data;
AVStream *st = ctx->streams[stream_index]; AVStream *st = ctx->streams[stream_index];

@ -22,7 +22,7 @@
/* write DVB SI sections */ /* write DVB SI sections */
static uint32_t crc_table[256] = { static const uint32_t crc_table[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
@ -454,7 +454,7 @@ static void retransmit_si_info(AVFormatContext *s)
} }
static int mpegts_write_packet(AVFormatContext *s, int stream_index, static int mpegts_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int pts1) const uint8_t *buf, int size, int64_t pts1)
{ {
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];
MpegTSWriteStream *ts_st = st->priv_data; MpegTSWriteStream *ts_st = st->priv_data;

@ -33,7 +33,7 @@ static int mpjpeg_write_header(AVFormatContext *s)
} }
static int mpjpeg_write_packet(AVFormatContext *s, int stream_index, static int mpjpeg_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
uint8_t buf1[256]; uint8_t buf1[256];
@ -75,7 +75,7 @@ static int single_jpeg_write_header(AVFormatContext *s)
} }
static int single_jpeg_write_packet(AVFormatContext *s, int stream_index, static int single_jpeg_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
put_buffer(&s->pb, buf, size); put_buffer(&s->pb, buf, size);
put_flush_packet(&s->pb); put_flush_packet(&s->pb);

@ -344,7 +344,7 @@ static int nut_write_header(AVFormatContext *s)
} }
static int nut_write_packet(AVFormatContext *s, int stream_index, static int nut_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
NUTContext *nut = s->priv_data; NUTContext *nut = s->priv_data;
ByteIOContext *bc = &s->pb; ByteIOContext *bc = &s->pb;
@ -372,7 +372,7 @@ static int nut_write_packet(AVFormatContext *s, int stream_index,
put_packetheader(nut, bc, size+20); put_packetheader(nut, bc, size+20);
put_v(bc, stream_index); put_v(bc, stream_index);
put_s(bc, force_pts); /* lsb_timestamp */ put_s(bc, pts); /* lsb_timestamp */
update_packetheader(nut, bc, size); update_packetheader(nut, bc, size);
put_buffer(bc, buf, size); put_buffer(bc, buf, size);

@ -25,7 +25,7 @@ static int raw_write_header(struct AVFormatContext *s)
} }
static int raw_write_packet(struct AVFormatContext *s, int stream_index, static int raw_write_packet(struct AVFormatContext *s, int stream_index,
unsigned char *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
put_buffer(&s->pb, buf, size); put_buffer(&s->pb, buf, size);
put_flush_packet(&s->pb); put_flush_packet(&s->pb);
@ -459,7 +459,7 @@ AVOutputFormat rawvideo_oformat = {
static int null_write_packet(struct AVFormatContext *s, static int null_write_packet(struct AVFormatContext *s,
int stream_index, int stream_index,
unsigned char *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
return 0; return 0;
} }

@ -323,7 +323,7 @@ static int rm_write_header(AVFormatContext *s)
return 0; return 0;
} }
static int rm_write_audio(AVFormatContext *s, uint8_t *buf, int size) static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size)
{ {
uint8_t *buf1; uint8_t *buf1;
RMContext *rm = s->priv_data; RMContext *rm = s->priv_data;
@ -348,7 +348,7 @@ static int rm_write_audio(AVFormatContext *s, uint8_t *buf, int size)
return 0; return 0;
} }
static int rm_write_video(AVFormatContext *s, uint8_t *buf, int size) static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size)
{ {
RMContext *rm = s->priv_data; RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
@ -389,7 +389,7 @@ static int rm_write_video(AVFormatContext *s, uint8_t *buf, int size)
} }
static int rm_write_packet(AVFormatContext *s, int stream_index, static int rm_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
if (s->streams[stream_index]->codec.codec_type == if (s->streams[stream_index]->codec.codec_type ==
CODEC_TYPE_AUDIO) CODEC_TYPE_AUDIO)

@ -425,7 +425,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
/* send an rtp packet. sequence number is incremented, but the caller /* send an rtp packet. sequence number is incremented, but the caller
must update the timestamp itself */ must update the timestamp itself */
static void rtp_send_data(AVFormatContext *s1, uint8_t *buf1, int len) static void rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
@ -451,7 +451,7 @@ static void rtp_send_data(AVFormatContext *s1, uint8_t *buf1, int len)
/* send an integer number of samples and compute time stamp and fill /* send an integer number of samples and compute time stamp and fill
the rtp send buffer before sending. */ the rtp send buffer before sending. */
static void rtp_send_samples(AVFormatContext *s1, static void rtp_send_samples(AVFormatContext *s1,
uint8_t *buf1, int size, int sample_size) const uint8_t *buf1, int size, int sample_size)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
int len, max_packet_size, n; int len, max_packet_size, n;
@ -484,7 +484,7 @@ static void rtp_send_samples(AVFormatContext *s1,
/* NOTE: we suppose that exactly one frame is given as argument here */ /* NOTE: we suppose that exactly one frame is given as argument here */
/* XXX: test it */ /* XXX: test it */
static void rtp_send_mpegaudio(AVFormatContext *s1, static void rtp_send_mpegaudio(AVFormatContext *s1,
uint8_t *buf1, int size) const uint8_t *buf1, int size)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0]; AVStream *st = s1->streams[0];
@ -540,7 +540,7 @@ static void rtp_send_mpegaudio(AVFormatContext *s1,
/* NOTE: a single frame must be passed with sequence header if /* NOTE: a single frame must be passed with sequence header if
needed. XXX: use slices. */ needed. XXX: use slices. */
static void rtp_send_mpegvideo(AVFormatContext *s1, static void rtp_send_mpegvideo(AVFormatContext *s1,
uint8_t *buf1, int size) const uint8_t *buf1, int size)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0]; AVStream *st = s1->streams[0];
@ -587,7 +587,7 @@ static void rtp_send_mpegvideo(AVFormatContext *s1,
} }
static void rtp_send_raw(AVFormatContext *s1, static void rtp_send_raw(AVFormatContext *s1,
uint8_t *buf1, int size) const uint8_t *buf1, int size)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0]; AVStream *st = s1->streams[0];
@ -613,7 +613,7 @@ static void rtp_send_raw(AVFormatContext *s1,
/* write an RTP packet. 'buf1' must contain a single specific frame. */ /* write an RTP packet. 'buf1' must contain a single specific frame. */
static int rtp_write_packet(AVFormatContext *s1, int stream_index, static int rtp_write_packet(AVFormatContext *s1, int stream_index,
uint8_t *buf1, int size, int force_pts) const uint8_t *buf1, int size, int64_t pts)
{ {
RTPContext *s = s1->priv_data; RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0]; AVStream *st = s1->streams[0];
@ -630,7 +630,7 @@ static int rtp_write_packet(AVFormatContext *s1, int stream_index,
if (s->first_packet || rtcp_bytes >= 28) { if (s->first_packet || rtcp_bytes >= 28) {
/* compute NTP time */ /* compute NTP time */
/* XXX: 90 kHz timestamp hardcoded */ /* XXX: 90 kHz timestamp hardcoded */
ntp_time = ((int64_t)force_pts << 28) / 5625; ntp_time = (pts << 28) / 5625;
rtcp_send_sr(s1, ntp_time); rtcp_send_sr(s1, ntp_time);
s->last_octet_count = s->octet_count; s->last_octet_count = s->octet_count;
s->first_packet = 0; s->first_packet = 0;

@ -318,7 +318,7 @@ static int swf_write_header(AVFormatContext *s)
} }
static int swf_write_video(AVFormatContext *s, static int swf_write_video(AVFormatContext *s,
AVCodecContext *enc, uint8_t *buf, int size) AVCodecContext *enc, const uint8_t *buf, int size)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
static int tag_id = 0; static int tag_id = 0;
@ -366,7 +366,7 @@ static int swf_write_video(AVFormatContext *s,
return 0; return 0;
} }
static int swf_write_audio(AVFormatContext *s, uint8_t *buf, int size) static int swf_write_audio(AVFormatContext *s, const uint8_t *buf, int size)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
@ -380,7 +380,7 @@ static int swf_write_audio(AVFormatContext *s, uint8_t *buf, int size)
} }
static int swf_write_packet(AVFormatContext *s, int stream_index, static int swf_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
AVCodecContext *codec = &s->streams[stream_index]->codec; AVCodecContext *codec = &s->streams[stream_index]->codec;
if (codec->codec_type == CODEC_TYPE_AUDIO) if (codec->codec_type == CODEC_TYPE_AUDIO)

@ -191,7 +191,7 @@ static int wav_write_header(AVFormatContext *s)
} }
static int wav_write_packet(AVFormatContext *s, int stream_index_ptr, static int wav_write_packet(AVFormatContext *s, int stream_index_ptr,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
put_buffer(pb, buf, size); put_buffer(pb, buf, size);

@ -113,7 +113,7 @@ static int yuv4_write_header(AVFormatContext *s)
} }
static int yuv4_write_packet(AVFormatContext *s, int stream_index, static int yuv4_write_packet(AVFormatContext *s, int stream_index,
uint8_t *buf, int size, int force_pts) const uint8_t *buf, int size, int64_t pts)
{ {
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;

Loading…
Cancel
Save