Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Zeeshan Ali
gstreamer-rs
Commits
917255de
Commit
917255de
authored
Dec 18, 2017
by
Sebastian Dröge
🍵
Browse files
Add typefind helper bindings
parent
12ee7358
Changes
5
Hide whitespace changes
Inline
Side-by-side
Gir_GstBase.toml
View file @
917255de
...
...
@@ -31,6 +31,7 @@ manual = [
"Gst.FlowReturn"
,
"Gst.Format"
,
"Gst.Pad"
,
"Gst.TypeFindProbability"
,
]
[[object]]
...
...
@@ -71,6 +72,15 @@ status = "manual"
trait
=
false
concurrency
=
"none"
[[object]]
name
=
"GstBase.*"
status
=
"generate"
[[object.function]]
name
=
"type_find_helper_for_data"
# broken data type
ignore
=
true
[[object]]
name
=
"Gst.Structure"
status
=
"manual"
...
...
gstreamer-base/src/auto/functions.rs
0 → 100644
View file @
917255de
// This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT
use
ffi
;
use
glib
::
object
::
IsA
;
use
glib
::
translate
::
*
;
use
gst
;
use
std
::
mem
;
pub
fn
type_find_helper
<
P
:
IsA
<
gst
::
Pad
>>
(
src
:
&
P
,
size
:
u64
)
->
Option
<
gst
::
Caps
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_type_find_helper
(
src
.to_glib_none
()
.0
,
size
))
}
}
pub
fn
type_find_helper_for_buffer
<
'a
,
P
:
IsA
<
gst
::
Object
>
+
'a
,
Q
:
Into
<
Option
<&
'a
P
>>>
(
obj
:
Q
,
buf
:
&
gst
::
Buffer
)
->
(
Option
<
gst
::
Caps
>
,
gst
::
TypeFindProbability
)
{
assert_initialized_main_thread!
();
let
obj
=
obj
.into
();
let
obj
=
obj
.to_glib_none
();
unsafe
{
let
mut
prob
=
mem
::
uninitialized
();
let
ret
=
from_glib_full
(
ffi
::
gst_type_find_helper_for_buffer
(
obj
.0
,
buf
.to_glib_none
()
.0
,
&
mut
prob
));
(
ret
,
from_glib
(
prob
))
}
}
pub
fn
type_find_helper_for_extension
<
'a
,
P
:
IsA
<
gst
::
Object
>
+
'a
,
Q
:
Into
<
Option
<&
'a
P
>>>
(
obj
:
Q
,
extension
:
&
str
)
->
Option
<
gst
::
Caps
>
{
assert_initialized_main_thread!
();
let
obj
=
obj
.into
();
let
obj
=
obj
.to_glib_none
();
unsafe
{
from_glib_full
(
ffi
::
gst_type_find_helper_for_extension
(
obj
.0
,
extension
.to_glib_none
()
.0
))
}
}
//pub fn type_find_helper_get_range<'a, P: IsA<gst::Object>, Q: IsA<gst::Object> + 'a, R: Into<Option<&'a Q>>>(obj: &P, parent: R, func: /*Unknown conversion*//*Unimplemented*/TypeFindHelperGetRangeFunction, size: u64, extension: &str) -> (Option<gst::Caps>, gst::TypeFindProbability) {
// unsafe { TODO: call ffi::gst_type_find_helper_get_range() }
//}
gstreamer-base/src/auto/mod.rs
View file @
917255de
...
...
@@ -19,6 +19,8 @@ pub use self::base_transform::BaseTransformExt;
mod
push_src
;
pub
use
self
::
push_src
::
PushSrc
;
pub
mod
functions
;
#[doc(hidden)]
pub
mod
traits
{
pub
use
super
::
BaseSinkExt
;
...
...
gstreamer-base/src/functions.rs
0 → 100644
View file @
917255de
// Copyright (C) 2017 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use
ffi
;
use
glib
::
object
::
IsA
;
use
glib
::
translate
::
*
;
use
gst
;
use
std
::
mem
;
pub
fn
type_find_helper_for_data
<
'a
,
P
:
IsA
<
gst
::
Object
>
+
'a
,
Q
:
Into
<
Option
<&
'a
P
>>
,
R
:
AsRef
<
[
u8
]
>
,
>
(
obj
:
Q
,
data
:
R
,
)
->
(
Option
<
gst
::
Caps
>
,
gst
::
TypeFindProbability
)
{
assert_initialized_main_thread!
();
let
obj
=
obj
.into
();
let
obj
=
obj
.to_glib_none
();
unsafe
{
let
mut
prob
=
mem
::
uninitialized
();
let
data
=
data
.as_ref
();
let
(
ptr
,
len
)
=
(
data
.as_ptr
(),
data
.len
());
let
ret
=
from_glib_full
(
ffi
::
gst_type_find_helper_for_data
(
obj
.0
,
ptr
,
len
,
&
mut
prob
,
));
(
ret
,
from_glib
(
prob
))
}
}
gstreamer-base/src/lib.rs
View file @
917255de
...
...
@@ -37,6 +37,10 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[cfg_attr(feature
=
"cargo-clippy"
,
allow(match_same_arms))]
mod
auto
;
pub
use
auto
::
*
;
pub
use
auto
::
functions
::
*
;
pub
mod
functions
;
pub
use
functions
::
*
;
mod
adapter
;
mod
flow_combiner
;
...
...
Write
Preview
Supports
Markdown
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