History

Reorder arguments for av_fifo_generic_read to be more logical and consistent with av_fifo_generic_write.

Originally committed as revision 17914 to svn://svn.ffmpeg.org/ffmpeg/trunk

Reimar Döffinger committed 17 years ago

Commit 3898eed1 parent 60f75ad7 files · +10 −8Browse files

Unified · Split

7 files
  1. doc/APIchanges +2 −0
  2. ffmpeg.c +2 −2
  3. libavformat/audiointerleave.c +1 −1
  4. libavformat/mpegenc.c +1 −1
  5. libavformat/swfenc.c +1 −1
  6. libavutil/fifo.c +2 −2
  7. libavutil/fifo.h +1 −1
doc/APIchanges+2−0
@@ -15,6 +15,8 @@ API changes, most recent first: · 14 unmodified lines
1520090308 - r17869 - lavu 50.0.0 - AVFifoBuffer1520090308 - r17869 - lavu 50.0.0 - AVFifoBuffer
16 av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped and replaced16 av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped and replaced
17 by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write and av_fifo_realloc2.17 by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write and av_fifo_realloc2.
18 In addition, the order of the function arguments of av_fifo_generic_read were changed
19 to match av_fifo_generic_write.
18 The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by applications,20 The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by applications,
19 they may not use sizeof() or directly access members.21 they may not use sizeof() or directly access members.
20 22
ffmpeg.c+2−2
@@ -672,7 +672,7 @@ static void do_audio_out(AVFormatContext *s, · 671 unmodified lines
672 AVPacket pkt;672 AVPacket pkt;
673 av_init_packet(&pkt);673 av_init_packet(&pkt);
674 674
675 av_fifo_generic_read(ost->fifo, frame_bytes, NULL, audio_buf);675 av_fifo_generic_read(ost->fifo, audio_buf, frame_bytes, NULL);
676 676
677 //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()677 //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
678 678
@@ -1452,7 +1452,7 @@ static int output_packet(AVInputStream *ist, int ist_index, · 773 unmodified lines
1452 if(fifo_bytes > 0 && enc->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {1452 if(fifo_bytes > 0 && enc->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
1453 int fs_tmp = enc->frame_size;1453 int fs_tmp = enc->frame_size;
1454 enc->frame_size = fifo_bytes / (2 * enc->channels);1454 enc->frame_size = fifo_bytes / (2 * enc->channels);
1455 av_fifo_generic_read(ost->fifo, fifo_bytes, NULL, samples);1455 av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
1456 ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);1456 ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
1457 enc->frame_size = fs_tmp;1457 enc->frame_size = fs_tmp;
1458 }1458 }
libavformat/audiointerleave.c+1−1
@@ -80,7 +80,7 @@ static int ff_interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt, · 79 unmodified lines
80 return 0;80 return 0;
81 81
82 av_new_packet(pkt, size);82 av_new_packet(pkt, size);
83 av_fifo_generic_read(aic->fifo, size, NULL, pkt->data);83 av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
84 84
85 pkt->dts = pkt->pts = aic->dts;85 pkt->dts = pkt->pts = aic->dts;
86 pkt->duration = av_rescale_q(*aic->samples, st->time_base, aic->time_base);86 pkt->duration = av_rescale_q(*aic->samples, st->time_base, aic->time_base);
libavformat/mpegenc.c+1−1
@@ -914,7 +914,7 @@ static int flush_packet(AVFormatContext *ctx, int stream_index, · 913 unmodified lines
914 914
915 /* output data */915 /* output data */
916 assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo));916 assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo));
917 av_fifo_generic_read(stream->fifo, payload_size - stuffing_size, &put_buffer, ctx->pb);917 av_fifo_generic_read(stream->fifo, ctx->pb, payload_size - stuffing_size, &put_buffer);
918 stream->bytes_to_iframe -= payload_size - stuffing_size;918 stream->bytes_to_iframe -= payload_size - stuffing_size;
919 }else{919 }else{
920 payload_size=920 payload_size=
libavformat/swfenc.c+1−1
@@ -419,7 +419,7 @@ static int swf_write_video(AVFormatContext *s, · 418 unmodified lines
419 put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);419 put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
420 put_le16(pb, swf->sound_samples);420 put_le16(pb, swf->sound_samples);
421 put_le16(pb, 0); // seek samples421 put_le16(pb, 0); // seek samples
422 av_fifo_generic_read(swf->audio_fifo, frame_size, &put_buffer, pb);422 av_fifo_generic_read(swf->audio_fifo, pb, frame_size, &put_buffer);
423 put_swf_end_tag(s);423 put_swf_end_tag(s);
424 424
425 /* update FIFO */425 /* update FIFO */
libavutil/fifo.c+2−2
@@ -63,7 +63,7 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) { · 62 unmodified lines
63 63
64 if (!f2)64 if (!f2)
65 return -1;65 return -1;
66 av_fifo_generic_read(f, len, NULL, f2->buffer);66 av_fifo_generic_read(f, f2->buffer, len, NULL);
67 f2->wptr += len;67 f2->wptr += len;
68 f2->wndx += len;68 f2->wndx += len;
69 av_free(f->buffer);69 av_free(f->buffer);
@@ -96,7 +96,7 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void · 26 unmodified lines
96}96}
97 97
98 98
99int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest)99int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int))
100{100{
101// Read memory barrier needed for SMP here in theory101// Read memory barrier needed for SMP here in theory
102 do {102 do {
libavutil/fifo.h+1−1
@@ -68,7 +68,7 @@ int av_fifo_size(AVFifoBuffer *f); · 67 unmodified lines
68 * @param *func generic read function68 * @param *func generic read function
69 * @param *dest data destination69 * @param *dest data destination
70 */70 */
71int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);71int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
72 72
73/**73/**
74 * Feeds data from a user-supplied callback to an AVFifoBuffer.74 * Feeds data from a user-supplied callback to an AVFifoBuffer.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t