Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
df2cd483
Commit
df2cd483
authored
Jul 25, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream: use (s)size_t for callback prototypes
parent
5d6b149f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
48 additions
and
45 deletions
+48
-45
include/vlc_stream.h
include/vlc_stream.h
+1
-1
modules/access/rar/stream.c
modules/access/rar/stream.c
+1
-1
modules/access/zip/zipstream.c
modules/access/zip/zipstream.c
+3
-3
modules/stream_filter/aribcam.c
modules/stream_filter/aribcam.c
+1
-1
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+1
-1
modules/stream_filter/hds/hds.c
modules/stream_filter/hds/hds.c
+2
-2
modules/stream_filter/record.c
modules/stream_filter/record.c
+3
-3
modules/stream_filter/smooth/smooth.c
modules/stream_filter/smooth/smooth.c
+7
-7
src/input/stream_access.c
src/input/stream_access.c
+17
-16
src/input/stream_demux.c
src/input/stream_demux.c
+4
-4
src/input/stream_memory.c
src/input/stream_memory.c
+8
-6
No files found.
include/vlc_stream.h
View file @
df2cd483
...
...
@@ -57,7 +57,7 @@ struct stream_t
stream_t
*
p_source
;
/* */
int
(
*
pf_read
)
(
stream_t
*
,
void
*
p_read
,
unsigned
int
i_read
);
ssize_t
(
*
pf_read
)(
stream_t
*
,
void
*
,
size_t
);
input_item_t
*
(
*
pf_readdir
)(
stream_t
*
);
int
(
*
pf_control
)(
stream_t
*
,
int
i_query
,
va_list
);
...
...
modules/access/rar/stream.c
View file @
df2cd483
...
...
@@ -39,7 +39,7 @@ struct stream_sys_t {
stream_t
*
payload
;
};
static
int
Read
(
stream_t
*
s
,
void
*
data
,
unsigned
size
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
data
,
size_t
size
)
{
return
stream_Read
(
s
->
p_sys
->
payload
,
data
,
size
);
}
...
...
modules/access/zip/zipstream.c
View file @
df2cd483
...
...
@@ -53,7 +53,7 @@ vlc_module_end()
/** *************************************************************************
* Local prototypes
****************************************************************************/
static
int
Read
(
stream_t
*
,
void
*
p_read
,
unsigned
in
t
i_read
);
static
ssize_t
Read
(
stream_t
*
,
void
*
p_read
,
size_
t
i_read
);
static
int
Control
(
stream_t
*
,
int
i_query
,
va_list
);
typedef
struct
node
node
;
...
...
@@ -252,7 +252,7 @@ void StreamClose( vlc_object_t *p_this )
/** *************************************************************************
* Read
****************************************************************************/
static
int
Read
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
...
...
@@ -261,7 +261,7 @@ static int Read( stream_t *s, void *p_read, unsigned int i_read )
return
-
1
;
/* Read the buffer */
unsigned
i_len
=
__MIN
(
i_read
,
p_sys
->
i_len
-
p_sys
->
i_pos
);
size_t
i_len
=
__MIN
(
i_read
,
p_sys
->
i_len
-
p_sys
->
i_pos
);
if
(
p_read
)
memcpy
(
p_read
,
p_sys
->
psz_xspf
+
p_sys
->
i_pos
,
i_len
);
p_sys
->
i_pos
+=
i_len
;
...
...
modules/stream_filter/aribcam.c
View file @
df2cd483
...
...
@@ -237,7 +237,7 @@ static int DecoderRead( stream_t *p_stream, uint8_t *p_dst, int i_toread )
return
i_total_read
;
}
static
int
Read
(
stream_t
*
p_stream
,
void
*
p_buf
,
unsigned
in
t
i_toread
)
static
ssize_t
Read
(
stream_t
*
p_stream
,
void
*
p_buf
,
size_
t
i_toread
)
{
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
...
...
modules/stream_filter/decomp.c
View file @
df2cd483
...
...
@@ -191,7 +191,7 @@ static void *Thread (void *data)
* Reads decompressed from the decompression program
* @return -1 for EAGAIN, 0 for EOF, byte count otherwise.
*/
static
int
Read
(
stream_t
*
stream
,
void
*
buf
,
unsigned
in
t
buflen
)
static
ssize_t
Read
(
stream_t
*
stream
,
void
*
buf
,
size_
t
buflen
)
{
stream_sys_t
*
sys
=
stream
->
p_sys
;
ssize_t
ret
=
0
;
...
...
modules/stream_filter/hds/hds.c
View file @
df2cd483
...
...
@@ -216,7 +216,7 @@ vlc_module_begin()
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
static
int
Read
(
stream_t
*
,
void
*
,
unsigned
);
static
ssize_t
Read
(
stream_t
*
,
void
*
,
size_t
);
static
int
Control
(
stream_t
*
,
int
,
va_list
);
static
inline
bool
isFQUrl
(
const
char
*
url
)
...
...
@@ -1839,7 +1839,7 @@ static inline bool header_unfinished( stream_sys_t *p_sys )
return
p_sys
->
flv_header_bytes_sent
<
p_sys
->
flv_header_len
;
}
static
int
Read
(
stream_t
*
s
,
void
*
buffer
,
unsigned
i_read
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
buffer
,
size_t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
...
...
modules/stream_filter/record.c
View file @
df2cd483
...
...
@@ -64,7 +64,7 @@ struct stream_sys_t
/****************************************************************************
* Local prototypes
****************************************************************************/
static
int
Read
(
stream_t
*
,
void
*
p_read
,
unsigned
in
t
i_read
);
static
ssize_t
Read
(
stream_t
*
,
void
*
p_read
,
size_
t
i_read
);
static
int
Control
(
stream_t
*
,
int
i_query
,
va_list
);
static
int
Start
(
stream_t
*
,
const
char
*
psz_extension
);
...
...
@@ -111,7 +111,7 @@ static void Close( vlc_object_t *p_this )
/****************************************************************************
* Stream filters functions
****************************************************************************/
static
int
Read
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
void
*
p_record
=
p_read
;
...
...
@@ -121,7 +121,7 @@ static int Read( stream_t *s, void *p_read, unsigned int i_read )
p_record
=
malloc
(
i_read
);
/* */
const
in
t
i_record
=
stream_Read
(
s
->
p_source
,
p_record
,
i_read
);
const
ssize_
t
i_record
=
stream_Read
(
s
->
p_source
,
p_record
,
i_read
);
/* Dump read data */
if
(
p_sys
->
f
)
...
...
modules/stream_filter/smooth/smooth.c
View file @
df2cd483
...
...
@@ -59,7 +59,7 @@ vlc_module_begin()
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
static
int
Read
(
stream_t
*
,
void
*
,
unsigned
);
static
ssize_t
Read
(
stream_t
*
,
void
*
,
size_t
);
static
int
Control
(
stream_t
*
,
int
,
va_list
);
static
bool
isSmoothStreaming
(
stream_t
*
s
)
...
...
@@ -689,10 +689,10 @@ static chunk_t *get_chunk( stream_t *s, const bool wait, bool *pb_isinit )
return
p_chunk
;
}
static
unsigned
int
sms_Read
(
stream_t
*
s
,
uint8_t
*
p_read
,
unsigned
in
t
i_read
)
static
size_t
sms_Read
(
stream_t
*
s
,
uint8_t
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
unsigned
in
t
copied
=
0
;
size_
t
copied
=
0
;
chunk_t
*
chunk
=
NULL
;
do
...
...
@@ -732,7 +732,7 @@ static unsigned int sms_Read( stream_t *s, uint8_t *p_read, unsigned int i_read
if
(
chunk
->
read_pos
==
0
)
{
const
char
*
verb
=
p_read
==
NULL
?
"skipping"
:
"reading"
;
msg_Dbg
(
s
,
"%s chunk time %"
PRIu64
" (%u bytes), type %i"
,
msg_Dbg
(
s
,
"%s chunk time %"
PRIu64
" (%
z
u bytes), type %i"
,
verb
,
chunk
->
start_time
,
i_read
,
chunk
->
type
);
}
...
...
@@ -758,9 +758,9 @@ static unsigned int sms_Read( stream_t *s, uint8_t *p_read, unsigned int i_read
return
copied
;
}
static
int
Read
(
stream_t
*
s
,
void
*
buffer
,
unsigned
i_read
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
buffer
,
size_t
i_read
)
{
in
t
length
=
0
;
ssize_
t
length
=
0
;
i_read
=
__MIN
(
INT_MAX
,
i_read
);
length
=
sms_Read
(
s
,
(
uint8_t
*
)
buffer
,
i_read
);
...
...
@@ -772,7 +772,7 @@ static int Read( stream_t *s, void *buffer, unsigned i_read )
sms_Read
(
s
,
NULL
,
0
);
if
(
length
<
(
int
)
i_read
)
msg_Warn
(
s
,
"could not read %
u bytes, only %u
!"
,
i_read
,
length
);
msg_Warn
(
s
,
"could not read %
zu bytes, only %zd
!"
,
i_read
,
length
);
return
length
;
}
...
...
src/input/stream_access.c
View file @
df2cd483
...
...
@@ -157,22 +157,22 @@ struct stream_sys_t
};
/* Method 1: */
static
int
AStreamReadBlock
(
stream_t
*
s
,
void
*
p_read
,
unsigned
int
i_read
);
static
ssize_t
AStreamReadBlock
(
stream_t
*
,
void
*
,
size_t
);
static
int
AStreamSeekBlock
(
stream_t
*
s
,
uint64_t
i_pos
);
static
void
AStreamPrebufferBlock
(
stream_t
*
s
);
static
block_t
*
AReadBlock
(
stream_t
*
s
,
bool
*
pb_eof
);
/* Method 2 */
static
int
AStreamReadStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
int
i_read
);
static
ssize_t
AStreamReadStream
(
stream_t
*
,
void
*
,
size_t
);
static
int
AStreamSeekStream
(
stream_t
*
s
,
uint64_t
i_pos
);
static
void
AStreamPrebufferStream
(
stream_t
*
s
);
static
int
AReadStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
);
static
ssize_t
AReadStream
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
);
/* ReadDir */
static
input_item_t
*
AStreamReadDir
(
stream_t
*
s
);
/* Common */
static
int
AStreamReadError
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
AStreamReadError
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
(
void
)
s
;
(
void
)
p_read
;
(
void
)
i_read
;
return
VLC_EGENERIC
;
...
...
@@ -542,12 +542,12 @@ static void AStreamPrebufferBlock( stream_t *s )
static
int
AStreamRefillBlock
(
stream_t
*
s
);
static
int
AStreamReadBlock
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
AStreamReadBlock
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
uint8_t
*
p_data
=
p_read
;
unsigned
in
t
i_data
=
0
;
size_
t
i_data
=
0
;
/* It means EOF */
if
(
p_sys
->
block
.
p_current
==
NULL
)
...
...
@@ -566,9 +566,9 @@ static int AStreamReadBlock( stream_t *s, void *p_read, unsigned int i_read )
while
(
i_data
<
i_read
)
{
in
t
i_current
=
ssize_
t
i_current
=
p_sys
->
block
.
p_current
->
i_buffer
-
p_sys
->
block
.
i_offset
;
unsigned
int
i_copy
=
VLC_CLIP
(
(
unsigned
in
t
)
i_current
,
0
,
i_read
-
i_data
);
size_t
i_copy
=
VLC_CLIP
(
(
size_
t
)
i_current
,
0
,
i_read
-
i_data
);
/* Copy data */
if
(
p_data
)
...
...
@@ -791,9 +791,9 @@ static int AStreamRefillBlock( stream_t *s )
* Method 2:
****************************************************************************/
static
int
AStreamRefillStream
(
stream_t
*
s
);
static
int
AStreamReadNoSeekStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
int
i_read
);
static
ssize_t
AStreamReadNoSeekStream
(
stream_t
*
,
void
*
,
size_t
);
static
int
AStreamReadStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
AStreamReadStream
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
...
...
@@ -958,13 +958,14 @@ static int AStreamSeekStream( stream_t *s, uint64_t i_pos )
return
VLC_SUCCESS
;
}
static
int
AStreamReadNoSeekStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
int
i_read
)
static
ssize_t
AStreamReadNoSeekStream
(
stream_t
*
s
,
void
*
p_read
,
size_t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
stream_track_t
*
tk
=
&
p_sys
->
stream
.
tk
[
p_sys
->
stream
.
i_tk
];
uint8_t
*
p_data
=
(
uint8_t
*
)
p_read
;
unsigned
in
t
i_data
=
0
;
size_
t
i_data
=
0
;
if
(
tk
->
i_start
>=
tk
->
i_end
)
return
0
;
/* EOF */
...
...
@@ -979,10 +980,10 @@ static int AStreamReadNoSeekStream( stream_t *s, void *p_read, unsigned int i_re
while
(
i_data
<
i_read
)
{
unsigned
i_off
=
(
tk
->
i_start
+
p_sys
->
stream
.
i_offset
)
%
STREAM_CACHE_TRACK_SIZE
;
unsigned
in
t
i_current
=
size_
t
i_current
=
__MIN
(
tk
->
i_end
-
tk
->
i_start
-
p_sys
->
stream
.
i_offset
,
STREAM_CACHE_TRACK_SIZE
-
i_off
);
in
t
i_copy
=
__MIN
(
i_current
,
i_read
-
i_data
);
ssize_
t
i_copy
=
__MIN
(
i_current
,
i_read
-
i_data
);
if
(
i_copy
<=
0
)
break
;
/* EOF */
...
...
@@ -1004,7 +1005,7 @@ static int AStreamReadNoSeekStream( stream_t *s, void *p_read, unsigned int i_re
if
(
tk
->
i_end
+
i_data
<=
tk
->
i_start
+
p_sys
->
stream
.
i_offset
+
i_read
)
{
const
unsigned
i_read_requested
=
VLC_CLIP
(
i_read
-
i_data
,
const
size_t
i_read_requested
=
VLC_CLIP
(
i_read
-
i_data
,
STREAM_READ_ATONCE
/
2
,
STREAM_READ_ATONCE
*
10
);
...
...
@@ -1152,7 +1153,7 @@ static void AStreamPrebufferStream( stream_t *s )
/****************************************************************************
* Access reading/seeking wrappers to handle concatenated streams.
****************************************************************************/
static
int
AReadStream
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
AReadStream
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
input_thread_t
*
p_input
=
s
->
p_input
;
...
...
src/input/stream_demux.c
View file @
df2cd483
...
...
@@ -57,7 +57,7 @@ struct stream_sys_t
}
stats
;
};
static
int
DStreamRead
(
stream_t
*
,
void
*
p_read
,
unsigned
in
t
i_read
);
static
ssize_t
DStreamRead
(
stream_t
*
,
void
*
p_read
,
size_
t
i_read
);
static
int
DStreamControl
(
stream_t
*
,
int
i_query
,
va_list
);
static
void
DStreamDelete
(
stream_t
*
);
static
void
*
DStreamThread
(
void
*
);
...
...
@@ -173,18 +173,18 @@ static void DStreamDelete( stream_t *s )
}
static
int
DStreamRead
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
DStreamRead
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
uint8_t
*
p_out
=
p_read
;
in
t
i_out
=
0
;
size_
t
i_out
=
0
;
//msg_Dbg( s, "DStreamRead: wanted %d bytes", i_read );
while
(
atomic_load
(
&
p_sys
->
active
)
&&
!
s
->
b_error
&&
i_read
)
{
block_t
*
p_block
=
p_sys
->
p_block
;
in
t
i_copy
;
size_
t
i_copy
;
if
(
!
p_block
)
{
...
...
src/input/stream_memory.c
View file @
df2cd483
...
...
@@ -36,7 +36,7 @@ struct stream_sys_t
};
static
int
Read
(
stream_t
*
,
void
*
p_read
,
unsigned
in
t
i_read
);
static
ssize_t
Read
(
stream_t
*
,
void
*
p_read
,
size_
t
i_read
);
static
int
Control
(
stream_t
*
,
int
i_query
,
va_list
);
static
void
Delete
(
stream_t
*
);
...
...
@@ -151,12 +151,14 @@ static int Control( stream_t *s, int i_query, va_list args )
return
VLC_SUCCESS
;
}
static
int
Read
(
stream_t
*
s
,
void
*
p_read
,
unsigned
in
t
i_read
)
static
ssize_t
Read
(
stream_t
*
s
,
void
*
p_read
,
size_
t
i_read
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
int
i_res
=
__MIN
(
i_read
,
p_sys
->
i_size
-
p_sys
->
i_pos
);
if
(
i_read
>
p_sys
->
i_size
-
p_sys
->
i_pos
)
i_read
=
p_sys
->
i_size
-
p_sys
->
i_pos
;
if
(
p_read
)
memcpy
(
p_read
,
p_sys
->
p_buffer
+
p_sys
->
i_pos
,
i_re
s
);
p_sys
->
i_pos
+=
i_re
s
;
return
i_re
s
;
memcpy
(
p_read
,
p_sys
->
p_buffer
+
p_sys
->
i_pos
,
i_re
ad
);
p_sys
->
i_pos
+=
i_re
ad
;
return
i_re
ad
;
}
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