Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GStreamer
gstreamer-rs
Commits
52dbf03d
Commit
52dbf03d
authored
Jul 29, 2017
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functions using queries
parent
5afa1858
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
37 deletions
+91
-37
Gir_Gst.toml
Gir_Gst.toml
+35
-0
gstreamer/src/auto/element.rs
gstreamer/src/auto/element.rs
+0
-6
gstreamer/src/auto/pad.rs
gstreamer/src/auto/pad.rs
+0
-30
gstreamer/src/element.rs
gstreamer/src/element.rs
+14
-0
gstreamer/src/lib.rs
gstreamer/src/lib.rs
+1
-0
gstreamer/src/pad.rs
gstreamer/src/pad.rs
+41
-1
No files found.
Gir_Gst.toml
View file @
52dbf03d
...
@@ -132,6 +132,11 @@ name = "Gst.TagList"
...
@@ -132,6 +132,11 @@ name = "Gst.TagList"
status
=
"manual"
status
=
"manual"
ref_mode
=
"ref"
ref_mode
=
"ref"
[[object]]
name
=
"Gst.Query"
status
=
"manual"
ref_mode
=
"ref"
[[object]]
[[object]]
name
=
"Gst.Clock"
name
=
"Gst.Clock"
status
=
"generate"
status
=
"generate"
...
@@ -198,6 +203,11 @@ status = "generate"
...
@@ -198,6 +203,11 @@ status = "generate"
[object.function.return]
[object.function.return]
bool_return_is_error
=
"Failed to sync state with parent"
bool_return_is_error
=
"Failed to sync state with parent"
[[object.function]]
name
=
"query"
# correct mutability
ignore
=
true
[[object]]
[[object]]
name
=
"Gst.ElementFactory"
name
=
"Gst.ElementFactory"
status
=
"generate"
status
=
"generate"
...
@@ -331,6 +341,31 @@ status = "generate"
...
@@ -331,6 +341,31 @@ status = "generate"
# Has getter/setter functions
# Has getter/setter functions
ignore
=
true
ignore
=
true
[[object.function]]
name
=
"query"
# Correct mutability
ignore
=
true
[[object.function]]
name
=
"peer_query"
# Correct mutability
ignore
=
true
[[object.function]]
name
=
"query_default"
# Correct mutability
ignore
=
true
[[object.function]]
name
=
"proxy_query_caps"
# Correct mutability
ignore
=
true
[[object.function]]
name
=
"proxy_query_accept_caps"
# Correct mutability
ignore
=
true
[[object]]
[[object]]
name
=
"Gst.Stream"
name
=
"Gst.Stream"
status
=
"generate"
status
=
"generate"
...
...
gstreamer/src/auto/element.rs
View file @
52dbf03d
...
@@ -160,8 +160,6 @@ pub trait ElementExt {
...
@@ -160,8 +160,6 @@ pub trait ElementExt {
fn
provide_clock
(
&
self
)
->
Option
<
Clock
>
;
fn
provide_clock
(
&
self
)
->
Option
<
Clock
>
;
//fn query(&self, query: /*Ignored*/&mut Query) -> bool;
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
;
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
;
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
...
@@ -438,10 +436,6 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
...
@@ -438,10 +436,6 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
}
}
//fn query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_element_query() }
//}
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
{
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
{
unsafe
{
unsafe
{
let
mut
dest_val
=
mem
::
uninitialized
();
let
mut
dest_val
=
mem
::
uninitialized
();
...
...
gstreamer/src/auto/pad.rs
View file @
52dbf03d
...
@@ -148,8 +148,6 @@ pub trait PadExt {
...
@@ -148,8 +148,6 @@ pub trait PadExt {
fn
pause_task
(
&
self
)
->
Result
<
(),
glib
::
error
::
BoolError
>
;
fn
pause_task
(
&
self
)
->
Result
<
(),
glib
::
error
::
BoolError
>
;
//fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool;
fn
peer_query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
;
fn
peer_query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
;
fn
peer_query_caps
<
'a
,
P
:
Into
<
Option
<&
'a
Caps
>>>
(
&
self
,
filter
:
P
)
->
Option
<
Caps
>
;
fn
peer_query_caps
<
'a
,
P
:
Into
<
Option
<&
'a
Caps
>>>
(
&
self
,
filter
:
P
)
->
Option
<
Caps
>
;
...
@@ -160,24 +158,16 @@ pub trait PadExt {
...
@@ -160,24 +158,16 @@ pub trait PadExt {
fn
peer_query_position
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
fn
peer_query_position
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
//fn proxy_query_accept_caps(&self, query: /*Ignored*/&mut Query) -> bool;
//fn proxy_query_caps(&self, query: /*Ignored*/&mut Query) -> bool;
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool;
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool;
//fn push_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn;
//fn push_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn;
//fn query(&self, query: /*Ignored*/&mut Query) -> bool;
fn
query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
;
fn
query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
;
fn
query_caps
<
'a
,
P
:
Into
<
Option
<&
'a
Caps
>>>
(
&
self
,
filter
:
P
)
->
Option
<
Caps
>
;
fn
query_caps
<
'a
,
P
:
Into
<
Option
<&
'a
Caps
>>>
(
&
self
,
filter
:
P
)
->
Option
<
Caps
>
;
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
;
fn
query_convert
(
&
self
,
src_format
:
Format
,
src_val
:
i64
,
dest_format
:
Format
)
->
Option
<
i64
>
;
//fn query_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, query: /*Ignored*/&mut Query) -> bool;
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
fn
query_position
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
fn
query_position
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
;
...
@@ -438,10 +428,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
...
@@ -438,10 +428,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
}
}
//fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_peer_query() }
//}
fn
peer_query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
{
fn
peer_query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
{
unsafe
{
unsafe
{
from_glib
(
ffi
::
gst_pad_peer_query_accept_caps
(
self
.to_glib_none
()
.0
,
caps
.to_glib_none
()
.0
))
from_glib
(
ffi
::
gst_pad_peer_query_accept_caps
(
self
.to_glib_none
()
.0
,
caps
.to_glib_none
()
.0
))
...
@@ -480,14 +466,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
...
@@ -480,14 +466,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
}
}
//fn proxy_query_accept_caps(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_proxy_query_accept_caps() }
//}
//fn proxy_query_caps(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_proxy_query_caps() }
//}
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool {
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool {
// unsafe { TODO: call ffi::gst_pad_push_event() }
// unsafe { TODO: call ffi::gst_pad_push_event() }
//}
//}
...
@@ -496,10 +474,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
...
@@ -496,10 +474,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
// unsafe { TODO: call ffi::gst_pad_push_list() }
// unsafe { TODO: call ffi::gst_pad_push_list() }
//}
//}
//fn query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_query() }
//}
fn
query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
{
fn
query_accept_caps
(
&
self
,
caps
:
&
Caps
)
->
bool
{
unsafe
{
unsafe
{
from_glib
(
ffi
::
gst_pad_query_accept_caps
(
self
.to_glib_none
()
.0
,
caps
.to_glib_none
()
.0
))
from_glib
(
ffi
::
gst_pad_query_accept_caps
(
self
.to_glib_none
()
.0
,
caps
.to_glib_none
()
.0
))
...
@@ -522,10 +496,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
...
@@ -522,10 +496,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
}
}
//fn query_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_query_default() }
//}
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
{
fn
query_duration
(
&
self
,
format
:
Format
)
->
Option
<
i64
>
{
unsafe
{
unsafe
{
let
mut
duration
=
mem
::
uninitialized
();
let
mut
duration
=
mem
::
uninitialized
();
...
...
gstreamer/src/element.rs
View file @
52dbf03d
...
@@ -11,6 +11,8 @@ use Element;
...
@@ -11,6 +11,8 @@ use Element;
use
glib
;
use
glib
;
use
glib
::
IsA
;
use
glib
::
IsA
;
use
glib
::
translate
::{
ToGlibPtr
,
from_glib
};
use
glib
::
translate
::{
ToGlibPtr
,
from_glib
};
use
QueryRef
;
use
miniobject
::
MiniObject
;
use
ffi
;
use
ffi
;
...
@@ -39,3 +41,15 @@ impl Element {
...
@@ -39,3 +41,15 @@ impl Element {
}
}
}
}
}
}
pub
trait
ElementExtManual
{
fn
query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
;
}
impl
<
O
:
IsA
<
Element
>>
ElementExtManual
for
O
{
fn
query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
{
unsafe
{
from_glib
(
ffi
::
gst_element_query
(
self
.to_glib_none
()
.0
,
query
.as_mut_ptr
()))
}
}
}
gstreamer/src/lib.rs
View file @
52dbf03d
...
@@ -71,6 +71,7 @@ mod bus;
...
@@ -71,6 +71,7 @@ mod bus;
mod
pad
;
mod
pad
;
mod
gobject
;
mod
gobject
;
mod
segment
;
mod
segment
;
pub
use
element
::
ElementExtManual
;
pub
use
bin
::
BinExtManual
;
pub
use
bin
::
BinExtManual
;
pub
use
pad
::{
PadExtManual
,
PadProbeId
,
PadProbeInfo
,
PadProbeData
,
PAD_PROBE_ID_INVALID
};
pub
use
pad
::{
PadExtManual
,
PadProbeId
,
PadProbeInfo
,
PadProbeData
,
PAD_PROBE_ID_INVALID
};
pub
use
gobject
::
GObjectExtManualGst
;
pub
use
gobject
::
GObjectExtManualGst
;
...
...
gstreamer/src/pad.rs
View file @
52dbf03d
...
@@ -12,6 +12,7 @@ use PadProbeReturn;
...
@@ -12,6 +12,7 @@ use PadProbeReturn;
use
Buffer
;
use
Buffer
;
use
BufferList
;
use
BufferList
;
use
FlowReturn
;
use
FlowReturn
;
use
QueryRef
;
use
miniobject
::
MiniObject
;
use
miniobject
::
MiniObject
;
use
std
::
cell
::
RefCell
;
use
std
::
cell
::
RefCell
;
...
@@ -19,9 +20,10 @@ use std::mem::transmute;
...
@@ -19,9 +20,10 @@ use std::mem::transmute;
use
std
::
ptr
;
use
std
::
ptr
;
use
glib
::{
IsA
,
StaticType
};
use
glib
::{
IsA
,
StaticType
};
use
glib
::
translate
::{
ToGlib
,
FromGlib
,
from_glib
,
from_glib_none
,
from_glib_full
};
use
glib
::
translate
::{
ToGlib
,
ToGlibPtr
,
FromGlib
,
from_glib
,
from_glib_none
,
from_glib_full
};
use
glib
::
source
::
CallbackGuard
;
use
glib
::
source
::
CallbackGuard
;
use
glib_ffi
::
gpointer
;
use
glib_ffi
::
gpointer
;
use
glib
::
Object
;
use
libc
;
use
libc
;
...
@@ -72,6 +74,12 @@ pub trait PadExtManual {
...
@@ -72,6 +74,12 @@ pub trait PadExtManual {
fn
pull_range
(
&
self
,
offset
:
u64
,
size
:
u32
)
->
Result
<
Buffer
,
FlowReturn
>
;
fn
pull_range
(
&
self
,
offset
:
u64
,
size
:
u32
)
->
Result
<
Buffer
,
FlowReturn
>
;
fn
get_range
(
&
self
,
offset
:
u64
,
size
:
u32
)
->
Result
<
Buffer
,
FlowReturn
>
;
fn
get_range
(
&
self
,
offset
:
u64
,
size
:
u32
)
->
Result
<
Buffer
,
FlowReturn
>
;
fn
peer_query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
;
fn
query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
;
fn
query_default
<
'a
,
P
:
IsA
<
Object
>
+
'a
,
Q
:
Into
<
Option
<&
'a
P
>>>
(
&
self
,
parent
:
Q
,
query
:
&
mut
QueryRef
)
->
bool
;
fn
proxy_query_caps
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
;
fn
proxy_query_accept_caps
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
;
}
}
impl
<
O
:
IsA
<
Pad
>>
PadExtManual
for
O
{
impl
<
O
:
IsA
<
Pad
>>
PadExtManual
for
O
{
...
@@ -139,6 +147,38 @@ impl<O: IsA<Pad>> PadExtManual for O {
...
@@ -139,6 +147,38 @@ impl<O: IsA<Pad>> PadExtManual for O {
}
}
}
}
}
}
fn
query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
{
unsafe
{
from_glib
(
ffi
::
gst_pad_query
(
self
.to_glib_none
()
.0
,
query
.as_mut_ptr
()))
}
}
fn
peer_query
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
{
unsafe
{
from_glib
(
ffi
::
gst_pad_peer_query
(
self
.to_glib_none
()
.0
,
query
.as_mut_ptr
()))
}
}
fn
query_default
<
'a
,
P
:
IsA
<
Object
>
+
'a
,
Q
:
Into
<
Option
<&
'a
P
>>>
(
&
self
,
parent
:
Q
,
query
:
&
mut
QueryRef
)
->
bool
{
let
parent
=
parent
.into
();
let
parent
=
parent
.to_glib_none
();
unsafe
{
from_glib
(
ffi
::
gst_pad_query_default
(
self
.to_glib_none
()
.0
,
parent
.0
as
*
mut
_
,
query
.as_mut_ptr
()))
}
}
fn
proxy_query_accept_caps
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
{
unsafe
{
from_glib
(
ffi
::
gst_pad_proxy_query_accept_caps
(
self
.to_glib_none
()
.0
,
query
.as_mut_ptr
()))
}
}
fn
proxy_query_caps
(
&
self
,
query
:
&
mut
QueryRef
)
->
bool
{
unsafe
{
from_glib
(
ffi
::
gst_pad_proxy_query_accept_caps
(
self
.to_glib_none
()
.0
,
query
.as_mut_ptr
()))
}
}
}
}
unsafe
extern
"C"
fn
trampoline_pad_probe
(
unsafe
extern
"C"
fn
trampoline_pad_probe
(
...
...
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