Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
94287dce
Commit
94287dce
authored
Oct 20, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented vout_NextPicture.
parent
321e04ca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
2 deletions
+66
-2
src/video_output/video_output.c
src/video_output/video_output.c
+58
-2
src/video_output/vout_control.h
src/video_output/vout_control.h
+5
-0
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+3
-0
No files found.
src/video_output/video_output.c
View file @
94287dce
...
@@ -373,6 +373,9 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
...
@@ -373,6 +373,9 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
p_vout
->
p
->
i_par_num
=
p_vout
->
p
->
i_par_num
=
p_vout
->
p
->
i_par_den
=
1
;
p_vout
->
p
->
i_par_den
=
1
;
p_vout
->
p
->
p_picture_displayed
=
NULL
;
p_vout
->
p
->
p_picture_displayed
=
NULL
;
p_vout
->
p
->
i_picture_displayed_date
=
0
;
p_vout
->
p
->
b_picture_displayed
=
false
;
p_vout
->
p
->
b_picture_empty
=
false
;
/* Initialize locks */
/* Initialize locks */
vlc_mutex_init
(
&
p_vout
->
picture_lock
);
vlc_mutex_init
(
&
p_vout
->
picture_lock
);
...
@@ -582,11 +585,15 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
...
@@ -582,11 +585,15 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
vlc_object_lock
(
p_vout
);
vlc_object_lock
(
p_vout
);
assert
(
!
p_vout
->
p
->
b_paused
||
!
b_paused
);
assert
(
!
p_vout
->
p
->
b_paused
||
!
b_paused
);
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
p_vout
->
p
->
i_picture_displayed_date
=
0
;
if
(
p_vout
->
p
->
b_paused
)
if
(
p_vout
->
p
->
b_paused
)
{
{
const
mtime_t
i_duration
=
i_date
-
p_vout
->
p
->
i_pause_date
;
const
mtime_t
i_duration
=
i_date
-
p_vout
->
p
->
i_pause_date
;
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
for
(
int
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
for
(
int
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
];
...
@@ -599,6 +606,10 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
...
@@ -599,6 +606,10 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
spu_OffsetSubtitleDate
(
p_vout
->
p_spu
,
i_duration
);
spu_OffsetSubtitleDate
(
p_vout
->
p_spu
,
i_duration
);
}
}
else
{
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
p_vout
->
p
->
b_paused
=
b_paused
;
p_vout
->
p
->
b_paused
=
b_paused
;
p_vout
->
p
->
i_pause_date
=
i_date
;
p_vout
->
p
->
i_pause_date
=
i_date
;
...
@@ -619,6 +630,7 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_l
...
@@ -619,6 +630,7 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_l
void
vout_Flush
(
vout_thread_t
*
p_vout
,
mtime_t
i_date
)
void
vout_Flush
(
vout_thread_t
*
p_vout
,
mtime_t
i_date
)
{
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
p_vout
->
p
->
i_picture_displayed_date
=
0
;
for
(
int
i
=
0
;
i
<
p_vout
->
render
.
i_pictures
;
i
++
)
for
(
int
i
=
0
;
i
<
p_vout
->
render
.
i_pictures
;
i
++
)
{
{
picture_t
*
p_pic
=
p_vout
->
render
.
pp_picture
[
i
];
picture_t
*
p_pic
=
p_vout
->
render
.
pp_picture
[
i
];
...
@@ -679,12 +691,37 @@ void vout_FixLeaks( vout_thread_t *p_vout, bool b_forced )
...
@@ -679,12 +691,37 @@ void vout_FixLeaks( vout_thread_t *p_vout, bool b_forced )
for
(
i_pic
=
0
;
i_pic
<
p_vout
->
render
.
i_pictures
;
i_pic
++
)
for
(
i_pic
=
0
;
i_pic
<
p_vout
->
render
.
i_pictures
;
i_pic
++
)
{
{
picture_t
*
p_pic
=
p_vout
->
render
.
pp_picture
[
i_pic
];
picture_t
*
p_pic
=
p_vout
->
render
.
pp_picture
[
i_pic
];
msg_Dbg
(
p_vout
,
"[%d] %d %d"
,
i_pic
,
p_pic
->
i_status
,
p_pic
->
i_refcount
);
p_pic
->
i_refcount
=
0
;
p_pic
->
i_refcount
=
0
;
vout_UsePictureLocked
(
p_vout
,
p_pic
);
vout_UsePictureLocked
(
p_vout
,
p_pic
);
}
}
vlc_cond_signal
(
&
p_vout
->
p
->
picture_wait
);
vlc_cond_signal
(
&
p_vout
->
p
->
picture_wait
);
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
}
void
vout_NextPicture
(
vout_thread_t
*
p_vout
,
mtime_t
*
pi_duration
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
const
mtime_t
i_displayed_date
=
p_vout
->
p
->
i_picture_displayed_date
;
p_vout
->
p
->
b_picture_displayed
=
false
;
p_vout
->
p
->
b_picture_empty
=
false
;
if
(
p_vout
->
p
->
p_picture_displayed
)
{
p_vout
->
p
->
p_picture_displayed
->
date
=
1
;
vlc_cond_signal
(
&
p_vout
->
p
->
picture_wait
);
}
while
(
!
p_vout
->
p
->
b_picture_displayed
&&
!
p_vout
->
p
->
b_picture_empty
)
vlc_cond_wait
(
&
p_vout
->
p
->
picture_wait
,
&
p_vout
->
picture_lock
);
*
pi_duration
=
__MAX
(
p_vout
->
p
->
i_picture_displayed_date
-
i_displayed_date
,
0
);
/* TODO advance subpicture by the duration ... */
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/*****************************************************************************
/*****************************************************************************
* InitThread: initialize video output thread
* InitThread: initialize video output thread
...
@@ -975,8 +1012,16 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -975,8 +1012,16 @@ static void* RunThread( vlc_object_t *p_this )
}
}
}
}
if
(
!
p_picture
)
if
(
!
p_picture
)
{
p_picture
=
p_last
;
p_picture
=
p_last
;
if
(
!
p_vout
->
p
->
b_picture_empty
)
{
p_vout
->
p
->
b_picture_empty
=
true
;
vlc_cond_signal
(
&
p_vout
->
p
->
picture_wait
);
}
}
display_date
=
0
;
display_date
=
0
;
if
(
p_picture
)
if
(
p_picture
)
{
{
...
@@ -992,7 +1037,7 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -992,7 +1037,7 @@ static void* RunThread( vlc_object_t *p_this )
/* Compute FPS rate */
/* Compute FPS rate */
p_vout
->
p
->
p_fps_sample
[
p_vout
->
p
->
c_fps_samples
++
%
VOUT_FPS_SAMPLES
]
=
display_date
;
p_vout
->
p
->
p_fps_sample
[
p_vout
->
p
->
c_fps_samples
++
%
VOUT_FPS_SAMPLES
]
=
display_date
;
if
(
display_date
>
current_date
+
VOUT_DISPLAY_DELAY
)
if
(
display_date
>
current_date
+
VOUT_DISPLAY_DELAY
&&
!
p_vout
->
p
->
b_paused
)
{
{
/* A picture is ready to be rendered, but its rendering date
/* A picture is ready to be rendered, but its rendering date
* is far from the current one so the thread will perform an
* is far from the current one so the thread will perform an
...
@@ -1018,8 +1063,19 @@ static void* RunThread( vlc_object_t *p_this )
...
@@ -1018,8 +1063,19 @@ static void* RunThread( vlc_object_t *p_this )
}
}
}
}
if
(
p_picture
)
if
(
p_picture
)
{
if
(
p_picture
->
date
>
1
)
{
p_vout
->
p
->
i_picture_displayed_date
=
p_picture
->
date
;
if
(
p_picture
!=
p_last
&&
!
p_vout
->
p
->
b_picture_displayed
)
{
p_vout
->
p
->
b_picture_displayed
=
true
;
vlc_cond_signal
(
&
p_vout
->
p
->
picture_wait
);
}
}
p_vout
->
p
->
p_picture_displayed
=
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
)
...
...
src/video_output/vout_control.h
View file @
94287dce
...
@@ -68,5 +68,10 @@ void vout_FixLeaks( vout_thread_t *p_vout, bool b_forced );
...
@@ -68,5 +68,10 @@ void vout_FixLeaks( vout_thread_t *p_vout, bool b_forced );
*/
*/
void
vout_DropPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
);
void
vout_DropPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
);
/**
* This function will force to display the next picture while paused
*/
void
vout_NextPicture
(
vout_thread_t
*
p_vout
,
mtime_t
*
pi_duration
);
#endif
#endif
src/video_output/vout_internal.h
View file @
94287dce
...
@@ -35,6 +35,9 @@
...
@@ -35,6 +35,9 @@
struct
vout_thread_sys_t
struct
vout_thread_sys_t
{
{
/* */
/* */
bool
b_picture_displayed
;
bool
b_picture_empty
;
mtime_t
i_picture_displayed_date
;
picture_t
*
p_picture_displayed
;
picture_t
*
p_picture_displayed
;
vlc_cond_t
picture_wait
;
vlc_cond_t
picture_wait
;
...
...
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