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
12d8b77b
Commit
12d8b77b
authored
Jul 23, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended filter_chain_VideoFilter to support filters returning multiple pictures at once.
parent
121a30e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
3 deletions
+51
-3
src/misc/filter_chain.c
src/misc/filter_chain.c
+51
-3
No files found.
src/misc/filter_chain.c
View file @
12d8b77b
...
...
@@ -46,6 +46,7 @@ typedef struct chained_filter_t
/* Private filter chain data (shhhh!) */
struct
chained_filter_t
*
prev
,
*
next
;
vlc_mouse_t
*
mouse
;
picture_t
*
pending
;
}
chained_filter_t
;
/* Only use this with filter objects from _this_ C module */
...
...
@@ -98,6 +99,8 @@ static int filter_chain_DeleteFilterInternal( filter_chain_t *, filter_t * );
static
int
UpdateBufferFunctions
(
filter_chain_t
*
);
static
void
FilterDeletePictures
(
filter_t
*
,
picture_t
*
);
#undef filter_chain_New
/**
* Filter chain initialisation
...
...
@@ -221,25 +224,57 @@ const es_format_t *filter_chain_GetFmtOut( filter_chain_t *p_chain )
return
&
p_chain
->
fmt_out
;
}
picture_t
*
filter_chain_VideoFilter
(
filter_chain_t
*
p_chain
,
picture_t
*
p_pic
)
static
picture_t
*
FilterChainVideoFilter
(
chained_filter_t
*
f
,
picture_t
*
p_pic
)
{
for
(
chained_filter_t
*
f
=
p_chain
->
first
;
f
!=
NULL
;
f
=
f
->
next
)
for
(
;
f
!=
NULL
;
f
=
f
->
next
)
{
filter_t
*
p_filter
=
&
f
->
filter
;
p_pic
=
p_filter
->
pf_video_filter
(
p_filter
,
p_pic
);
if
(
!
p_pic
)
break
;
if
(
f
->
pending
)
{
msg_Warn
(
p_filter
,
"dropping pictures"
);
FilterDeletePictures
(
p_filter
,
f
->
pending
);
}
f
->
pending
=
p_pic
->
p_next
;
p_pic
->
p_next
=
NULL
;
}
return
p_pic
;
}
picture_t
*
filter_chain_VideoFilter
(
filter_chain_t
*
p_chain
,
picture_t
*
p_pic
)
{
if
(
p_pic
)
{
p_pic
=
FilterChainVideoFilter
(
p_chain
->
first
,
p_pic
);
if
(
p_pic
)
return
p_pic
;
}
for
(
chained_filter_t
*
b
=
p_chain
->
last
;
b
!=
NULL
;
b
=
b
->
prev
)
{
p_pic
=
b
->
pending
;
if
(
!
p_pic
)
continue
;
b
->
pending
=
p_pic
->
p_next
;
p_pic
->
p_next
=
NULL
;
p_pic
=
FilterChainVideoFilter
(
b
->
next
,
p_pic
);
if
(
p_pic
)
return
p_pic
;
}
return
NULL
;
}
void
filter_chain_VideoFlush
(
filter_chain_t
*
p_chain
)
{
for
(
chained_filter_t
*
f
=
p_chain
->
first
;
f
!=
NULL
;
f
=
f
->
next
)
{
filter_t
*
p_filter
=
&
f
->
filter
;
FilterDeletePictures
(
p_filter
,
f
->
pending
);
f
->
pending
=
NULL
;
filter_FlushPictures
(
p_filter
);
}
}
...
...
@@ -380,6 +415,7 @@ static filter_t *filter_chain_AppendFilterInternal( filter_chain_t *p_chain,
if
(
p_mouse
)
vlc_mouse_Init
(
p_mouse
);
p_chained
->
mouse
=
p_mouse
;
p_chained
->
pending
=
NULL
;
msg_Dbg
(
p_chain
->
p_this
,
"Filter '%s' (%p) appended to chain"
,
psz_name
?
psz_name
:
module_get_name
(
p_filter
->
p_module
,
false
),
...
...
@@ -463,6 +499,8 @@ static int filter_chain_DeleteFilterInternal( filter_chain_t *p_chain,
msg_Dbg
(
p_chain
->
p_this
,
"Filter %p removed from chain"
,
p_filter
);
FilterDeletePictures
(
&
p_chained
->
filter
,
p_chained
->
pending
);
/* Destroy the filter object */
if
(
IsInternalVideoAllocator
(
p_chained
)
)
AllocatorClean
(
&
internal_video_allocator
,
p_chained
);
...
...
@@ -479,6 +517,16 @@ static int filter_chain_DeleteFilterInternal( filter_chain_t *p_chain,
return
VLC_SUCCESS
;
}
static
void
FilterDeletePictures
(
filter_t
*
filter
,
picture_t
*
picture
)
{
while
(
picture
)
{
picture_t
*
next
=
picture
->
p_next
;
filter_DeletePicture
(
filter
,
picture
);
picture
=
next
;
}
}
/**
* Internal chain buffer handling
*/
...
...
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