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
8bdd24a8
Commit
8bdd24a8
authored
Dec 16, 2017
by
Sebastian Dröge
🍵
Browse files
Run everything through rustfmt again
parent
159429dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
gstreamer-app/src/app_src.rs
View file @
8bdd24a8
...
...
@@ -68,7 +68,10 @@ impl AppSrcCallbacksBuilder {
}
}
pub
fn
seek_data
<
F
:
Fn
(
&
AppSrc
,
u64
)
->
bool
+
Send
+
Sync
+
'static
>
(
self
,
seek_data
:
F
)
->
Self
{
pub
fn
seek_data
<
F
:
Fn
(
&
AppSrc
,
u64
)
->
bool
+
Send
+
Sync
+
'static
>
(
self
,
seek_data
:
F
,
)
->
Self
{
Self
{
seek_data
:
Some
(
Box
::
new
(
seek_data
)),
..
self
...
...
@@ -85,9 +88,21 @@ impl AppSrcCallbacksBuilder {
enough_data
:
self
.enough_data
,
seek_data
:
self
.seek_data
,
callbacks
:
ffi
::
GstAppSrcCallbacks
{
need_data
:
if
have_need_data
{
Some
(
trampoline_need_data
)
}
else
{
None
},
enough_data
:
if
have_enough_data
{
Some
(
trampoline_enough_data
)
}
else
{
None
},
seek_data
:
if
have_seek_data
{
Some
(
trampoline_seek_data
)
}
else
{
None
},
need_data
:
if
have_need_data
{
Some
(
trampoline_need_data
)
}
else
{
None
},
enough_data
:
if
have_enough_data
{
Some
(
trampoline_enough_data
)
}
else
{
None
},
seek_data
:
if
have_seek_data
{
Some
(
trampoline_seek_data
)
}
else
{
None
},
_gst_reserved
:
[
ptr
::
null_mut
(),
ptr
::
null_mut
(),
...
...
@@ -107,14 +122,20 @@ unsafe extern "C" fn trampoline_need_data(
let
_guard
=
CallbackGuard
::
new
();
let
callbacks
=
&*
(
callbacks
as
*
const
AppSrcCallbacks
);
callbacks
.need_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
),
length
));
callbacks
.need_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
),
length
));
}
unsafe
extern
"C"
fn
trampoline_enough_data
(
appsrc
:
*
mut
ffi
::
GstAppSrc
,
callbacks
:
gpointer
)
{
let
_guard
=
CallbackGuard
::
new
();
let
callbacks
=
&*
(
callbacks
as
*
const
AppSrcCallbacks
);
callbacks
.enough_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
)));
callbacks
.enough_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
)));
}
unsafe
extern
"C"
fn
trampoline_seek_data
(
...
...
@@ -125,7 +146,12 @@ unsafe extern "C" fn trampoline_seek_data(
let
_guard
=
CallbackGuard
::
new
();
let
callbacks
=
&*
(
callbacks
as
*
const
AppSrcCallbacks
);
callbacks
.seek_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
),
offset
))
.unwrap_or
(
false
)
.to_glib
()
callbacks
.seek_data
.as_ref
()
.map
(|
f
|
f
(
&
from_glib_borrow
(
appsrc
),
offset
))
.unwrap_or
(
false
)
.to_glib
()
}
unsafe
extern
"C"
fn
destroy_callbacks
(
ptr
:
gpointer
)
{
...
...
gstreamer-audio/src/audio_info.rs
View file @
8bdd24a8
...
...
@@ -145,9 +145,7 @@ impl AudioInfo {
}
pub
fn
to_caps
(
&
self
)
->
Option
<
gst
::
Caps
>
{
unsafe
{
from_glib_full
(
ffi
::
gst_audio_info_to_caps
(
&
self
.0
))
}
unsafe
{
from_glib_full
(
ffi
::
gst_audio_info_to_caps
(
&
self
.0
))
}
}
pub
fn
convert
<
V
:
Into
<
gst
::
GenericFormattedValue
>
,
U
:
gst
::
SpecificFormattedValue
>
(
...
...
gstreamer-player/src/lib.rs
View file @
8bdd24a8
...
...
@@ -10,10 +10,10 @@ extern crate libc;
extern
crate
glib_sys
as
glib_ffi
;
extern
crate
gobject_sys
as
gobject_ffi
;
extern
crate
gstreamer_sys
as
gst_ffi
;
extern
crate
gstreamer
as
gst
;
extern
crate
gstreamer_video
as
gst_video
;
extern
crate
gstreamer_player_sys
as
ffi
;
extern
crate
gstreamer_sys
as
gst_ffi
;
extern
crate
gstreamer_video
as
gst_video
;
#[macro_use]
extern
crate
glib
;
...
...
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