This temporarily (until 0.8 is released) reverts commit
8e1340abc316e038bb89e5a3b46e92ff58c98a88. That commit breaks shared
builds because of symbol hiding. Reverting it will enable shared builds
for 0.8
| ... | ... |
@@ -26,16 +26,13 @@ |
| 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 |
|
| 30 | 29 |
#include "libavformat/ffm.h" |
| 31 | 30 |
#include "libavformat/network.h" |
| 32 | 31 |
#include "libavformat/os_support.h" |
| 33 | 32 |
#include "libavformat/rtpdec.h" |
| 34 | 33 |
#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 |
- |
|
| 39 | 36 |
#include "libavutil/avstring.h" |
| 40 | 37 |
#include "libavutil/lfg.h" |
| 41 | 38 |
#include "libavutil/dict.h" |
| ... | ... |
@@ -870,7 +867,7 @@ static void close_connection(HTTPContext *c) |
| 870 | 870 |
} |
| 871 | 871 |
h = c->rtp_handles[i]; |
| 872 | 872 |
if (h) |
| 873 |
- ffurl_close(h); |
|
| 873 |
+ url_close(h); |
|
| 874 | 874 |
} |
| 875 | 875 |
|
| 876 | 876 |
ctx = &c->fmt_ctx; |
| ... | ... |
@@ -2251,6 +2248,7 @@ static int http_prepare_data(HTTPContext *c) |
| 2251 | 2251 |
* Default value from Libav |
| 2252 | 2252 |
* Try to set it use configuration option |
| 2253 | 2253 |
*/ |
| 2254 |
+ c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE); |
|
| 2254 | 2255 |
c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE); |
| 2255 | 2256 |
|
| 2256 | 2257 |
if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
|
| ... | ... |
@@ -2369,7 +2367,7 @@ static int http_prepare_data(HTTPContext *c) |
| 2369 | 2369 |
if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP) |
| 2370 | 2370 |
max_packet_size = RTSP_TCP_MAX_PACKET_SIZE; |
| 2371 | 2371 |
else |
| 2372 |
- max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size; |
|
| 2372 |
+ max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]); |
|
| 2373 | 2373 |
ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size); |
| 2374 | 2374 |
} else {
|
| 2375 | 2375 |
ret = avio_open_dyn_buf(&ctx->pb); |
| ... | ... |
@@ -2522,8 +2520,8 @@ static int http_send_data(HTTPContext *c) |
| 2522 | 2522 |
} else {
|
| 2523 | 2523 |
/* send RTP packet directly in UDP */ |
| 2524 | 2524 |
c->buffer_ptr += 4; |
| 2525 |
- ffurl_write(c->rtp_handles[c->packet_stream_index], |
|
| 2526 |
- c->buffer_ptr, len); |
|
| 2525 |
+ url_write(c->rtp_handles[c->packet_stream_index], |
|
| 2526 |
+ c->buffer_ptr, len); |
|
| 2527 | 2527 |
c->buffer_ptr += len; |
| 2528 | 2528 |
/* here we continue as we can send several packets per 10 ms slot */ |
| 2529 | 2529 |
} |
| ... | ... |
@@ -3406,10 +3404,10 @@ static int rtp_new_av_stream(HTTPContext *c, |
| 3406 | 3406 |
"rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port)); |
| 3407 | 3407 |
} |
| 3408 | 3408 |
|
| 3409 |
- if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0) |
|
| 3409 |
+ if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0) |
|
| 3410 | 3410 |
goto fail; |
| 3411 | 3411 |
c->rtp_handles[stream_index] = h; |
| 3412 |
- max_packet_size = h->max_packet_size; |
|
| 3412 |
+ max_packet_size = url_get_max_packet_size(h); |
|
| 3413 | 3413 |
break; |
| 3414 | 3414 |
case RTSP_LOWER_TRANSPORT_TCP: |
| 3415 | 3415 |
/* RTP/TCP case */ |
| ... | ... |
@@ -3432,7 +3430,7 @@ static int rtp_new_av_stream(HTTPContext *c, |
| 3432 | 3432 |
if (avformat_write_header(ctx, NULL) < 0) {
|
| 3433 | 3433 |
fail: |
| 3434 | 3434 |
if (h) |
| 3435 |
- ffurl_close(h); |
|
| 3435 |
+ url_close(h); |
|
| 3436 | 3436 |
av_free(ctx); |
| 3437 | 3437 |
return -1; |
| 3438 | 3438 |
} |
| ... | ... |
@@ -3469,7 +3467,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop |
| 3469 | 3469 |
} |
| 3470 | 3470 |
fst->priv_data = av_mallocz(sizeof(FeedData)); |
| 3471 | 3471 |
fst->index = stream->nb_streams; |
| 3472 |
- avpriv_set_pts_info(fst, 33, 1, 90000); |
|
| 3472 |
+ av_set_pts_info(fst, 33, 1, 90000); |
|
| 3473 | 3473 |
fst->sample_aspect_ratio = codec->sample_aspect_ratio; |
| 3474 | 3474 |
stream->streams[stream->nb_streams++] = fst; |
| 3475 | 3475 |
return fst; |