Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
MediaPlayer: Bind stopAsync for 4.0
· 64e0df49
Hugo Beauzée-Luyssen
authored
May 23, 2019
64e0df49
MediaPlayer: willPlay was removed in 4.0
· a3763c0f
Hugo Beauzée-Luyssen
authored
May 24, 2019
a3763c0f
common: Simplify wrapCStr
· 5147d358
Hugo Beauzée-Luyssen
authored
May 28, 2019
5147d358
Hide whitespace changes
Inline
Side-by-side
examples/helloworld/main.cpp
View file @
5147d358
...
...
@@ -14,5 +14,9 @@ int main(int ac, char** av)
auto
mp
=
VLC
::
MediaPlayer
(
media
);
mp
.
play
();
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
10
)
);
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp
.
stopAsync
();
#else
mp
.
stop
();
#endif
}
examples/imem/imem.cpp
View file @
5147d358
...
...
@@ -78,8 +78,13 @@ int main(int ac, char**av)
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
10
)
);
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp
.
stopAsync
();
mp2
.
stopAsync
();
#else
mp
.
stop
();
mp2
.
stop
();
#endif
delete
dummyOpaque
;
fclose
(
opaque2
->
file
);
...
...
test/main.cpp
View file @
5147d358
...
...
@@ -139,7 +139,11 @@ int main(int ac, char** av)
// expect a single call since both media player share the same event manager
expected
=
false
;
});
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp
.
stopAsync
();
#else
mp
.
stop
();
#endif
// Unregister the RegisteredEvent from the other MP's event manager.
// It will be unregistered from both, and when the object gets destroyed
// by leaving the scope, it won't be unregistered from mp2's eventManager.
...
...
vlcpp/MediaListPlayer.hpp
View file @
5147d358
...
...
@@ -161,6 +161,15 @@ public:
getInternalPtr
<
libvlc_media_t
>
(
md
)
)
==
0
;
}
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
/**
* Stop playing media list
*/
void
stopAsync
()
{
libvlc_media_list_player_stop_async
(
*
this
);
}
#else
/**
* Stop playing media list
*/
...
...
@@ -168,6 +177,7 @@ public:
{
libvlc_media_list_player_stop
(
*
this
);
}
#endif
/**
* Play next item from media list
...
...
vlcpp/MediaPlayer.hpp
View file @
5147d358
...
...
@@ -192,6 +192,15 @@ public:
libvlc_media_player_pause
(
*
this
);
}
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
/**
* @brief stop Stop the playback (no effect if there is no media)
*/
void
stopAsync
()
{
libvlc_media_player_stop_async
(
*
this
);
}
#else
/**
* @brief stop Stop the playback (no effect if there is no media)
*
...
...
@@ -203,6 +212,7 @@ public:
{
libvlc_media_player_stop
(
*
this
);
}
#endif
/**
* Set the NSView handler where the media player should render its video
...
...
@@ -403,6 +413,7 @@ public:
return
libvlc_media_player_get_chapter_count
(
*
this
);
}
#if LIBVLC_VERSION_INT < LIBVLC_VERSION(4, 0, 0, 0)
/**
* Is the player able to play
*
...
...
@@ -412,6 +423,7 @@ public:
{
return
libvlc_media_player_will_play
(
*
this
)
!=
0
;
}
#endif
/**
* Get title chapter count
...
...
vlcpp/common.hpp
View file @
5147d358
...
...
@@ -55,7 +55,7 @@ namespace VLC
inline
std
::
unique_ptr
<
char
,
void
(
*
)(
void
*
)
>
wrapCStr
(
char
*
str
)
{
return
std
::
unique_ptr
<
char
,
void
(
*
)(
void
*
)
>
(
str
,
[](
void
*
ptr
)
{
libvlc_free
(
ptr
);
}
);
return
std
::
unique_ptr
<
char
,
decltype
(
&
libvlc_free
)
>
(
str
,
&
libvlc_free
);
}
#if !defined(_MSC_VER)
...
...