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
15a2182a
Commit
15a2182a
authored
Aug 25, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: split out code for automatic filter probing
parent
3bf3de01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
src/input/input.c
src/input/input.c
+2
-0
src/input/stream.h
src/input/stream.h
+10
-3
src/input/stream_filter.c
src/input/stream_filter.c
+10
-6
No files found.
src/input/input.c
View file @
15a2182a
...
@@ -2309,6 +2309,8 @@ static int InputSourceInit( input_thread_t *p_input,
...
@@ -2309,6 +2309,8 @@ static int InputSourceInit( input_thread_t *p_input,
}
}
/* Add stream filters */
/* Add stream filters */
p_stream
=
stream_FilterAutoNew
(
p_stream
);
char
*
psz_stream_filter
=
var_GetNonEmptyString
(
p_input
,
char
*
psz_stream_filter
=
var_GetNonEmptyString
(
p_input
,
"stream-filter"
);
"stream-filter"
);
p_stream
=
stream_FilterChainNew
(
p_stream
,
psz_stream_filter
,
p_stream
=
stream_FilterChainNew
(
p_stream
,
psz_stream_filter
,
...
...
src/input/stream.h
View file @
15a2182a
...
@@ -46,11 +46,18 @@ stream_t *stream_AccessNew( access_t *p_access );
...
@@ -46,11 +46,18 @@ stream_t *stream_AccessNew( access_t *p_access );
stream_t
*
stream_FilterNew
(
stream_t
*
p_source
,
stream_t
*
stream_FilterNew
(
stream_t
*
p_source
,
const
char
*
psz_stream_filter
);
const
char
*
psz_stream_filter
);
/**
* Automatically wraps a stream with any applicable stream filter.
* @return the (outermost/downstream) stream filter; if no filters were added,
* then the function return the source parameter.
* @note The function never returns NULL.
*/
stream_t
*
stream_FilterAutoNew
(
stream_t
*
source
)
VLC_USED
;
/**
/**
* This function creates a chain of filters:
* This function creates a chain of filters:
* - first, automatic probed stream filters are inserted.
* - optional user filters (configured by psz_chain) are inserted.
* - then, optional user filters (configured by psz_chain) are inserted.
* - an optional record filter is inserted if b_record is true.
* - finaly, an optional record filter is inserted if b_record is true.
*
*
* You must release the returned value using stream_Delete unless it is used as a
* You must release the returned value using stream_Delete unless it is used as a
* source to another filter.
* source to another filter.
...
...
src/input/stream_filter.c
View file @
15a2182a
...
@@ -73,21 +73,25 @@ stream_t *stream_FilterNew( stream_t *p_source,
...
@@ -73,21 +73,25 @@ stream_t *stream_FilterNew( stream_t *p_source,
return
s
;
return
s
;
}
}
stream_t
*
stream_FilterChainNew
(
stream_t
*
p_source
,
/* Add automatic stream filter */
const
char
*
psz_chain
,
stream_t
*
stream_FilterAutoNew
(
stream_t
*
p_source
)
bool
b_record
)
{
{
/* Add auto stream filter */
for
(
;;
)
for
(
;;
)
{
{
stream_t
*
p_filter
=
stream_FilterNew
(
p_source
,
NULL
);
stream_t
*
p_filter
=
stream_FilterNew
(
p_source
,
NULL
);
if
(
!
p_filter
)
if
(
p_filter
==
NULL
)
break
;
break
;
msg_Dbg
(
p_filter
,
"
Inserted a stream filter"
);
msg_Dbg
(
p_filter
,
"
stream filter added to %p"
,
p_source
);
p_source
=
p_filter
;
p_source
=
p_filter
;
}
}
return
p_source
;
}
stream_t
*
stream_FilterChainNew
(
stream_t
*
p_source
,
const
char
*
psz_chain
,
bool
b_record
)
{
/* Add user stream filter */
/* Add user stream filter */
char
*
psz_tmp
=
psz_chain
?
strdup
(
psz_chain
)
:
NULL
;
char
*
psz_tmp
=
psz_chain
?
strdup
(
psz_chain
)
:
NULL
;
char
*
psz
=
psz_tmp
;
char
*
psz
=
psz_tmp
;
...
...
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