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
88a3f058
Commit
88a3f058
authored
Jul 23, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aribcam: remove peek callback
parent
d2b8c6dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
68 deletions
+18
-68
modules/stream_filter/aribcam.c
modules/stream_filter/aribcam.c
+18
-68
No files found.
modules/stream_filter/aribcam.c
View file @
88a3f058
...
@@ -99,8 +99,6 @@ struct stream_sys_t
...
@@ -99,8 +99,6 @@ struct stream_sys_t
bool
b_unitsizeset
;
bool
b_unitsizeset
;
};
};
static
int
Peek
(
stream_t
*
,
const
uint8_t
**
,
unsigned
int
);
static
const
char
*
GetErrorMessage
(
const
int
i_error
,
static
const
char
*
GetErrorMessage
(
const
int
i_error
,
const
struct
error_messages_s
const
*
p_errors_messages
)
const
struct
error_messages_s
const
*
p_errors_messages
)
{
{
...
@@ -114,7 +112,7 @@ static const char * GetErrorMessage( const int i_error,
...
@@ -114,7 +112,7 @@ static const char * GetErrorMessage( const int i_error,
return
"unkown error"
;
return
"unkown error"
;
}
}
static
size_t
RemainRead
(
stream_t
*
p_stream
,
uint8_t
*
p_data
,
size_t
i_toread
,
bool
b_peek
)
static
size_t
RemainRead
(
stream_t
*
p_stream
,
uint8_t
*
p_data
,
size_t
i_toread
)
{
{
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
...
@@ -129,22 +127,17 @@ static size_t RemainRead( stream_t *p_stream, uint8_t *p_data, size_t i_toread,
...
@@ -129,22 +127,17 @@ static size_t RemainRead( stream_t *p_stream, uint8_t *p_data, size_t i_toread,
i_total
+=
i_copy
;
i_total
+=
i_copy
;
p_data
+=
i_copy
;
p_data
+=
i_copy
;
if
(
!
b_peek
)
/* update block data pointer and release if no longer needed */
{
p_sys
->
remain
.
p_list
->
i_buffer
-=
i_copy
;
/* update block data pointer and release if no longer needed */
p_sys
->
remain
.
p_list
->
p_buffer
+=
i_copy
;
p_sys
->
remain
.
p_list
->
i_buffer
-=
i_copy
;
p_sys
->
remain
.
i_size
-=
i_copy
;
p_sys
->
remain
.
p_list
->
p_buffer
+=
i_copy
;
p_sys
->
remain
.
i_size
-=
i_copy
;
if
(
p_sys
->
remain
.
p_list
->
i_buffer
==
0
)
if
(
p_sys
->
remain
.
p_list
->
i_buffer
==
0
)
{
{
block_t
*
p_prevhead
=
p_sys
->
remain
.
p_list
;
block_t
*
p_prevhead
=
p_sys
->
remain
.
p_list
;
p_sys
->
remain
.
p_list
=
p_sys
->
remain
.
p_list
->
p_next
;
block_Release
(
p_prevhead
);
}
}
else
p_sys
->
remain
.
p_list
=
p_sys
->
remain
.
p_list
->
p_next
;
p_sys
->
remain
.
p_list
=
p_sys
->
remain
.
p_list
->
p_next
;
block_Release
(
p_prevhead
);
}
}
}
return
i_total
;
return
i_total
;
}
}
...
@@ -173,7 +166,7 @@ static void RemainFlush( stream_sys_t *p_sys )
...
@@ -173,7 +166,7 @@ static void RemainFlush( stream_sys_t *p_sys )
#define ALL_READY (UNIT_SIZE_READY|ECM_READY|PMT_READY)
#define ALL_READY (UNIT_SIZE_READY|ECM_READY|PMT_READY)
static
int
DecoderRead
(
stream_t
*
p_stream
,
uint8_t
*
p_dst
,
int
i_toread
,
bool
b_peek
)
static
int
DecoderRead
(
stream_t
*
p_stream
,
uint8_t
*
p_dst
,
int
i_toread
)
{
{
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
ARIB_STD_B25_BUFFER
getbuf
=
{
NULL
,
0
};
ARIB_STD_B25_BUFFER
getbuf
=
{
NULL
,
0
};
...
@@ -184,7 +177,7 @@ static int DecoderRead( stream_t *p_stream, uint8_t *p_dst, int i_toread, bool b
...
@@ -184,7 +177,7 @@ static int DecoderRead( stream_t *p_stream, uint8_t *p_dst, int i_toread, bool b
return
-
1
;
return
-
1
;
/* Use data from previous reads */
/* Use data from previous reads */
size_t
i_fromremain
=
RemainRead
(
p_stream
,
p_dst
,
i_toread
,
b_peek
);
size_t
i_fromremain
=
RemainRead
(
p_stream
,
p_dst
,
i_toread
);
i_toread
-=
i_fromremain
;
i_toread
-=
i_fromremain
;
i_total_read
+=
i_fromremain
;
i_total_read
+=
i_fromremain
;
...
@@ -227,20 +220,12 @@ static int DecoderRead( stream_t *p_stream, uint8_t *p_dst, int i_toread, bool b
...
@@ -227,20 +220,12 @@ static int DecoderRead( stream_t *p_stream, uint8_t *p_dst, int i_toread, bool b
if
(
i_ret
<
0
)
if
(
i_ret
<
0
)
return
-
1
;
return
-
1
;
if
(
b_peek
)
memcpy
(
p_dst
,
getbuf
.
data
,
__MIN
(
getbuf
.
size
,
i_toread
)
);
{
/* put everything in remain */
RemainAdd
(
p_stream
,
getbuf
.
data
,
getbuf
.
size
);
}
else
{
memcpy
(
p_dst
,
getbuf
.
data
,
__MIN
(
getbuf
.
size
,
i_toread
)
);
if
(
getbuf
.
size
>
i_toread
)
if
(
getbuf
.
size
>
i_toread
)
{
{
/* Hold remaining data for next call */
/* Hold remaining data for next call */
RemainAdd
(
p_stream
,
getbuf
.
data
+
i_toread
,
getbuf
.
size
-
i_toread
);
RemainAdd
(
p_stream
,
getbuf
.
data
+
i_toread
,
getbuf
.
size
-
i_toread
);
}
}
}
i_total_read
+=
__MIN
(
getbuf
.
size
,
i_toread
);
i_total_read
+=
__MIN
(
getbuf
.
size
,
i_toread
);
...
@@ -268,7 +253,7 @@ static int Read( stream_t *p_stream, void *p_buf, unsigned int i_toread )
...
@@ -268,7 +253,7 @@ static int Read( stream_t *p_stream, void *p_buf, unsigned int i_toread )
msg_Dbg
(
p_stream
,
"Set unit size to %u"
,
i_toread
);
msg_Dbg
(
p_stream
,
"Set unit size to %u"
,
i_toread
);
}
}
int
i_read
=
DecoderRead
(
p_stream
,
p_buf
,
i_toread
,
false
);
int
i_read
=
DecoderRead
(
p_stream
,
p_buf
,
i_toread
);
if
(
i_read
<
0
)
if
(
i_read
<
0
)
return
-
1
;
return
-
1
;
else
else
...
@@ -280,40 +265,6 @@ static int Read( stream_t *p_stream, void *p_buf, unsigned int i_toread )
...
@@ -280,40 +265,6 @@ static int Read( stream_t *p_stream, void *p_buf, unsigned int i_toread )
*
*
*/
*/
static
int
Peek
(
stream_t
*
p_stream
,
const
uint8_t
**
pp_buf
,
unsigned
int
i_len
)
{
stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
i_len
=
__MAX
(
ARIB_STD_B25_TS_PROBING_MIN_DATA
,
i_len
);
if
(
i_len
>
p_sys
->
remain
.
i_size
)
{
uint8_t
*
p_tmpbuf
=
malloc
(
i_len
-
p_sys
->
remain
.
i_size
);
DecoderRead
(
p_stream
,
p_tmpbuf
,
i_len
-
p_sys
->
remain
.
i_size
,
true
);
free
(
p_tmpbuf
);
}
if
(
!
p_sys
->
remain
.
p_list
)
{
assert
(
p_sys
->
remain
.
i_size
==
0
);
/* might not be enough data in the stream to allow returning data */
return
0
;
}
if
(
p_sys
->
remain
.
p_list
->
i_buffer
<
i_len
)
{
p_sys
->
remain
.
p_list
=
block_ChainGather
(
p_sys
->
remain
.
p_list
);
if
(
!
p_sys
->
remain
.
p_list
)
{
p_sys
->
remain
.
i_size
=
0
;
return
0
;
}
}
*
pp_buf
=
p_sys
->
remain
.
p_list
->
p_buffer
;
return
__MIN
(
i_len
,
p_sys
->
remain
.
i_size
);
}
static
int
Seek
(
stream_t
*
p_stream
,
uint64_t
i_pos
)
static
int
Seek
(
stream_t
*
p_stream
,
uint64_t
i_pos
)
{
{
int
i_ret
=
stream_Seek
(
p_stream
->
p_source
,
i_pos
);
int
i_ret
=
stream_Seek
(
p_stream
->
p_source
,
i_pos
);
...
@@ -415,7 +366,6 @@ static int Open( vlc_object_t *p_object )
...
@@ -415,7 +366,6 @@ static int Open( vlc_object_t *p_object )
p_sys
->
i_pos
=
stream_Tell
(
p_stream
->
p_source
);
p_sys
->
i_pos
=
stream_Tell
(
p_stream
->
p_source
);
p_stream
->
pf_read
=
Read
;
p_stream
->
pf_read
=
Read
;
p_stream
->
pf_peek
=
Peek
;
p_stream
->
pf_control
=
Control
;
p_stream
->
pf_control
=
Control
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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