Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
4c4427a7
Commit
4c4427a7
authored
Mar 17, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: make init_checksum() internal.
parent
ce02f9be
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
10 deletions
+21
-10
avio.h
libavformat/avio.h
+4
-3
avio_internal.h
libavformat/avio_internal.h
+3
-0
aviobuf.c
libavformat/aviobuf.c
+7
-1
nutdec.c
libavformat/nutdec.c
+2
-2
nutenc.c
libavformat/nutenc.c
+4
-3
oggenc.c
libavformat/oggenc.c
+1
-1
No files found.
libavformat/avio.h
View file @
4c4427a7
...
...
@@ -451,6 +451,10 @@ attribute_deprecated int url_ferror(AVIOContext *s);
attribute_deprecated
int
udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
attribute_deprecated
int
udp_get_local_port
(
URLContext
*
h
);
attribute_deprecated
void
init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
);
#endif
AVIOContext
*
avio_alloc_context
(
...
...
@@ -674,9 +678,6 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
unsigned
long
ff_crc04C11DB7_update
(
unsigned
long
checksum
,
const
uint8_t
*
buf
,
unsigned
int
len
);
unsigned
long
get_checksum
(
AVIOContext
*
s
);
void
init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
);
#if FF_API_UDP_GET_FILE
int
udp_get_file_handle
(
URLContext
*
h
);
...
...
libavformat/avio_internal.h
View file @
4c4427a7
...
...
@@ -74,5 +74,8 @@ int64_t ffio_read_seek (AVIOContext *h, int stream_index,
int
ff_udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
int
ff_udp_get_local_port
(
URLContext
*
h
);
void
ffio_init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
);
#endif // AVFORMAT_AVIO_INTERNAL_H
libavformat/aviobuf.c
View file @
4c4427a7
...
...
@@ -406,6 +406,12 @@ int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
{
return
ffio_read_seek
(
s
,
stream_index
,
timestamp
,
flags
);
}
void
init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
)
{
ffio_init_checksum
(
s
,
update_checksum
,
checksum
);
}
#endif
int
avio_put_str
(
AVIOContext
*
s
,
const
char
*
str
)
...
...
@@ -555,7 +561,7 @@ unsigned long get_checksum(AVIOContext *s)
return
s
->
checksum
;
}
void
init_checksum
(
AVIOContext
*
s
,
void
ffio_
init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
)
{
...
...
libavformat/nutdec.c
View file @
4c4427a7
...
...
@@ -104,14 +104,14 @@ static int get_packetheader(NUTContext *nut, AVIOContext *bc, int calculate_chec
startcode
=
av_be2ne64
(
startcode
);
startcode
=
ff_crc04C11DB7_update
(
0
,
(
uint8_t
*
)
&
startcode
,
8
);
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
startcode
);
ffio_
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
startcode
);
size
=
ffio_read_varlen
(
bc
);
if
(
size
>
4096
)
avio_rb32
(
bc
);
if
(
get_checksum
(
bc
)
&&
size
>
4096
)
return
-
1
;
init_checksum
(
bc
,
calculate_checksum
?
ff_crc04C11DB7_update
:
NULL
,
0
);
ffio_
init_checksum
(
bc
,
calculate_checksum
?
ff_crc04C11DB7_update
:
NULL
,
0
);
return
size
;
}
...
...
libavformat/nutenc.c
View file @
4c4427a7
...
...
@@ -24,6 +24,7 @@
#include "libavcodec/mpegaudiodata.h"
#include "nut.h"
#include "internal.h"
#include "avio_internal.h"
static
int
find_expected_header
(
AVCodecContext
*
c
,
int
size
,
int
key_frame
,
uint8_t
out
[
64
]){
int
sample_rate
=
c
->
sample_rate
;
...
...
@@ -284,14 +285,14 @@ static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, in
int
forw_ptr
=
dyn_size
+
4
*
calculate_checksum
;
if
(
forw_ptr
>
4096
)
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
ffio_
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
avio_wb64
(
bc
,
startcode
);
ff_put_v
(
bc
,
forw_ptr
);
if
(
forw_ptr
>
4096
)
avio_wl32
(
bc
,
get_checksum
(
bc
));
if
(
calculate_checksum
)
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
ffio_
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
avio_write
(
bc
,
dyn_buf
,
dyn_size
);
if
(
calculate_checksum
)
avio_wl32
(
bc
,
get_checksum
(
bc
));
...
...
@@ -806,7 +807,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
needed_flags
=
get_needed_flags
(
nut
,
nus
,
fc
,
pkt
);
header_idx
=
fc
->
header_idx
;
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
ffio_
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
0
);
avio_w8
(
bc
,
frame_code
);
if
(
flags
&
FLAG_CODED
){
ff_put_v
(
bc
,
(
flags
^
needed_flags
)
&
~
(
FLAG_CODED
));
...
...
libavformat/oggenc.c
View file @
4c4427a7
...
...
@@ -85,7 +85,7 @@ static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
ret
=
url_open_dyn_buf
(
&
pb
);
if
(
ret
<
0
)
return
ret
;
init_checksum
(
pb
,
ff_crc04C11DB7_update
,
0
);
ffio_
init_checksum
(
pb
,
ff_crc04C11DB7_update
,
0
);
ffio_wfourcc
(
pb
,
"OggS"
);
avio_w8
(
pb
,
0
);
avio_w8
(
pb
,
page
->
flags
|
extra_flags
);
...
...
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