Showing the changes to avserver.c (1 of 1 file). Show all
Unified · Split
| @@ -26,13 +26,16 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <string.h> |
| 27 | 27 | #include <stdlib.h> |
| 28 | 28 | #include "libavformat/avformat.h" |
| 29 | +// FIXME those are internal headers, avserver _really_ shouldn't use them | |
| 29 | 30 | #include "libavformat/ffm.h" |
| 30 | 31 | #include "libavformat/network.h" |
| 31 | 32 | #include "libavformat/os_support.h" |
| 32 | 33 | #include "libavformat/rtpdec.h" |
| 33 | 34 | #include "libavformat/rtsp.h" |
| 34 | −// XXX for ffio_open_dyn_packet_buffer, to be removed | |
| 35 | 35 | #include "libavformat/avio_internal.h" |
| 36 | +#include "libavformat/internal.h" | |
| 37 | +#include "libavformat/url.h" | |
| 38 | + | |
| 36 | 39 | #include "libavutil/avstring.h" |
| 37 | 40 | #include "libavutil/lfg.h" |
| 38 | 41 | #include "libavutil/dict.h" |
| @@ -867,7 +870,7 @@ static void close_connection(HTTPContext *c) · 828 unmodified lines | ||
| 867 | 870 | } |
| 868 | 871 | h = c->rtp_handles[i]; |
| 869 | 872 | if (h) |
| 870 | − url_close(h); | |
| 873 | + ffurl_close(h); | |
| 871 | 874 | } |
| 872 | 875 | |
| 873 | 876 | ctx = &c->fmt_ctx; |
| @@ -2248,7 +2251,6 @@ static int http_prepare_data(HTTPContext *c) · 1374 unmodified lines | ||
| 2248 | 2251 | * Default value from Libav |
| 2249 | 2252 | * Try to set it use configuration option |
| 2250 | 2253 | */ |
| 2251 | − c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE); | |
| 2252 | 2254 | c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE); |
| 2253 | 2255 | |
| 2254 | 2256 | if (avformat_write_header(&c->fmt_ctx, NULL) < 0) { |
| @@ -2367,7 +2369,7 @@ static int http_prepare_data(HTTPContext *c) · 112 unmodified lines | ||
| 2367 | 2369 | if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP) |
| 2368 | 2370 | max_packet_size = RTSP_TCP_MAX_PACKET_SIZE; |
| 2369 | 2371 | else |
| 2370 | − max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]); | |
| 2372 | + max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size; | |
| 2371 | 2373 | ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size); |
| 2372 | 2374 | } else { |
| 2373 | 2375 | ret = avio_open_dyn_buf(&ctx->pb); |
| @@ -2520,8 +2522,8 @@ static int http_send_data(HTTPContext *c) · 146 unmodified lines | ||
| 2520 | 2522 | } else { |
| 2521 | 2523 | /* send RTP packet directly in UDP */ |
| 2522 | 2524 | c->buffer_ptr += 4; |
| 2523 | − url_write(c->rtp_handles[c->packet_stream_index], | |
| 2524 | − c->buffer_ptr, len); | |
| 2525 | + ffurl_write(c->rtp_handles[c->packet_stream_index], | |
| 2526 | + c->buffer_ptr, len); | |
| 2525 | 2527 | c->buffer_ptr += len; |
| 2526 | 2528 | /* here we continue as we can send several packets per 10 ms slot */ |
| 2527 | 2529 | } |
| @@ -3404,10 +3406,10 @@ static int rtp_new_av_stream(HTTPContext *c, · 876 unmodified lines | ||
| 3404 | 3406 | "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port)); |
| 3405 | 3407 | } |
| 3406 | 3408 | |
| 3407 | − if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0) | |
| 3409 | + if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0) | |
| 3408 | 3410 | goto fail; |
| 3409 | 3411 | c->rtp_handles[stream_index] = h; |
| 3410 | − max_packet_size = url_get_max_packet_size(h); | |
| 3412 | + max_packet_size = h->max_packet_size; | |
| 3411 | 3413 | break; |
| 3412 | 3414 | case RTSP_LOWER_TRANSPORT_TCP: |
| 3413 | 3415 | /* RTP/TCP case */ |
| @@ -3430,7 +3432,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 16 unmodified lines | ||
| 3430 | 3432 | if (avformat_write_header(ctx, NULL) < 0) { |
| 3431 | 3433 | fail: |
| 3432 | 3434 | if (h) |
| 3433 | − url_close(h); | |
| 3435 | + ffurl_close(h); | |
| 3434 | 3436 | av_free(ctx); |
| 3435 | 3437 | return -1; |
| 3436 | 3438 | } |
| @@ -3467,7 +3469,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop · 30 unmodified lines | ||
| 3467 | 3469 | } |
| 3468 | 3470 | fst->priv_data = av_mallocz(sizeof(FeedData)); |
| 3469 | 3471 | fst->index = stream->nb_streams; |
| 3470 | − av_set_pts_info(fst, 33, 1, 90000); | |
| 3472 | + avpriv_set_pts_info(fst, 33, 1, 90000); | |
| 3471 | 3473 | fst->sample_aspect_ratio = codec->sample_aspect_ratio; |
| 3472 | 3474 | stream->streams[stream->nb_streams++] = fst; |
| 3473 | 3475 | return fst; |