Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b92c5452
Commit
b92c5452
authored
Mar 17, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: avio_ prefix for url_open_dyn_buf
parent
8978feda
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
43 additions
and
38 deletions
+43
-38
ffserver.c
ffserver.c
+7
-7
asfenc.c
libavformat/asfenc.c
+3
-3
avc.c
libavformat/avc.c
+1
-1
avio.h
libavformat/avio.h
+3
-2
aviobuf.c
libavformat/aviobuf.c
+6
-2
matroskaenc.c
libavformat/matroskaenc.c
+2
-2
movenc.c
libavformat/movenc.c
+1
-1
movenchint.c
libavformat/movenchint.c
+1
-1
mp3enc.c
libavformat/mp3enc.c
+1
-1
nutenc.c
libavformat/nutenc.c
+9
-9
oggenc.c
libavformat/oggenc.c
+1
-1
rtpdec.c
libavformat/rtpdec.c
+3
-3
rtpdec_asf.c
libavformat/rtpdec_asf.c
+1
-1
rtpdec_latm.c
libavformat/rtpdec_latm.c
+1
-1
rtpdec_svq3.c
libavformat/rtpdec_svq3.c
+1
-1
rtpdec_vp8.c
libavformat/rtpdec_vp8.c
+1
-1
rtpdec_xiph.c
libavformat/rtpdec_xiph.c
+1
-1
No files found.
ffserver.c
View file @
b92c5452
...
...
@@ -869,7 +869,7 @@ static void close_connection(HTTPContext *c)
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
);
...
...
@@ -1873,7 +1873,7 @@ static void compute_status(HTTPContext *c)
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
;
...
...
@@ -2256,7 +2256,7 @@ static int http_prepare_data(HTTPContext *c)
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
;
}
...
...
@@ -2391,7 +2391,7 @@ static int http_prepare_data(HTTPContext *c)
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 */
...
...
@@ -2432,7 +2432,7 @@ static int http_prepare_data(HTTPContext *c)
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
;
}
...
...
@@ -2503,7 +2503,7 @@ static int http_send_data(HTTPContext *c)
/* 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 */
...
...
@@ -2850,7 +2850,7 @@ static int rtsp_parse_request(HTTPContext *c)
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
;
...
...
libavformat/asfenc.c
View file @
b92c5452
...
...
@@ -234,7 +234,7 @@ static void put_str16(AVIOContext *s, const char *tag)
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
);
...
...
@@ -366,7 +366,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
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
);
...
...
@@ -497,7 +497,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
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
);
...
...
libavformat/avc.c
View file @
b92c5452
...
...
@@ -89,7 +89,7 @@ int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
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
;
...
...
libavformat/avio.h
View file @
b92c5452
...
...
@@ -447,6 +447,7 @@ attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __att
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
);
/**
* @}
*/
...
...
@@ -680,7 +681,7 @@ attribute_deprecated int url_close_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
...
...
@@ -696,7 +697,7 @@ int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
/**
* 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
...
...
libavformat/aviobuf.c
View file @
b92c5452
...
...
@@ -419,6 +419,10 @@ unsigned long get_checksum(AVIOContext *s)
{
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
)
...
...
@@ -1023,7 +1027,7 @@ int64_t ffio_read_seek(AVIOContext *s, int stream_index,
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 */
...
...
@@ -1147,7 +1151,7 @@ static int url_open_dyn_buf_internal(AVIOContext **s, int max_packet_size)
return
ret
;
}
int
url
_open_dyn_buf
(
AVIOContext
**
s
)
int
avio
_open_dyn_buf
(
AVIOContext
**
s
)
{
return
url_open_dyn_buf_internal
(
s
,
0
);
}
...
...
libavformat/matroskaenc.c
View file @
b92c5452
...
...
@@ -455,7 +455,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
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
;
...
...
@@ -1026,7 +1026,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
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
;
}
...
...
libavformat/movenc.c
View file @
b92c5452
...
...
@@ -1660,7 +1660,7 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
return
0
;
}
ret
=
url
_open_dyn_buf
(
&
pb_buf
);
ret
=
avio
_open_dyn_buf
(
&
pb_buf
);
if
(
ret
<
0
)
return
ret
;
...
...
libavformat/movenchint.c
View file @
b92c5452
...
...
@@ -417,7 +417,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
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
);
...
...
libavformat/mp3enc.c
View file @
b92c5452
...
...
@@ -96,7 +96,7 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
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
...
...
libavformat/nutenc.c
View file @
b92c5452
...
...
@@ -436,7 +436,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc){
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
;
...
...
@@ -462,7 +462,7 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){
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
;
...
...
@@ -495,7 +495,7 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
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
;
...
...
@@ -522,14 +522,14 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
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
)
...
...
@@ -537,14 +537,14 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
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
);
...
...
@@ -560,7 +560,7 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
}
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
);
...
...
@@ -728,7 +728,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
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
);
...
...
libavformat/oggenc.c
View file @
b92c5452
...
...
@@ -82,7 +82,7 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
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
);
...
...
libavformat/rtpdec.c
View file @
b92c5452
...
...
@@ -264,7 +264,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
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
...
...
@@ -339,7 +339,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
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
));
...
...
@@ -355,7 +355,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
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
));
...
...
libavformat/rtpdec_asf.c
View file @
b92c5452
...
...
@@ -208,7 +208,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
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
);
...
...
libavformat/rtpdec_latm.c
View file @
b92c5452
...
...
@@ -65,7 +65,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
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
);
...
...
libavformat/rtpdec_svq3.c
View file @
b92c5452
...
...
@@ -86,7 +86,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
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
;
}
...
...
libavformat/rtpdec_vp8.c
View file @
b92c5452
...
...
@@ -85,7 +85,7 @@ static int vp8_handle_packet(AVFormatContext *ctx,
// 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
;
...
...
libavformat/rtpdec_xiph.c
View file @
b92c5452
...
...
@@ -176,7 +176,7 @@ static int xiph_handle_packet(AVFormatContext * ctx,
// 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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment