2016-05-15 15:54:09 +00:00
|
|
|
// Copyright (C) 2016 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the
|
|
|
|
// Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
// Boston, MA 02110-1301, USA.
|
2016-05-19 07:47:31 +00:00
|
|
|
//
|
|
|
|
//
|
|
|
|
use libc::c_char;
|
|
|
|
use std::ffi::CString;
|
2016-05-14 11:44:49 +00:00
|
|
|
|
|
|
|
#[repr(C)]
|
2016-08-24 21:48:53 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
2016-05-14 11:44:49 +00:00
|
|
|
pub enum GstFlowReturn {
|
|
|
|
Ok = 0,
|
|
|
|
NotLinked = -1,
|
|
|
|
Flushing = -2,
|
|
|
|
Eos = -3,
|
|
|
|
NotNegotiated = -4,
|
|
|
|
Error = -5,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(C)]
|
2016-08-24 21:48:53 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
2016-05-14 11:44:49 +00:00
|
|
|
pub enum GBoolean {
|
|
|
|
False = 0,
|
|
|
|
True = 1,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl GBoolean {
|
|
|
|
pub fn from_bool(v: bool) -> GBoolean {
|
2016-08-22 20:03:06 +00:00
|
|
|
if v { GBoolean::True } else { GBoolean::False }
|
2016-05-14 11:44:49 +00:00
|
|
|
}
|
2016-09-12 13:00:28 +00:00
|
|
|
|
|
|
|
pub fn to_bool(&self) -> bool {
|
|
|
|
!(*self == GBoolean::False)
|
|
|
|
}
|
2016-05-14 11:44:49 +00:00
|
|
|
}
|
|
|
|
|
2016-05-19 07:47:31 +00:00
|
|
|
#[no_mangle]
|
2016-08-22 20:03:06 +00:00
|
|
|
pub unsafe extern "C" fn cstring_drop(ptr: *mut c_char) {
|
2016-11-16 20:44:04 +00:00
|
|
|
let _ = CString::from_raw(ptr);
|
2016-05-19 07:47:31 +00:00
|
|
|
}
|