if (!c->last_packet_sent && c->state == HTTPSTATE_SEND_DATA_TRAILER) {
if (ctx->oformat) {
/* prepare header */
- if (url_open_dyn_buf(&ctx->pb) >= 0) {
+ if (avio_open_dyn_buf(&ctx->pb) >= 0) {
av_write_trailer(ctx);
av_freep(&c->pb_buffer);
url_close_dyn_buf(ctx->pb, &c->pb_buffer);
int i, len;
AVIOContext *pb;
- if (url_open_dyn_buf(&pb) < 0) {
+ if (avio_open_dyn_buf(&pb) < 0) {
/* XXX: return an error ? */
c->buffer_ptr = c->buffer;
c->buffer_end = c->buffer;
c->got_key_frame = 0;
/* prepare header and save header data in a stream */
- if (url_open_dyn_buf(&c->fmt_ctx.pb) < 0) {
+ if (avio_open_dyn_buf(&c->fmt_ctx.pb) < 0) {
/* XXX: potential leak */
return -1;
}
max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
ret = url_open_dyn_packet_buf(&ctx->pb, max_packet_size);
} else {
- ret = url_open_dyn_buf(&ctx->pb);
+ ret = avio_open_dyn_buf(&ctx->pb);
}
if (ret < 0) {
/* XXX: potential leak */
return -1;
ctx = &c->fmt_ctx;
/* prepare header */
- if (url_open_dyn_buf(&ctx->pb) < 0) {
+ if (avio_open_dyn_buf(&ctx->pb) < 0) {
/* XXX: potential leak */
return -1;
}
/* if already sending something, then wait. */
if (rtsp_c->state != RTSPSTATE_WAIT_REQUEST)
break;
- if (url_open_dyn_buf(&pb) < 0)
+ if (avio_open_dyn_buf(&pb) < 0)
goto fail1;
interleaved_index = c->packet_stream_index * 2;
/* RTCP packets are sent at odd indexes */
av_strlcpy(c->url, url, sizeof(c->url));
av_strlcpy(c->protocol, protocol, sizeof(c->protocol));
- if (url_open_dyn_buf(&c->pb) < 0) {
+ if (avio_open_dyn_buf(&c->pb) < 0) {
/* XXX: cannot do more */
c->pb = NULL; /* safety */
return -1;
int len;
uint8_t *pb;
AVIOContext *dyn_buf;
- if (url_open_dyn_buf(&dyn_buf) < 0)
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
return;
avio_put_str16le(dyn_buf, tag);
uint8_t *buf;
AVIOContext *dyn_buf;
- if (url_open_dyn_buf(&dyn_buf) < 0)
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
return AVERROR(ENOMEM);
hpos = put_header(pb, &ff_asf_comment_header);
else
desc = p ? p->name : enc->codec_name;
- if ( url_open_dyn_buf(&dyn_buf) < 0)
+ if ( avio_open_dyn_buf(&dyn_buf) < 0)
return AVERROR(ENOMEM);
avio_put_str16le(dyn_buf, desc);
int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
{
AVIOContext *pb;
- int ret = url_open_dyn_buf(&pb);
+ int ret = avio_open_dyn_buf(&pb);
if(ret < 0)
return ret;
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
#endif
attribute_deprecated void put_flush_packet(AVIOContext *s);
+attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
/**
* @}
*/
* @param s new IO context
* @return zero if no error.
*/
-int url_open_dyn_buf(AVIOContext **s);
+int avio_open_dyn_buf(AVIOContext **s);
/**
* Open a write only packetized memory stream with a maximum packet
/**
* Return the written size and a pointer to the buffer. The buffer
* must be freed with av_free(). If the buffer is opened with
- * url_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
+ * avio_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
* added; if opened with url_open_dyn_packet_buf, no padding is added.
*
* @param s IO context
{
return ffio_get_checksum(s);
}
+int url_open_dyn_buf(AVIOContext **s)
+{
+ return avio_open_dyn_buf(s);
+}
#endif
int avio_put_str(AVIOContext *s, const char *str)
return ret;
}
-/* url_open_dyn_buf and url_close_dyn_buf are used in rtp.c to send a response
+/* avio_open_dyn_buf and url_close_dyn_buf are used in rtp.c to send a response
* back to the server even if CONFIG_MUXERS is false. */
#if CONFIG_MUXERS || CONFIG_NETWORK
/* buffer handling */
return ret;
}
-int url_open_dyn_buf(AVIOContext **s)
+int avio_open_dyn_buf(AVIOContext **s)
{
return url_open_dyn_buf_internal(s, 0);
}
uint8_t *codecpriv;
int ret, codecpriv_size;
- ret = url_open_dyn_buf(&dyn_cp);
+ ret = avio_open_dyn_buf(&dyn_cp);
if(ret < 0)
return ret;
if (!s->pb->seekable) {
if (!mkv->dyn_bc)
- url_open_dyn_buf(&mkv->dyn_bc);
+ avio_open_dyn_buf(&mkv->dyn_bc);
pb = mkv->dyn_bc;
}
return 0;
}
- ret = url_open_dyn_buf(&pb_buf);
+ ret = avio_open_dyn_buf(&pb_buf);
if(ret < 0)
return ret;
goto done;
/* Open a buffer for writing the hint */
- if ((ret = url_open_dyn_buf(&hintbuf)) < 0)
+ if ((ret = avio_open_dyn_buf(&hintbuf)) < 0)
goto done;
av_init_packet(&hint_pkt);
count = write_hint_packets(hintbuf, buf, size, trk, &hint_pkt.dts);
uint8_t *pb;
int (*put)(AVIOContext*, const char*);
AVIOContext *dyn_buf;
- if (url_open_dyn_buf(&dyn_buf) < 0)
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
return AVERROR(ENOMEM);
/* check if the strings are ASCII-only and use UTF16 only if
AVIOContext *dyn_bc;
uint8_t *dyn_buf=NULL;
int count=0, dyn_size;
- int ret = url_open_dyn_buf(&dyn_bc);
+ int ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
AVIOContext *dyn_bc;
uint8_t *dyn_buf=NULL;
int count=0, dyn_size, i;
- int ret = url_open_dyn_buf(&dyn_bc);
+ int ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
AVChapter *ch = nut->avf->chapters[id];
int ret, dyn_size, count = 0;
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if (ret < 0)
return ret;
ff_metadata_conv_ctx(avctx, ff_nut_metadata_conv, NULL);
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
write_mainheader(nut, dyn_bc);
put_packet(nut, bc, dyn_bc, 1, MAIN_STARTCODE);
for (i=0; i < nut->avf->nb_streams; i++){
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
if ((ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i)) < 0)
put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
}
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
write_globalinfo(nut, dyn_bc);
put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
for (i = 0; i < nut->avf->nb_streams; i++) {
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
ret = write_streaminfo(nut, dyn_bc, i);
}
for (i = 0; i < nut->avf->nb_chapters; i++) {
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if (ret < 0)
return ret;
ret = write_chapter(nut, dyn_bc, i);
NULL);
nut->last_syncpoint_pos= avio_tell(bc);
- ret = url_open_dyn_buf(&dyn_bc);
+ ret = avio_open_dyn_buf(&dyn_bc);
if(ret < 0)
return ret;
put_tt(nut, nus->time_base, dyn_bc, pkt->dts);
int ret, size;
uint8_t *buf;
- ret = url_open_dyn_buf(&pb);
+ ret = avio_open_dyn_buf(&pb);
if (ret < 0)
return ret;
ffio_init_checksum(pb, ff_crc04C11DB7_update, 0);
return -1;
s->last_octet_count = s->octet_count;
- if (url_open_dyn_buf(&pb) < 0)
+ if (avio_open_dyn_buf(&pb) < 0)
return -1;
// Receiver Report
int len;
/* Send a small RTP packet */
- if (url_open_dyn_buf(&pb) < 0)
+ if (avio_open_dyn_buf(&pb) < 0)
return;
avio_w8(pb, (RTP_VERSION << 6));
av_free(buf);
/* Send a minimal RTCP RR */
- if (url_open_dyn_buf(&pb) < 0)
+ if (avio_open_dyn_buf(&pb) < 0)
return;
avio_w8(pb, (RTP_VERSION << 6));
av_free(p);
}
if (!len_off && !asf->pktbuf &&
- (res = url_open_dyn_buf(&asf->pktbuf)) < 0)
+ (res = avio_open_dyn_buf(&asf->pktbuf)) < 0)
return res;
if (!asf->pktbuf)
return AVERROR(EIO);
av_freep(&data->buf);
data->timestamp = *timestamp;
- if ((ret = url_open_dyn_buf(&data->dyn_buf)) < 0)
+ if ((ret = avio_open_dyn_buf(&data->dyn_buf)) < 0)
return ret;
}
avio_write(data->dyn_buf, buf, len);
url_close_dyn_buf(sv->pktbuf, &tmp);
av_free(tmp);
}
- if ((res = url_open_dyn_buf(&sv->pktbuf)) < 0)
+ if ((res = avio_open_dyn_buf(&sv->pktbuf)) < 0)
return res;
sv->timestamp = *timestamp;
}
// that for the next av_get_packet call
ret = end_packet ? 1 : 0;
}
- if ((res = url_open_dyn_buf(&vp8->data)) < 0)
+ if ((res = avio_open_dyn_buf(&vp8->data)) < 0)
return res;
vp8->is_keyframe = *buf & 1;
vp8->timestamp = ts;
// end packet has been lost somewhere, so drop buffered data
free_fragment_if_needed(data);
- if((res = url_open_dyn_buf(&data->fragment)) < 0)
+ if((res = avio_open_dyn_buf(&data->fragment)) < 0)
return res;
avio_write(data->fragment, buf, pkt_len);