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
4edd5ddb
Commit
4edd5ddb
authored
Dec 12, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked a bit projectm initialization.
parent
251c4c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
modules/visualization/projectm.cpp
modules/visualization/projectm.cpp
+28
-17
No files found.
modules/visualization/projectm.cpp
View file @
4edd5ddb
...
...
@@ -74,6 +74,9 @@ typedef struct
{
VLC_COMMON_MEMBERS
/* */
vlc_sem_t
ready
;
/* video output module and opengl provider */
vout_thread_t
*
p_opengl
;
module_t
*
p_module
;
...
...
@@ -184,19 +187,11 @@ static int Open( vlc_object_t * p_this )
p_sys
->
p_thread
=
p_thread
=
(
projectm_thread_t
*
)
vlc_object_create
(
p_filter
,
sizeof
(
projectm_thread_t
)
);
vlc_object_attach
(
p_sys
->
p_thread
,
p_filter
);
vlc_sem_init
(
&
p_thread
->
ready
,
0
);
p_thread
->
b_error
=
false
;
p_thread
->
i_width
=
var_CreateGetInteger
(
p_filter
,
"projectm-width"
);
p_thread
->
i_height
=
var_CreateGetInteger
(
p_filter
,
"projectm-height"
);
/* Create the openGL provider */
int
i_ret
=
initOpenGL
(
p_sys
->
p_thread
);
if
(
i_ret
!=
VLC_SUCCESS
)
{
vlc_object_detach
(
p_sys
->
p_thread
);
vlc_object_release
(
p_sys
->
p_thread
);
free
(
p_sys
);
return
i_ret
;
}
p_thread
->
i_channels
=
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
);
p_thread
->
psz_config
=
var_CreateGetString
(
p_filter
,
"projectm-config"
);
vlc_mutex_init
(
&
p_thread
->
lock
);
...
...
@@ -207,15 +202,21 @@ static int Open( vlc_object_t * p_this )
/* Create the thread */
if
(
vlc_thread_create
(
p_thread
,
"projectm update thread"
,
Thread
,
VLC_THREAD_PRIORITY_LOW
)
)
{
msg_Err
(
p_filter
,
"cannot launch the projectm thread"
);
vlc_object_detach
(
p_thread
);
vlc_object_release
(
p_thread
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
goto
error
;
vlc_sem_wait
(
&
p_thread
->
ready
);
if
(
p_thread
->
b_error
)
goto
error
;
return
VLC_SUCCESS
;
error:
vlc_thread_join
(
p_thread
);
vlc_sem_destroy
(
&
p_thread
->
ready
);
vlc_object_detach
(
p_thread
);
vlc_object_release
(
p_thread
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -234,6 +235,7 @@ static void Close( vlc_object_t *p_this )
vlc_thread_join
(
p_thread
);
/* Free the ressources */
vlc_sem_destroy
(
&
p_thread
->
ready
);
vlc_mutex_destroy
(
&
p_thread
->
lock
);
free
(
p_thread
->
p_buffer
);
free
(
p_thread
->
psz_config
);
...
...
@@ -282,6 +284,15 @@ static void* Thread( vlc_object_t *p_this )
int
cancel
=
vlc_savecancel
();
projectm_thread_t
*
p_thread
=
(
projectm_thread_t
*
)
p_this
;
/* Create the openGL provider */
if
(
initOpenGL
(
p_thread
)
)
{
p_thread
->
b_error
=
true
;
vlc_sem_post
(
&
p_thread
->
ready
);
return
NULL
;
}
vlc_sem_post
(
&
p_thread
->
ready
);
/* Initialize the opengl provider for this thread */
p_thread
->
p_opengl
->
pf_init
(
p_thread
->
p_opengl
);
...
...
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