Implement Send to allow for shared state
Signed-off-by: Aron Heinecke <aron.heinecke@t-online.de>merge-requests/7/merge
parent
43d6f46d34
commit
7238e34869
|
@ -28,6 +28,8 @@ pub struct Instance {
|
||||||
pub(crate) ptr: *mut sys::libvlc_instance_t,
|
pub(crate) ptr: *mut sys::libvlc_instance_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for Instance {}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
/// Create and initialize a libvlc instance.
|
/// Create and initialize a libvlc instance.
|
||||||
pub fn new() -> Option<Instance> {
|
pub fn new() -> Option<Instance> {
|
||||||
|
|
|
@ -12,6 +12,8 @@ pub struct Media {
|
||||||
pub(crate) ptr: *mut sys::libvlc_media_t,
|
pub(crate) ptr: *mut sys::libvlc_media_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for Media {}
|
||||||
|
|
||||||
impl Media {
|
impl Media {
|
||||||
/// Create a media with a certain given media resource location, for instance a valid URL.
|
/// Create a media with a certain given media resource location, for instance a valid URL.
|
||||||
pub fn new_location(instance: &Instance, mrl: &str) -> Option<Media> {
|
pub fn new_location(instance: &Instance, mrl: &str) -> Option<Media> {
|
||||||
|
|
|
@ -15,6 +15,8 @@ pub struct MediaPlayer {
|
||||||
pub(crate) ptr: *mut sys::libvlc_media_player_t,
|
pub(crate) ptr: *mut sys::libvlc_media_player_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for MediaPlayer {}
|
||||||
|
|
||||||
impl MediaPlayer {
|
impl MediaPlayer {
|
||||||
/// Create an empty Media Player object
|
/// Create an empty Media Player object
|
||||||
pub fn new(instance: &Instance) -> Option<MediaPlayer> {
|
pub fn new(instance: &Instance) -> Option<MediaPlayer> {
|
||||||
|
|
Loading…
Reference in New Issue