summaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-23 01:05:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-23 01:05:20 +0100
commitfeb997577b66367a0c4269100888640699ee890d (patch)
treeb6ff06f8d443ea963d082f97f51d07520833ae7e /ffserver.c
parent9bf9c314a093db16a009829bfe874bf03ffaecc9 (diff)
parent15cea3695daf3f6363794594982e3816ddc8d90b (diff)
downloadffmpeg-streaming-feb997577b66367a0c4269100888640699ee890d.zip
ffmpeg-streaming-feb997577b66367a0c4269100888640699ee890d.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits) riff: fix invalid av_freep() calls on EOF in ff_read_riff_info pam: Fix a typo that broke writing and reading PAM files. mxfdec: fix memleak on av_realloc failures mxfdec: Do not parse slices or DeltaEntryArrays. mxfdec: hybrid demuxing/seeking solution mxfdec: Add Avid's essence element key. mfxdec: Separate mxf_essence_container_uls for audio and video. mxfdec: Compute packet offsets properly. mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack. mxfdec: use av_dlog() for 'no corresponding source package found' mxfdec: Make mxf->partitions sorted by offset. mxfdec: parse ThisPartition mxfdec: Speed up metadata and index parsing. mxfdec: Make sure DataDefinition is consistent between material track and source track. mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf mxfdec: Add hack that adjusts the n_delta calculation when system items are present. mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays. mxfdec: Move FooterPartition to MXFContext and make sure it is never zero. mxfdec: check return value of avio_seek mxfdec: skip to end of structural sets ... Conflicts: configure libavcodec/pnm.c libavformat/mxfdec.c libavformat/riff.c libavformat/rtsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/ffserver.c b/ffserver.c
index c225a94..79463c0 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -30,13 +30,16 @@
#include <string.h>
#include <stdlib.h>
#include "libavformat/avformat.h"
+// FIXME those are internal headers, avserver _really_ shouldn't use them
#include "libavformat/ffm.h"
#include "libavformat/network.h"
#include "libavformat/os_support.h"
#include "libavformat/rtpdec.h"
#include "libavformat/rtsp.h"
-// XXX for ffio_open_dyn_packet_buffer, to be removed
#include "libavformat/avio_internal.h"
+#include "libavformat/internal.h"
+#include "libavformat/url.h"
+
#include "libavutil/avstring.h"
#include "libavutil/lfg.h"
#include "libavutil/dict.h"
@@ -874,7 +877,7 @@ static void close_connection(HTTPContext *c)
}
h = c->rtp_handles[i];
if (h)
- url_close(h);
+ ffurl_close(h);
}
ctx = &c->fmt_ctx;
@@ -2255,7 +2258,6 @@ static int http_prepare_data(HTTPContext *c)
* Default value from FFmpeg
* Try to set it use configuration option
*/
- c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE);
c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
@@ -2374,7 +2376,7 @@ static int http_prepare_data(HTTPContext *c)
if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
else
- max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
+ max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
} else {
ret = avio_open_dyn_buf(&ctx->pb);
@@ -2527,8 +2529,8 @@ static int http_send_data(HTTPContext *c)
} else {
/* send RTP packet directly in UDP */
c->buffer_ptr += 4;
- url_write(c->rtp_handles[c->packet_stream_index],
- c->buffer_ptr, len);
+ ffurl_write(c->rtp_handles[c->packet_stream_index],
+ c->buffer_ptr, len);
c->buffer_ptr += len;
/* here we continue as we can send several packets per 10 ms slot */
}
@@ -3411,10 +3413,10 @@ static int rtp_new_av_stream(HTTPContext *c,
"rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
}
- if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
+ if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0)
goto fail;
c->rtp_handles[stream_index] = h;
- max_packet_size = url_get_max_packet_size(h);
+ max_packet_size = h->max_packet_size;
break;
case RTSP_LOWER_TRANSPORT_TCP:
/* RTP/TCP case */
@@ -3437,7 +3439,7 @@ static int rtp_new_av_stream(HTTPContext *c,
if (avformat_write_header(ctx, NULL) < 0) {
fail:
if (h)
- url_close(h);
+ ffurl_close(h);
av_free(ctx);
return -1;
}
@@ -3474,7 +3476,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop
}
fst->priv_data = av_mallocz(sizeof(FeedData));
fst->index = stream->nb_streams;
- av_set_pts_info(fst, 33, 1, 90000);
+ avpriv_set_pts_info(fst, 33, 1, 90000);
fst->sample_aspect_ratio = codec->sample_aspect_ratio;
stream->streams[stream->nb_streams++] = fst;
return fst;
OpenPOWER on IntegriCloud