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
ec788f2d
Commit
ec788f2d
authored
Aug 19, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout thread: split out command processing function
parent
cb21f5e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
88 deletions
+87
-88
src/video_output/video_output.c
src/video_output/video_output.c
+87
-88
No files found.
src/video_output/video_output.c
View file @
ec788f2d
...
...
@@ -1462,6 +1462,90 @@ static int ThreadReinit(vout_thread_t *vout,
return
VLC_SUCCESS
;
}
static
int
ThreadControl
(
vout_thread_t
*
vout
,
vout_control_cmd_t
cmd
)
{
switch
(
cmd
.
type
)
{
case
VOUT_CONTROL_INIT
:
ThreadInit
(
vout
);
if
(
!
ThreadStart
(
vout
,
NULL
))
break
;
case
VOUT_CONTROL_CLEAN
:
ThreadStop
(
vout
,
NULL
);
ThreadClean
(
vout
);
return
-
1
;
case
VOUT_CONTROL_REINIT
:
if
(
ThreadReinit
(
vout
,
cmd
.
u
.
cfg
))
return
-
1
;
break
;
case
VOUT_CONTROL_SUBPICTURE
:
ThreadDisplaySubpicture
(
vout
,
cmd
.
u
.
subpicture
);
cmd
.
u
.
subpicture
=
NULL
;
break
;
case
VOUT_CONTROL_FLUSH_SUBPICTURE
:
ThreadFlushSubpicture
(
vout
,
cmd
.
u
.
integer
);
break
;
case
VOUT_CONTROL_OSD_TITLE
:
ThreadDisplayOsdTitle
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_FILTERS
:
ThreadChangeFilters
(
vout
,
NULL
,
cmd
.
u
.
string
,
false
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_SOURCES
:
ThreadChangeSubSources
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_FILTERS
:
ThreadChangeSubFilters
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_MARGIN
:
ThreadChangeSubMargin
(
vout
,
cmd
.
u
.
integer
);
break
;
case
VOUT_CONTROL_PAUSE
:
ThreadChangePause
(
vout
,
cmd
.
u
.
pause
.
is_on
,
cmd
.
u
.
pause
.
date
);
break
;
case
VOUT_CONTROL_FLUSH
:
ThreadFlush
(
vout
,
false
,
cmd
.
u
.
time
);
break
;
case
VOUT_CONTROL_RESET
:
ThreadReset
(
vout
);
break
;
case
VOUT_CONTROL_STEP
:
ThreadStep
(
vout
,
cmd
.
u
.
time_ptr
);
break
;
case
VOUT_CONTROL_FULLSCREEN
:
ThreadChangeFullscreen
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_ON_TOP
:
ThreadChangeOnTop
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_DISPLAY_FILLED
:
ThreadChangeDisplayFilled
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_ZOOM
:
ThreadChangeZoom
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_ASPECT_RATIO
:
ThreadChangeAspectRatio
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_CROP_RATIO
:
ThreadExecuteCropRatio
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_CROP_WINDOW
:
ThreadExecuteCropWindow
(
vout
,
cmd
.
u
.
window
.
x
,
cmd
.
u
.
window
.
y
,
cmd
.
u
.
window
.
width
,
cmd
.
u
.
window
.
height
);
break
;
case
VOUT_CONTROL_CROP_BORDER
:
ThreadExecuteCropBorder
(
vout
,
cmd
.
u
.
border
.
left
,
cmd
.
u
.
border
.
top
,
cmd
.
u
.
border
.
right
,
cmd
.
u
.
border
.
bottom
);
break
;
default:
break
;
}
vout_control_cmd_Clean
(
&
cmd
);
return
0
;
}
/*****************************************************************************
* Thread: video output thread
*****************************************************************************
...
...
@@ -1481,96 +1565,11 @@ static void *Thread(void *object)
mtime_t
deadline
=
VLC_TS_INVALID
;
for
(;;)
{
vout_control_cmd_t
cmd
;
/* FIXME remove thoses ugly timeouts
*/
while
(
!
vout_control_Pop
(
&
vout
->
p
->
control
,
&
cmd
,
deadline
,
100000
))
{
switch
(
cmd
.
type
)
{
case
VOUT_CONTROL_INIT
:
ThreadInit
(
vout
);
if
(
ThreadStart
(
vout
,
NULL
))
{
ThreadStop
(
vout
,
NULL
);
ThreadClean
(
vout
);
return
NULL
;
}
break
;
case
VOUT_CONTROL_CLEAN
:
ThreadStop
(
vout
,
NULL
);
ThreadClean
(
vout
);
/* FIXME remove thoses ugly timeouts */
while
(
!
vout_control_Pop
(
&
vout
->
p
->
control
,
&
cmd
,
deadline
,
100000
))
if
(
ThreadControl
(
vout
,
cmd
))
return
NULL
;
case
VOUT_CONTROL_REINIT
:
if
(
ThreadReinit
(
vout
,
cmd
.
u
.
cfg
))
return
NULL
;
break
;
case
VOUT_CONTROL_SUBPICTURE
:
ThreadDisplaySubpicture
(
vout
,
cmd
.
u
.
subpicture
);
cmd
.
u
.
subpicture
=
NULL
;
break
;
case
VOUT_CONTROL_FLUSH_SUBPICTURE
:
ThreadFlushSubpicture
(
vout
,
cmd
.
u
.
integer
);
break
;
case
VOUT_CONTROL_OSD_TITLE
:
ThreadDisplayOsdTitle
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_FILTERS
:
ThreadChangeFilters
(
vout
,
NULL
,
cmd
.
u
.
string
,
false
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_SOURCES
:
ThreadChangeSubSources
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_FILTERS
:
ThreadChangeSubFilters
(
vout
,
cmd
.
u
.
string
);
break
;
case
VOUT_CONTROL_CHANGE_SUB_MARGIN
:
ThreadChangeSubMargin
(
vout
,
cmd
.
u
.
integer
);
break
;
case
VOUT_CONTROL_PAUSE
:
ThreadChangePause
(
vout
,
cmd
.
u
.
pause
.
is_on
,
cmd
.
u
.
pause
.
date
);
break
;
case
VOUT_CONTROL_FLUSH
:
ThreadFlush
(
vout
,
false
,
cmd
.
u
.
time
);
break
;
case
VOUT_CONTROL_RESET
:
ThreadReset
(
vout
);
break
;
case
VOUT_CONTROL_STEP
:
ThreadStep
(
vout
,
cmd
.
u
.
time_ptr
);
break
;
case
VOUT_CONTROL_FULLSCREEN
:
ThreadChangeFullscreen
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_ON_TOP
:
ThreadChangeOnTop
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_DISPLAY_FILLED
:
ThreadChangeDisplayFilled
(
vout
,
cmd
.
u
.
boolean
);
break
;
case
VOUT_CONTROL_ZOOM
:
ThreadChangeZoom
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_ASPECT_RATIO
:
ThreadChangeAspectRatio
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_CROP_RATIO
:
ThreadExecuteCropRatio
(
vout
,
cmd
.
u
.
pair
.
a
,
cmd
.
u
.
pair
.
b
);
break
;
case
VOUT_CONTROL_CROP_WINDOW
:
ThreadExecuteCropWindow
(
vout
,
cmd
.
u
.
window
.
x
,
cmd
.
u
.
window
.
y
,
cmd
.
u
.
window
.
width
,
cmd
.
u
.
window
.
height
);
break
;
case
VOUT_CONTROL_CROP_BORDER
:
ThreadExecuteCropBorder
(
vout
,
cmd
.
u
.
border
.
left
,
cmd
.
u
.
border
.
top
,
cmd
.
u
.
border
.
right
,
cmd
.
u
.
border
.
bottom
);
break
;
default:
break
;
}
vout_control_cmd_Clean
(
&
cmd
);
}
ThreadManage
(
vout
,
&
deadline
,
&
interlacing
);
}
}
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