Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e49d07aa
Commit
e49d07aa
authored
Jan 31, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make media player a VLC object
This will make variable inheritance to child inputs much simpler
parent
26af1ac0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
src/control/media_player.c
src/control/media_player.c
+10
-10
src/control/media_player_internal.h
src/control/media_player_internal.h
+2
-0
No files found.
src/control/media_player.c
View file @
e49d07aa
...
...
@@ -343,13 +343,13 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
assert
(
instance
);
mp
=
malloc
(
sizeof
(
libvlc_media_player_t
));
if
(
!
mp
)
mp
=
vlc_object_create
(
instance
->
p_libvlc_int
,
sizeof
(
*
mp
));
if
(
unlikely
(
mp
==
NULL
)
)
{
libvlc_exception_raise
(
e
);
libvlc_printerr
(
"Not enough memory"
);
return
NULL
;
}
vlc_object_attach
(
mp
,
mp
->
p_libvlc
);
mp
->
p_md
=
NULL
;
mp
->
drawable
.
agl
=
0
;
mp
->
drawable
.
xid
=
0
;
...
...
@@ -364,7 +364,7 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
mp
->
p_event_manager
=
libvlc_event_manager_new
(
mp
,
instance
);
if
(
unlikely
(
mp
->
p_event_manager
==
NULL
))
{
fre
e
(
mp
);
vlc_object_releas
e
(
mp
);
return
NULL
;
}
vlc_mutex_init
(
&
mp
->
object_lock
);
...
...
@@ -399,7 +399,7 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
* FIXME: It's unclear why we want to put this in public API, and why we
* want to expose it in such a limiting and ugly way.
*/
var_AddCallback
(
instance
->
p_libvlc_int
,
"snapshot-file"
,
snapshot_was_taken
,
mp
);
var_AddCallback
(
mp
->
p_libvlc
,
"snapshot-file"
,
snapshot_was_taken
,
mp
);
return
mp
;
}
...
...
@@ -434,7 +434,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
assert
(
p_mi
);
/* Detach Callback from the main libvlc object */
var_DelCallback
(
p_mi
->
p_libvlc
_instance
->
p_libvlc_int
,
var_DelCallback
(
p_mi
->
p_libvlc
,
"snapshot-file"
,
snapshot_was_taken
,
p_mi
);
/* If the input thread hasn't been already deleted it means
...
...
@@ -454,7 +454,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
libvlc_event_manager_release
(
p_mi
->
p_event_manager
);
libvlc_media_release
(
p_mi
->
p_md
);
vlc_mutex_destroy
(
&
p_mi
->
object_lock
);
fre
e
(
p_mi
);
vlc_object_releas
e
(
p_mi
);
}
/**************************************************************************
...
...
@@ -589,9 +589,9 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi,
return
;
}
p_mi
->
p_input_thread
=
input_Create
(
p_mi
->
p_libvlc_instance
->
p_libvlc_int
,
p_mi
->
p_md
->
p_input_item
,
NULL
,
p_mi
->
p_input_resource
);
p_mi
->
p_input_thread
=
input_Create
(
p_mi
,
p_mi
->
p_md
->
p_input_item
,
NULL
,
p_mi
->
p_input_resource
);
if
(
!
p_mi
->
p_input_thread
)
{
unlock
(
p_mi
);
...
...
src/control/media_player_internal.h
View file @
e49d07aa
...
...
@@ -36,6 +36,8 @@
struct
libvlc_media_player_t
{
VLC_COMMON_MEMBERS
int
i_refcount
;
vlc_mutex_t
object_lock
;
input_thread_t
*
p_input_thread
;
...
...
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