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
48475887
Commit
48475887
authored
Mar 31, 2009
by
Sébastien Escudier
Committed by
Rémi Denis-Courmont
Apr 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLM : Add media name in callbacks
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
ea39d429
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
29 deletions
+32
-29
include/vlc_vlm.h
include/vlc_vlm.h
+3
-2
src/input/vlm.c
src/input/vlm.c
+11
-10
src/input/vlm_event.c
src/input/vlm_event.c
+13
-12
src/input/vlm_event.h
src/input/vlm_event.h
+5
-5
No files found.
include/vlc_vlm.h
View file @
48475887
...
...
@@ -108,6 +108,7 @@ typedef struct
{
int
i_type
;
/* a vlm_event_type_e value */
int64_t
id
;
/* Media ID */
const
char
*
psz_name
;
/* Media name */
}
vlm_event_t
;
/** VLM control query */
...
...
src/input/vlm.c
View file @
48475887
...
...
@@ -575,7 +575,7 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
/* TODO add support of var vlm_media_broadcast/vlm_media_vod */
vlm_SendEventMediaChanged
(
p_vlm
,
p_cfg
->
id
);
vlm_SendEventMediaChanged
(
p_vlm
,
p_cfg
->
id
,
p_cfg
->
psz_name
);
return
VLC_SUCCESS
;
}
static
int
vlm_ControlMediaChange
(
vlm_t
*
p_vlm
,
vlm_media_t
*
p_cfg
)
...
...
@@ -651,7 +651,7 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
*
p_id
=
p_media
->
cfg
.
id
;
/* */
vlm_SendEventMediaAdded
(
p_vlm
,
p_media
->
cfg
.
id
);
vlm_SendEventMediaAdded
(
p_vlm
,
p_media
->
cfg
.
id
,
p_media
->
cfg
.
psz_name
);
return
vlm_OnMediaUpdate
(
p_vlm
,
p_media
);
}
...
...
@@ -672,6 +672,9 @@ static int vlm_ControlMediaDel( vlm_t *p_vlm, int64_t id )
p_vlm
->
i_vod
--
;
}
/* */
vlm_SendEventMediaRemoved
(
p_vlm
,
id
,
p_media
->
cfg
.
psz_name
);
vlm_media_Clean
(
&
p_media
->
cfg
);
vlc_gc_decref
(
p_media
->
vod
.
p_item
);
...
...
@@ -689,8 +692,6 @@ static int vlm_ControlMediaDel( vlm_t *p_vlm, int64_t id )
p_vlm
->
p_vod
=
NULL
;
}
/* */
vlm_SendEventMediaRemoved
(
p_vlm
,
id
);
return
VLC_SUCCESS
;
}
...
...
@@ -770,7 +771,7 @@ static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char
return
p_instance
;
}
static
void
vlm_MediaInstanceDelete
(
vlm_t
*
p_vlm
,
int64_t
id
,
vlm_media_instance_sys_t
*
p_instance
)
static
void
vlm_MediaInstanceDelete
(
vlm_t
*
p_vlm
,
int64_t
id
,
vlm_media_instance_sys_t
*
p_instance
,
const
char
*
psz_name
)
{
input_thread_t
*
p_input
=
p_instance
->
p_input
;
if
(
p_input
)
...
...
@@ -785,7 +786,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
vlc_object_release
(
p_input
);
vlm_SendEventMediaInstanceStopped
(
p_vlm
,
id
);
vlm_SendEventMediaInstanceStopped
(
p_vlm
,
id
,
psz_name
);
}
if
(
p_instance
->
p_input_resource
)
input_resource_Delete
(
p_instance
->
p_input_resource
);
...
...
@@ -871,7 +872,7 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
input_resource_TerminateSout
(
p_instance
->
p_input_resource
);
input_resource_TerminateVout
(
p_instance
->
p_input_resource
);
vlm_SendEventMediaInstanceStopped
(
p_vlm
,
id
);
vlm_SendEventMediaInstanceStopped
(
p_vlm
,
id
,
p_media
->
cfg
.
psz_name
);
}
/* Start new one */
...
...
@@ -887,11 +888,11 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
if
(
!
p_instance
->
p_input
)
{
TAB_REMOVE
(
p_media
->
i_instance
,
p_media
->
instance
,
p_instance
);
vlm_MediaInstanceDelete
(
p_vlm
,
id
,
p_instance
);
vlm_MediaInstanceDelete
(
p_vlm
,
id
,
p_instance
,
p_media
->
cfg
.
psz_name
);
}
else
{
vlm_SendEventMediaInstanceStarted
(
p_vlm
,
id
);
vlm_SendEventMediaInstanceStarted
(
p_vlm
,
id
,
p_media
->
cfg
.
psz_name
);
}
free
(
psz_log
);
}
...
...
@@ -913,7 +914,7 @@ static int vlm_ControlMediaInstanceStop( vlm_t *p_vlm, int64_t id, const char *p
TAB_REMOVE
(
p_media
->
i_instance
,
p_media
->
instance
,
p_instance
);
vlm_MediaInstanceDelete
(
p_vlm
,
id
,
p_instance
);
vlm_MediaInstanceDelete
(
p_vlm
,
id
,
p_instance
,
p_media
->
cfg
.
psz_name
);
return
VLC_SUCCESS
;
}
...
...
src/input/vlm_event.c
View file @
48475887
...
...
@@ -35,42 +35,43 @@
#include <assert.h>
/* */
static
void
Trigger
(
vlm_t
*
,
int
i_type
,
int64_t
id
);
static
void
Trigger
(
vlm_t
*
,
int
i_type
,
int64_t
id
,
const
char
*
psz_name
);
/*****************************************************************************
*
*****************************************************************************/
void
vlm_SendEventMediaAdded
(
vlm_t
*
p_vlm
,
int64_t
id
)
void
vlm_SendEventMediaAdded
(
vlm_t
*
p_vlm
,
int64_t
id
,
const
char
*
psz_name
)
{
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_ADDED
,
id
);
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_ADDED
,
id
,
psz_name
);
}
void
vlm_SendEventMediaRemoved
(
vlm_t
*
p_vlm
,
int64_t
id
)
void
vlm_SendEventMediaRemoved
(
vlm_t
*
p_vlm
,
int64_t
id
,
const
char
*
psz_name
)
{
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_REMOVED
,
id
);
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_REMOVED
,
id
,
psz_name
);
}
void
vlm_SendEventMediaChanged
(
vlm_t
*
p_vlm
,
int64_t
id
)
void
vlm_SendEventMediaChanged
(
vlm_t
*
p_vlm
,
int64_t
id
,
const
char
*
psz_name
)
{
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_CHANGED
,
id
);
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_CHANGED
,
id
,
psz_name
);
}
void
vlm_SendEventMediaInstanceStarted
(
vlm_t
*
p_vlm
,
int64_t
id
)
void
vlm_SendEventMediaInstanceStarted
(
vlm_t
*
p_vlm
,
int64_t
id
,
const
char
*
psz_name
)
{
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_INSTANCE_STARTED
,
id
);
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_INSTANCE_STARTED
,
id
,
psz_name
);
}
void
vlm_SendEventMediaInstanceStopped
(
vlm_t
*
p_vlm
,
int64_t
id
)
void
vlm_SendEventMediaInstanceStopped
(
vlm_t
*
p_vlm
,
int64_t
id
,
const
char
*
psz_name
)
{
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_INSTANCE_STOPPED
,
id
);
Trigger
(
p_vlm
,
VLM_EVENT_MEDIA_INSTANCE_STOPPED
,
id
,
psz_name
);
}
/*****************************************************************************
*
*****************************************************************************/
static
void
Trigger
(
vlm_t
*
p_vlm
,
int
i_type
,
int64_t
id
)
static
void
Trigger
(
vlm_t
*
p_vlm
,
int
i_type
,
int64_t
id
,
const
char
*
psz_name
)
{
vlm_event_t
event
;
event
.
i_type
=
i_type
;
event
.
id
=
id
;
event
.
psz_name
=
psz_name
;
var_SetAddress
(
p_vlm
,
"intf-event"
,
&
event
);
}
src/input/vlm_event.h
View file @
48475887
...
...
@@ -33,12 +33,12 @@
/*****************************************************************************
*
*****************************************************************************/
void
vlm_SendEventMediaAdded
(
vlm_t
*
,
int64_t
id
);
void
vlm_SendEventMediaRemoved
(
vlm_t
*
,
int64_t
id
);
void
vlm_SendEventMediaChanged
(
vlm_t
*
,
int64_t
id
);
void
vlm_SendEventMediaAdded
(
vlm_t
*
,
int64_t
id
,
const
char
*
psz_name
);
void
vlm_SendEventMediaRemoved
(
vlm_t
*
,
int64_t
id
,
const
char
*
psz_name
);
void
vlm_SendEventMediaChanged
(
vlm_t
*
,
int64_t
id
,
const
char
*
psz_name
);
void
vlm_SendEventMediaInstanceStarted
(
vlm_t
*
,
int64_t
id
);
void
vlm_SendEventMediaInstanceStopped
(
vlm_t
*
,
int64_t
id
);
void
vlm_SendEventMediaInstanceStarted
(
vlm_t
*
,
int64_t
id
,
const
char
*
psz_name
);
void
vlm_SendEventMediaInstanceStopped
(
vlm_t
*
,
int64_t
id
,
const
char
*
psz_name
);
#endif
...
...
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