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
11405d4d
Commit
11405d4d
authored
Jan 01, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface: create the playlist first and use it as parent
parent
a5056a2d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
51 deletions
+50
-51
include/vlc_interface.h
include/vlc_interface.h
+1
-2
modules/control/ntservice.c
modules/control/ntservice.c
+1
-1
modules/control/rc.c
modules/control/rc.c
+3
-2
src/interface/interface.c
src/interface/interface.c
+35
-33
src/libvlc.c
src/libvlc.c
+9
-10
src/libvlc.h
src/libvlc.h
+0
-3
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+1
-0
No files found.
include/vlc_interface.h
View file @
11405d4d
...
...
@@ -90,8 +90,7 @@ struct intf_dialog_args_t
struct
interaction_dialog_t
*
p_dialog
;
};
VLC_API
int
intf_Create
(
vlc_object_t
*
,
const
char
*
);
#define intf_Create(a,b) intf_Create(VLC_OBJECT(a),b)
VLC_API
int
intf_Create
(
playlist_t
*
,
const
char
*
);
VLC_API
void
libvlc_Quit
(
libvlc_int_t
*
);
...
...
modules/control/ntservice.c
View file @
11405d4d
...
...
@@ -322,7 +322,7 @@ static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
if
(
asprintf
(
&
psz_temp
,
"%s,none"
,
psz_module
)
!=
-
1
)
{
/* Try to create the interface */
if
(
intf_Create
(
p
_intf
,
psz_temp
)
)
if
(
intf_Create
(
p
l_Get
(
p_intf
)
,
psz_temp
)
)
{
msg_Err
(
p_intf
,
"interface
\"
%s
\"
initialization failed"
,
psz_temp
);
...
...
modules/control/rc.c
View file @
11405d4d
...
...
@@ -1420,9 +1420,10 @@ static int Quit( vlc_object_t *p_this, char const *psz_cmd,
static
int
Intf
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
)
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
p_this
;
return
intf_Create
(
p_this
->
p_libvlc
,
newval
.
psz_string
);
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
);
return
intf_Create
(
pl_Get
(
intf
),
newval
.
psz_string
);
}
static
int
Volume
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
...
...
src/interface/interface.c
View file @
11405d4d
...
...
@@ -61,22 +61,19 @@ static int AddIntfCallback( vlc_object_t *, char const *,
*/
static
vlc_mutex_t
lock
=
VLC_STATIC_MUTEX
;
#undef intf_Create
/**
* Create and start an interface.
*
* @param p
_this the calling vlc_object_t
* @param p
laylist playlist and parent object for the interface
* @param chain configuration chain string
* @return VLC_SUCCESS or an error code
*/
int
intf_Create
(
vlc_object_t
*
p_this
,
const
char
*
chain
)
int
intf_Create
(
playlist_t
*
playlist
,
const
char
*
chain
)
{
libvlc_int_t
*
p_libvlc
=
p_this
->
p_libvlc
;
intf_thread_t
*
p_intf
;
/* Allocate structure */
p_intf
=
vlc_custom_create
(
p_libvlc
,
sizeof
(
*
p_intf
),
"interface"
);
if
(
!
p_intf
)
intf_thread_t
*
p_intf
=
vlc_custom_create
(
playlist
,
sizeof
(
*
p_intf
),
"interface"
);
if
(
unlikely
(
p_intf
==
NULL
)
)
return
VLC_ENOMEM
;
/* Variable used for interface spawning */
...
...
@@ -106,7 +103,7 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
text
.
psz_string
=
(
char
*
)
_
(
"Mouse Gestures"
);
var_Change
(
p_intf
,
"intf-add"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
var_AddCallback
(
p_intf
,
"intf-add"
,
AddIntfCallback
,
NULL
);
var_AddCallback
(
p_intf
,
"intf-add"
,
AddIntfCallback
,
playlist
);
/* Choose the best module */
char
*
module
;
...
...
@@ -122,8 +119,8 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
}
vlc_mutex_lock
(
&
lock
);
p_intf
->
p_next
=
libvlc_priv
(
p_libvlc
)
->
p_intf
;
libvlc_priv
(
p_libvlc
)
->
p_intf
=
p_intf
;
p_intf
->
p_next
=
pl_priv
(
playlist
)
->
interface
;
pl_priv
(
playlist
)
->
interface
=
p_intf
;
vlc_mutex_unlock
(
&
lock
);
return
VLC_SUCCESS
;
...
...
@@ -169,39 +166,44 @@ playlist_t *(pl_Get)(vlc_object_t *obj)
* Stops and destroys all interfaces
* @param p_libvlc the LibVLC instance
*/
void
intf_DestroyAll
(
libvlc_int_t
*
p_libvlc
)
void
intf_DestroyAll
(
libvlc_int_t
*
libvlc
)
{
intf_thread_t
*
p_intf
;
vlc_mutex_lock
(
&
lock
);
p_intf
=
libvlc_priv
(
p_libvlc
)
->
p_intf
;
#ifndef NDEBUG
libvlc_priv
(
p_libvlc
)
->
p_intf
=
NULL
;
#endif
vlc_mutex_unlock
(
&
lock
);
playlist_t
*
playlist
;
/* Cleanup the interfaces */
while
(
p_intf
!=
NULL
)
vlc_mutex_lock
(
&
lock
);
playlist
=
libvlc_priv
(
libvlc
)
->
playlist
;
if
(
playlist
!=
NULL
)
{
intf_thread_t
*
p_next
=
p_intf
->
p_next
;
intf_thread_t
*
intf
,
**
pp
=
&
(
pl_priv
(
playlist
)
->
interface
)
;
module_unneed
(
p_intf
,
p_intf
->
p_module
);
config_ChainDestroy
(
p_intf
->
p_cfg
);
vlc_object_release
(
p_intf
);
p_intf
=
p_next
;
while
((
intf
=
*
pp
)
!=
NULL
)
{
*
pp
=
intf
->
p_next
;
vlc_mutex_unlock
(
&
lock
);
module_unneed
(
intf
,
intf
->
p_module
);
config_ChainDestroy
(
intf
->
p_cfg
);
var_DelCallback
(
intf
,
"intf-add"
,
AddIntfCallback
,
playlist
);
vlc_object_release
(
intf
);
vlc_mutex_lock
(
&
lock
);
}
}
vlc_mutex_unlock
(
&
lock
);
}
/* Following functions are local */
static
int
AddIntfCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_
data
)
static
int
AddIntfCallback
(
vlc_object_t
*
obj
,
char
const
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
(
void
)
psz_cmd
;
(
void
)
oldval
;
(
void
)
p_
data
;
playlist_t
*
playlist
=
data
;
int
ret
=
intf_Create
(
VLC_OBJECT
(
p_this
->
p_libvlc
),
newval
.
psz_string
);
int
ret
=
intf_Create
(
playlist
,
cur
.
psz_string
);
if
(
ret
)
msg_Err
(
p_this
,
"interface
\"
%s
\"
initialization failed"
,
newval
.
psz_string
);
msg_Err
(
obj
,
"interface
\"
%s
\"
initialization failed"
,
cur
.
psz_string
);
(
void
)
var
;
(
void
)
old
;
return
ret
;
}
src/libvlc.c
View file @
11405d4d
...
...
@@ -447,7 +447,7 @@ dbus_out:
}
if
(
asprintf
(
&
psz_temp
,
"%s,none"
,
psz_module
)
!=
-
1
)
{
intf_Create
(
p_libvlc
,
psz_temp
);
libvlc_InternalAddIntf
(
p_libvlc
,
psz_temp
);
free
(
psz_temp
);
}
}
...
...
@@ -459,7 +459,7 @@ dbus_out:
{
char
*
logmode
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"logmode"
);
var_SetString
(
p_libvlc
,
"logmode"
,
"syslog"
);
intf_Create
(
p_libvlc
,
"logger,none"
);
libvlc_InternalAddIntf
(
p_libvlc
,
"logger,none"
);
if
(
logmode
)
{
...
...
@@ -471,12 +471,10 @@ dbus_out:
else
#endif
if
(
var_InheritBool
(
p_libvlc
,
"file-logging"
)
)
intf_Create
(
p_libvlc
,
"logger,none"
);
libvlc_InternalAddIntf
(
p_libvlc
,
"logger,none"
);
if
(
var_InheritBool
(
p_libvlc
,
"network-synchronisation"
)
)
{
intf_Create
(
p_libvlc
,
"netsync,none"
);
}
libvlc_InternalAddIntf
(
p_libvlc
,
"netsync,none"
);
#ifdef __APPLE__
var_Create
(
p_libvlc
,
"drawable-view-top"
,
VLC_VAR_INTEGER
);
...
...
@@ -591,13 +589,14 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
*/
int
libvlc_InternalAddIntf
(
libvlc_int_t
*
p_libvlc
,
const
char
*
name
)
{
int
ret
;
if
(
!
p_libvlc
)
return
VLC_EGENERIC
;
playlist_t
*
playlist
=
pl_Get
(
p_libvlc
);
int
ret
;
if
(
name
!=
NULL
)
ret
=
intf_Create
(
p
_libvlc
,
name
);
ret
=
intf_Create
(
p
laylist
,
name
);
else
{
/* Default interface */
char
*
intf
=
var_InheritString
(
p_libvlc
,
"intf"
);
...
...
@@ -611,7 +610,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, const char *name )
_
(
"Running vlc with the default interface. "
"Use 'cvlc' to use vlc without interface."
)
);
}
ret
=
intf_Create
(
p
_libvlc
,
intf
);
ret
=
intf_Create
(
p
laylist
,
intf
);
name
=
"default"
;
}
if
(
ret
)
...
...
src/libvlc.h
View file @
11405d4d
...
...
@@ -166,9 +166,6 @@ typedef struct libvlc_priv_t
struct
playlist_preparser_t
*
parser
;
///< Input item meta data handler
struct
vlc_actions
*
actions
;
///< Hotkeys handler
/* Interfaces */
struct
intf_thread_t
*
p_intf
;
///< Interfaces linked-list
/* Objects tree */
vlc_mutex_t
structure_lock
;
...
...
src/playlist/playlist_internal.h
View file @
11405d4d
...
...
@@ -48,6 +48,7 @@ typedef struct playlist_private_t
{
playlist_t
public_data
;
playlist_preparser_t
*
p_preparser
;
/**< Preparser data */
struct
intf_thread_t
*
interface
;
/**< Linked-list of interfaces */
playlist_item_array_t
items_to_delete
;
/**< Array of items and nodes to
delete... At the very end. This sucks. */
...
...
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