Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2672302f
Commit
2672302f
authored
Oct 16, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify picture selection in vout.
parent
d4980f0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
59 deletions
+32
-59
src/video_output/video_output.c
src/video_output/video_output.c
+32
-59
No files found.
src/video_output/video_output.c
View file @
2672302f
...
@@ -889,8 +889,6 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -889,8 +889,6 @@ static void* RunThread( vlc_object_t *p_this )
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
int
i_idle_loops
=
0
;
/* loops without displaying a picture */
int
i_idle_loops
=
0
;
/* loops without displaying a picture */
subpicture_t
*
p_subpic
=
NULL
;
/* subpicture pointer */
bool
b_drop_late
;
bool
b_drop_late
;
int
canc
=
vlc_savecancel
();
int
canc
=
vlc_savecancel
();
...
@@ -927,85 +925,58 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -927,85 +925,58 @@ static void* RunThread( vlc_object_t *p_this )
{
{
/* Initialize loop variables */
/* Initialize loop variables */
const
mtime_t
current_date
=
mdate
();
const
mtime_t
current_date
=
mdate
();
picture_t
*
p_picture
=
NULL
;
picture_t
*
p_picture
;
picture_t
*
p_filtered_picture
;
picture_t
*
p_filtered_picture
;
mtime_t
display_date
=
0
;
mtime_t
display_date
;
picture_t
*
p_directbuffer
;
picture_t
*
p_directbuffer
;
int
i_index
;
int
i_index
;
/* Find the picture to display (the one with the earliest date). */
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
/* Look for the earliest picture but after the last displayed one */
picture_t
*
p_last
=
p_vout
->
p
->
p_picture_displayed
;;
p_picture
=
NULL
;
display_date
=
0
;
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
{
{
picture_t
*
p_pic
=
PP_RENDERPICTURE
[
i_index
];
picture_t
*
p_pic
=
PP_RENDERPICTURE
[
i_index
];
if
(
p_pic
->
i_status
==
READY_PICTURE
&&
if
(
p_pic
->
i_status
!=
READY_PICTURE
)
(
p_picture
==
NULL
||
p_pic
->
date
<
display_date
)
)
continue
;
if
(
p_vout
->
p
->
b_paused
&&
p_last
&&
p_last
->
date
>
1
)
continue
;
if
(
p_last
&&
p_pic
!=
p_last
&&
p_pic
->
date
<=
p_last
->
date
)
{
{
p_picture
=
p_pic
;
/* Drop old picture */
display_date
=
p_picture
->
date
;
DropPicture
(
p_vout
,
p_pic
)
;
}
}
}
else
if
(
(
!
p_last
||
p_last
->
date
<
p_pic
->
date
)
&&
if
(
p_vout
->
p
->
b_paused
&&
p_vout
->
p
->
p_picture_displayed
!=
NULL
)
(
p_picture
==
NULL
||
p_pic
->
date
<
p_picture
->
date
)
)
{
p_picture
=
NULL
;
if
(
p_vout
->
p
->
p_picture_displayed
->
date
==
1
)
{
{
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
p_picture
=
p_pic
;
{
picture_t
*
p_pic
=
PP_RENDERPICTURE
[
i_index
];
if
(
p_pic
->
i_status
!=
READY_PICTURE
)
continue
;
if
(
p_pic
->
date
<=
p_vout
->
p
->
p_picture_displayed
->
date
&&
p_pic
!=
p_vout
->
p
->
p_picture_displayed
)
{
DropPicture
(
p_vout
,
p_pic
);
}
else
if
(
p_pic
->
date
>
p_vout
->
p
->
p_picture_displayed
->
date
&&
(
p_picture
==
NULL
||
p_pic
->
date
<
display_date
)
)
{
p_picture
=
p_pic
;
display_date
=
p_picture
->
date
;
}
}
}
}
if
(
!
p_picture
)
p_picture
=
p_vout
->
p
->
p_picture_displayed
;
}
}
if
(
!
p_picture
)
p_picture
=
p_last
;
if
(
p_picture
)
if
(
p_picture
)
{
{
/* If we met the last picture, parse again to see whether there is
display_date
=
p_picture
->
date
;
* a more appropriate one. */
if
(
p_picture
==
p_vout
->
p
->
p_picture_displayed
&&
!
p_vout
->
p
->
b_paused
)
{
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
{
picture_t
*
p_pic
=
PP_RENDERPICTURE
[
i_index
];
if
(
p_pic
->
i_status
==
READY_PICTURE
&&
p_pic
!=
p_vout
->
p
->
p_picture_displayed
&&
(
p_picture
==
p_vout
->
p
->
p_picture_displayed
||
p_pic
->
date
<
display_date
)
)
{
p_picture
=
p_pic
;
display_date
=
p_picture
->
date
;
}
}
}
/* If we found better than the last picture, destroy it */
/* If we found better than the last picture, destroy it */
if
(
p_
vout
->
p
->
p_picture_displayed
&&
p_picture
!=
p_vout
->
p
->
p_picture_displayed
)
if
(
p_
last
&&
p_picture
!=
p_last
)
{
{
DropPicture
(
p_vout
,
p_
vout
->
p
->
p_picture_displayed
);
DropPicture
(
p_vout
,
p_
last
);
p_vout
->
p
->
p_picture_displayed
=
NULL
;
p_vout
->
p
->
p_picture_displayed
=
p_last
=
NULL
;
}
}
/* Compute FPS rate */
/* Compute FPS rate */
p_vout
->
p
->
p_fps_sample
[
p_vout
->
p
->
c_fps_samples
++
%
VOUT_FPS_SAMPLES
]
p_vout
->
p
->
p_fps_sample
[
p_vout
->
p
->
c_fps_samples
++
%
VOUT_FPS_SAMPLES
]
=
display_date
;
=
display_date
;
if
(
!
p_picture
->
b_force
&&
if
(
!
p_picture
->
b_force
&&
p_picture
!=
p_last
&&
p_picture
!=
p_vout
->
p
->
p_picture_displayed
&&
display_date
<
current_date
+
p_vout
->
p
->
render_time
&&
display_date
<
current_date
+
p_vout
->
p
->
render_time
&&
b_drop_late
)
b_drop_late
)
{
{
...
@@ -1028,7 +999,7 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -1028,7 +999,7 @@ static void* RunThread( vlc_object_t *p_this )
p_picture
=
NULL
;
p_picture
=
NULL
;
display_date
=
0
;
display_date
=
0
;
}
}
else
if
(
p_picture
==
p_
vout
->
p
->
p_picture_displayed
)
else
if
(
p_picture
==
p_
last
)
{
{
/* We are asked to repeat the previous picture, but we first
/* We are asked to repeat the previous picture, but we first
* wait for a couple of idle loops */
* wait for a couple of idle loops */
...
@@ -1044,9 +1015,10 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -1044,9 +1015,10 @@ static void* RunThread( vlc_object_t *p_this )
display_date
=
current_date
+
p_vout
->
p
->
render_time
;
display_date
=
current_date
+
p_vout
->
p
->
render_time
;
}
}
}
}
if
(
p_picture
)
p_vout
->
p
->
p_picture_displayed
=
p_picture
;
}
}
if
(
p_picture
)
p_vout
->
p
->
p_picture_displayed
=
p_picture
;
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
if
(
p_picture
==
NULL
)
if
(
p_picture
==
NULL
)
...
@@ -1066,6 +1038,7 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -1066,6 +1038,7 @@ static void* RunThread( vlc_object_t *p_this )
/*
/*
* Check for subpictures to display
* Check for subpictures to display
*/
*/
subpicture_t
*
p_subpic
=
NULL
;
if
(
display_date
>
0
)
if
(
display_date
>
0
)
p_subpic
=
spu_SortSubpictures
(
p_vout
->
p_spu
,
display_date
,
p_subpic
=
spu_SortSubpictures
(
p_vout
->
p_spu
,
display_date
,
p_vout
->
p
->
b_paused
,
b_snapshot
);
p_vout
->
p
->
b_paused
,
b_snapshot
);
...
...
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