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
8cb745bf
Commit
8cb745bf
authored
Nov 26, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlm: use a per-instance parent object to set VoD variables
parent
48029873
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
src/input/vlm.c
src/input/vlm.c
+17
-11
src/input/vlm_internal.h
src/input/vlm_internal.h
+1
-0
No files found.
src/input/vlm.c
View file @
8cb745bf
...
@@ -876,6 +876,8 @@ static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char
...
@@ -876,6 +876,8 @@ static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char
p_instance
->
i_index
=
0
;
p_instance
->
i_index
=
0
;
p_instance
->
b_sout_keep
=
false
;
p_instance
->
b_sout_keep
=
false
;
p_instance
->
p_parent
=
vlc_object_create
(
p_vlm
,
sizeof
(
vlc_object_t
)
);
vlc_object_attach
(
p_instance
->
p_parent
,
p_vlm
->
p_libvlc
);
p_instance
->
p_input
=
NULL
;
p_instance
->
p_input
=
NULL
;
p_instance
->
p_input_resource
=
NULL
;
p_instance
->
p_input_resource
=
NULL
;
...
@@ -899,6 +901,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
...
@@ -899,6 +901,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
input_resource_Terminate
(
p_instance
->
p_input_resource
);
input_resource_Terminate
(
p_instance
->
p_input_resource
);
input_resource_Release
(
p_instance
->
p_input_resource
);
input_resource_Release
(
p_instance
->
p_input_resource
);
}
}
vlc_object_release
(
p_instance
->
p_parent
);
TAB_REMOVE
(
p_media
->
i_instance
,
p_media
->
instance
,
p_instance
);
TAB_REMOVE
(
p_media
->
i_instance
,
p_media
->
instance
,
p_instance
);
vlc_gc_decref
(
p_instance
->
p_item
);
vlc_gc_decref
(
p_instance
->
p_item
);
...
@@ -934,6 +937,15 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
...
@@ -934,6 +937,15 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
if
(
!
p_instance
)
if
(
!
p_instance
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
if
(
p_cfg
->
b_vod
)
{
var_Create
(
p_instance
->
p_parent
,
"vod-media"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
p_instance
->
p_parent
,
"vod-media"
,
p_media
->
vod
.
p_media
);
var_Create
(
p_instance
->
p_parent
,
"vod-session"
,
VLC_VAR_STRING
);
var_SetString
(
p_instance
->
p_parent
,
"vod-session"
,
psz_id
);
}
if
(
p_cfg
->
psz_output
!=
NULL
||
psz_vod_output
!=
NULL
)
if
(
p_cfg
->
psz_output
!=
NULL
||
psz_vod_output
!=
NULL
)
{
{
char
*
psz_buffer
;
char
*
psz_buffer
;
...
@@ -994,21 +1006,15 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
...
@@ -994,21 +1006,15 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
if
(
asprintf
(
&
psz_log
,
_
(
"Media: %s"
),
p_media
->
cfg
.
psz_name
)
!=
-
1
)
if
(
asprintf
(
&
psz_log
,
_
(
"Media: %s"
),
p_media
->
cfg
.
psz_name
)
!=
-
1
)
{
{
vlc_object_t
*
p_parent
=
p_media
->
cfg
.
b_vod
?
VLC_OBJECT
(
p_vlm
->
p_vod
)
:
VLC_OBJECT
(
p_vlm
->
p_libvlc
);
if
(
!
p_instance
->
p_input_resource
)
if
(
!
p_instance
->
p_input_resource
)
p_instance
->
p_input_resource
=
input_resource_New
(
VLC_OBJECT
(
p_vlm
->
p_libvlc
)
);
p_instance
->
p_input_resource
=
input_resource_New
(
p_instance
->
p_parent
);
p_instance
->
p_input
=
input_Create
(
p_parent
,
p_instance
->
p_item
,
psz_log
,
p_instance
->
p_input_resource
);
p_instance
->
p_input
=
input_Create
(
p_instance
->
p_parent
,
p_instance
->
p_item
,
psz_log
,
p_instance
->
p_input_resource
);
if
(
p_instance
->
p_input
)
if
(
p_instance
->
p_input
)
{
{
var_AddCallback
(
p_instance
->
p_input
,
"intf-event"
,
InputEvent
,
p_media
);
var_AddCallback
(
p_instance
->
p_input
,
"intf-event"
,
InputEvent
,
p_media
);
var_Create
(
p_instance
->
p_input
,
"vod-media"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
p_instance
->
p_input
,
"vod-media"
,
p_media
->
vod
.
p_media
);
var_Create
(
p_instance
->
p_input
,
"vod-session"
,
VLC_VAR_STRING
);
var_SetString
(
p_instance
->
p_input
,
"vod-session"
,
psz_id
);
if
(
input_Start
(
p_instance
->
p_input
)
!=
VLC_SUCCESS
)
if
(
input_Start
(
p_instance
->
p_input
)
!=
VLC_SUCCESS
)
{
{
...
...
src/input/vlm_internal.h
View file @
8cb745bf
...
@@ -38,6 +38,7 @@ typedef struct
...
@@ -38,6 +38,7 @@ typedef struct
bool
b_sout_keep
;
bool
b_sout_keep
;
vlc_object_t
*
p_parent
;
input_item_t
*
p_item
;
input_item_t
*
p_item
;
input_thread_t
*
p_input
;
input_thread_t
*
p_input
;
input_resource_t
*
p_input_resource
;
input_resource_t
*
p_input_resource
;
...
...
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