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
b69b0bd6
Commit
b69b0bd6
authored
Jul 07, 2009
by
Sébastien Escudier
Committed by
Rémi Denis-Courmont
Jul 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc : handle VLM input events
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
24c2dc91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
14 deletions
+77
-14
include/vlc/libvlc_events.h
include/vlc/libvlc_events.h
+7
-1
src/control/vlm.c
src/control/vlm.c
+70
-13
No files found.
include/vlc/libvlc_events.h
View file @
b69b0bd6
...
...
@@ -99,6 +99,12 @@ enum libvlc_event_type_t {
libvlc_VlmMediaChanged
,
libvlc_VlmMediaInstanceStarted
,
libvlc_VlmMediaInstanceStopped
,
libvlc_VlmMediaInstanceStatusInit
,
libvlc_VlmMediaInstanceStatusOpening
,
libvlc_VlmMediaInstanceStatusPlaying
,
libvlc_VlmMediaInstanceStatusPause
,
libvlc_VlmMediaInstanceStatusEnd
,
libvlc_VlmMediaInstanceStatusError
,
/* New event types HERE */
};
...
...
@@ -223,8 +229,8 @@ struct libvlc_event_t
struct
{
const
char
*
psz_media_name
;
const
char
*
psz_instance_name
;
}
vlm_media_event
;
}
u
;
};
...
...
src/control/vlm.c
View file @
b69b0bd6
...
...
@@ -117,6 +117,7 @@ static int VlmEvent( vlc_object_t *p_this, const char * name,
VLC_UNUSED
(
name
);
VLC_UNUSED
(
old_val
);
libvlc_event
.
u
.
vlm_media_event
.
psz_instance_name
=
NULL
;
libvlc_event
.
u
.
vlm_media_event
.
psz_media_name
=
event
->
psz_name
;
switch
(
event
->
i_type
)
...
...
@@ -136,6 +137,37 @@ static int VlmEvent( vlc_object_t *p_this, const char * name,
case
VLM_EVENT_MEDIA_INSTANCE_STOPPED
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStopped
;
break
;
case
VLM_EVENT_MEDIA_INSTANCE_STATE
:
libvlc_event
.
u
.
vlm_media_event
.
psz_instance_name
=
event
->
psz_instance_name
;
switch
(
event
->
input_state
)
{
case
INIT_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusInit
;
break
;
case
OPENING_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusOpening
;
break
;
case
PLAYING_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusPlaying
;
break
;
case
PAUSE_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusPause
;
break
;
case
END_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusEnd
;
break
;
case
ERROR_S
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStatusError
;
break
;
default:
return
0
;
}
break
;
default:
return
0
;
}
libvlc_event_send
(
p_event_manager
,
&
libvlc_event
);
return
0
;
...
...
@@ -164,18 +196,42 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance,
{
if
(
!
p_instance
->
libvlc_vlm
.
p_event_manager
)
{
p_instance
->
libvlc_vlm
.
p_event_manager
=
libvlc_event_manager_new
(
p_instance
->
libvlc_vlm
.
p_vlm
,
p_instance
,
p_exception
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaAdded
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaRemoved
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaChanged
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStarted
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStopped
,
NULL
);
p_instance
->
libvlc_vlm
.
p_event_manager
=
libvlc_event_manager_new
(
p_instance
->
libvlc_vlm
.
p_vlm
,
p_instance
,
p_exception
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaAdded
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaRemoved
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaChanged
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStarted
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStopped
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusInit
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusOpening
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusPlaying
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusPause
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusEnd
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
libvlc_vlm
.
p_event_manager
,
libvlc_VlmMediaInstanceStatusError
,
NULL
);
}
if
(
!
p_instance
->
libvlc_vlm
.
p_vlm
)
...
...
@@ -187,7 +243,8 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance,
"Unable to create VLM."
);
return
VLC_EGENERIC
;
}
var_AddCallback
(
(
vlc_object_t
*
)
p_instance
->
libvlc_vlm
.
p_vlm
,
"intf-event"
,
VlmEvent
,
var_AddCallback
(
(
vlc_object_t
*
)
p_instance
->
libvlc_vlm
.
p_vlm
,
"intf-event"
,
VlmEvent
,
p_instance
->
libvlc_vlm
.
p_event_manager
);
p_instance
->
libvlc_vlm
.
pf_release
=
libvlc_vlm_release_internal
;
}
...
...
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