Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer-rs-sys
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GStreamer
gstreamer-rs-sys
Commits
be0f64ce
Commit
be0f64ce
authored
Jun 18, 2019
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run everything through rustfmt
parent
77a9f4b4
Changes
52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
21399 additions
and
6865 deletions
+21399
-6865
gstreamer-app-sys/build.rs
gstreamer-app-sys/build.rs
+6
-5
gstreamer-app-sys/src/lib.rs
gstreamer-app-sys/src/lib.rs
+83
-48
gstreamer-app-sys/tests/abi.rs
gstreamer-app-sys/tests/abi.rs
+89
-42
gstreamer-audio-sys/build.rs
gstreamer-audio-sys/build.rs
+6
-5
gstreamer-audio-sys/src/lib.rs
gstreamer-audio-sys/src/lib.rs
+950
-393
gstreamer-audio-sys/tests/abi.rs
gstreamer-audio-sys/tests/abi.rs
+439
-92
gstreamer-base-sys/build.rs
gstreamer-base-sys/build.rs
+6
-5
gstreamer-base-sys/src/lib.rs
gstreamer-base-sys/src/lib.rs
+1155
-413
gstreamer-base-sys/tests/abi.rs
gstreamer-base-sys/tests/abi.rs
+243
-64
gstreamer-check-sys/build.rs
gstreamer-check-sys/build.rs
+6
-5
gstreamer-check-sys/src/lib.rs
gstreamer-check-sys/src/lib.rs
+229
-60
gstreamer-check-sys/tests/abi.rs
gstreamer-check-sys/tests/abi.rs
+62
-40
gstreamer-editing-services-sys/build.rs
gstreamer-editing-services-sys/build.rs
+6
-5
gstreamer-editing-services-sys/src/lib.rs
gstreamer-editing-services-sys/src/lib.rs
+1153
-480
gstreamer-editing-services-sys/tests/abi.rs
gstreamer-editing-services-sys/tests/abi.rs
+1020
-193
gstreamer-gl-sys/build.rs
gstreamer-gl-sys/build.rs
+6
-5
gstreamer-gl-sys/src/lib.rs
gstreamer-gl-sys/src/lib.rs
+1242
-429
gstreamer-gl-sys/src/manual.rs
gstreamer-gl-sys/src/manual.rs
+2
-1
gstreamer-gl-sys/tests/abi.rs
gstreamer-gl-sys/tests/abi.rs
+523
-104
gstreamer-mpegts-sys/build.rs
gstreamer-mpegts-sys/build.rs
+6
-5
gstreamer-mpegts-sys/src/lib.rs
gstreamer-mpegts-sys/src/lib.rs
+651
-360
gstreamer-mpegts-sys/tests/abi.rs
gstreamer-mpegts-sys/tests/abi.rs
+769
-158
gstreamer-net-sys/build.rs
gstreamer-net-sys/build.rs
+6
-5
gstreamer-net-sys/src/lib.rs
gstreamer-net-sys/src/lib.rs
+92
-46
gstreamer-net-sys/tests/abi.rs
gstreamer-net-sys/tests/abi.rs
+133
-50
gstreamer-pbutils-sys/build.rs
gstreamer-pbutils-sys/build.rs
+6
-5
gstreamer-pbutils-sys/src/lib.rs
gstreamer-pbutils-sys/src/lib.rs
+427
-133
gstreamer-pbutils-sys/tests/abi.rs
gstreamer-pbutils-sys/tests/abi.rs
+165
-55
gstreamer-player-sys/build.rs
gstreamer-player-sys/build.rs
+6
-5
gstreamer-player-sys/src/lib.rs
gstreamer-player-sys/src/lib.rs
+191
-67
gstreamer-player-sys/tests/abi.rs
gstreamer-player-sys/tests/abi.rs
+89
-42
gstreamer-rtsp-server-sys/build.rs
gstreamer-rtsp-server-sys/build.rs
+6
-5
gstreamer-rtsp-server-sys/src/lib.rs
gstreamer-rtsp-server-sys/src/lib.rs
+1305
-449
gstreamer-rtsp-server-sys/tests/abi.rs
gstreamer-rtsp-server-sys/tests/abi.rs
+414
-91
gstreamer-rtsp-sys/build.rs
gstreamer-rtsp-sys/build.rs
+6
-5
gstreamer-rtsp-sys/src/lib.rs
gstreamer-rtsp-sys/src/lib.rs
+583
-200
gstreamer-rtsp-sys/tests/abi.rs
gstreamer-rtsp-sys/tests/abi.rs
+230
-63
gstreamer-sdp-sys/build.rs
gstreamer-sdp-sys/build.rs
+6
-5
gstreamer-sdp-sys/src/lib.rs
gstreamer-sdp-sys/src/lib.rs
+591
-210
gstreamer-sdp-sys/tests/abi.rs
gstreamer-sdp-sys/tests/abi.rs
+264
-67
gstreamer-sys/build.rs
gstreamer-sys/build.rs
+6
-5
gstreamer-sys/src/lib.rs
gstreamer-sys/src/lib.rs
+3899
-1199
gstreamer-sys/tests/abi.rs
gstreamer-sys/tests/abi.rs
+1307
-222
gstreamer-tag-sys/build.rs
gstreamer-tag-sys/build.rs
+6
-5
gstreamer-tag-sys/src/lib.rs
gstreamer-tag-sys/src/lib.rs
+198
-75
gstreamer-tag-sys/tests/abi.rs
gstreamer-tag-sys/tests/abi.rs
+140
-54
gstreamer-video-sys/build.rs
gstreamer-video-sys/build.rs
+6
-5
gstreamer-video-sys/src/lib.rs
gstreamer-video-sys/src/lib.rs
+1599
-607
gstreamer-video-sys/tests/abi.rs
gstreamer-video-sys/tests/abi.rs
+684
-127
gstreamer-webrtc-sys/build.rs
gstreamer-webrtc-sys/build.rs
+6
-5
gstreamer-webrtc-sys/src/lib.rs
gstreamer-webrtc-sys/src/lib.rs
+136
-82
gstreamer-webrtc-sys/tests/abi.rs
gstreamer-webrtc-sys/tests/abi.rs
+240
-64
No files found.
gstreamer-app-sys/build.rs
View file @
be0f64ce
...
...
@@ -6,8 +6,8 @@ extern crate pkg_config;
use
pkg_config
::{
Config
,
Error
};
use
std
::
env
;
use
std
::
io
::
prelude
::
*
;
use
std
::
io
;
use
std
::
io
::
prelude
::
*
;
use
std
::
process
;
fn
main
()
{
...
...
@@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
println!
(
"cargo:rustc-link-search=native={}"
,
lib_dir
);
return
Ok
(())
return
Ok
(())
;
}
let
target
=
env
::
var
(
"TARGET"
)
.expect
(
"TARGET environment variable doesn't exist"
);
...
...
@@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
for
path
in
library
.link_paths
.iter
()
{
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
));
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
)
);
}
}
Ok
(())
...
...
@@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
Err
(
err
)
=>
Err
(
err
),
}
}
gstreamer-app-sys/src/lib.rs
View file @
be0f64ce
...
...
@@ -3,17 +3,22 @@
// DO NOT EDIT
#![allow(non_camel_case_types,
non_upper_case_globals,
non_snake_case)]
#![allow(clippy::approx_constant,
clippy::type_complexity,
clippy::unreadable_literal)]
#![allow(
clippy::approx_constant,
clippy::type_complexity,
clippy::unreadable_literal
)]
extern
crate
libc
;
extern
crate
glib_sys
as
glib
;
extern
crate
gstreamer_sys
as
gst
;
extern
crate
gstreamer_base_sys
as
gst_base
;
extern
crate
gstreamer_sys
as
gst
;
extern
crate
libc
;
#[allow(unused_imports)]
use
libc
::{
c_int
,
c_char
,
c_uchar
,
c_float
,
c_uint
,
c_double
,
c_short
,
c_ushort
,
c_long
,
c_ulong
,
c_void
,
size_t
,
ssize_t
,
intptr_t
,
uintptr_t
,
time_t
,
FILE
};
use
libc
::{
c_char
,
c_double
,
c_float
,
c_int
,
c_long
,
c_short
,
c_uchar
,
c_uint
,
c_ulong
,
c_ushort
,
c_void
,
intptr_t
,
size_t
,
ssize_t
,
time_t
,
uintptr_t
,
FILE
,
};
#[allow(unused_imports)]
use
glib
::{
gboolean
,
gconstpointer
,
gpointer
,
GType
};
...
...
@@ -37,10 +42,10 @@ pub struct GstAppSinkCallbacks {
impl
::
std
::
fmt
::
Debug
for
GstAppSinkCallbacks
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSinkCallbacks @ {:?}"
,
self
as
*
const
_
))
.field
(
"eos"
,
&
self
.eos
)
.field
(
"new_preroll"
,
&
self
.new_preroll
)
.field
(
"new_sample"
,
&
self
.new_sample
)
.finish
()
.field
(
"eos"
,
&
self
.eos
)
.field
(
"new_preroll"
,
&
self
.new_preroll
)
.field
(
"new_sample"
,
&
self
.new_sample
)
.finish
()
}
}
...
...
@@ -53,23 +58,25 @@ pub struct GstAppSinkClass {
pub
new_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
)
->
gst
::
GstFlowReturn
>
,
pub
pull_preroll
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
)
->
*
mut
gst
::
GstSample
>
,
pub
pull_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
)
->
*
mut
gst
::
GstSample
>
,
pub
try_pull_preroll
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
,
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
>
,
pub
try_pull_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
,
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
>
,
pub
try_pull_preroll
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
,
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
>
,
pub
try_pull_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSink
,
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
>
,
pub
_
gst_reserved
:
[
gpointer
;
2
],
}
impl
::
std
::
fmt
::
Debug
for
GstAppSinkClass
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSinkClass @ {:?}"
,
self
as
*
const
_
))
.field
(
"basesink_class"
,
&
self
.basesink_class
)
.field
(
"eos"
,
&
self
.eos
)
.field
(
"new_preroll"
,
&
self
.new_preroll
)
.field
(
"new_sample"
,
&
self
.new_sample
)
.field
(
"pull_preroll"
,
&
self
.pull_preroll
)
.field
(
"pull_sample"
,
&
self
.pull_sample
)
.field
(
"try_pull_preroll"
,
&
self
.try_pull_preroll
)
.field
(
"try_pull_sample"
,
&
self
.try_pull_sample
)
.finish
()
.field
(
"basesink_class"
,
&
self
.basesink_class
)
.field
(
"eos"
,
&
self
.eos
)
.field
(
"new_preroll"
,
&
self
.new_preroll
)
.field
(
"new_sample"
,
&
self
.new_sample
)
.field
(
"pull_preroll"
,
&
self
.pull_preroll
)
.field
(
"pull_sample"
,
&
self
.pull_sample
)
.field
(
"try_pull_preroll"
,
&
self
.try_pull_preroll
)
.field
(
"try_pull_sample"
,
&
self
.try_pull_sample
)
.finish
()
}
}
...
...
@@ -90,10 +97,10 @@ pub struct GstAppSrcCallbacks {
impl
::
std
::
fmt
::
Debug
for
GstAppSrcCallbacks
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSrcCallbacks @ {:?}"
,
self
as
*
const
_
))
.field
(
"need_data"
,
&
self
.need_data
)
.field
(
"enough_data"
,
&
self
.enough_data
)
.field
(
"seek_data"
,
&
self
.seek_data
)
.finish
()
.field
(
"need_data"
,
&
self
.need_data
)
.field
(
"enough_data"
,
&
self
.enough_data
)
.field
(
"seek_data"
,
&
self
.seek_data
)
.finish
()
}
}
...
...
@@ -104,25 +111,28 @@ pub struct GstAppSrcClass {
pub
need_data
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
c_uint
)
>
,
pub
enough_data
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
)
>
,
pub
seek_data
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
u64
)
->
gboolean
>
,
pub
push_buffer
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstBuffer
)
->
gst
::
GstFlowReturn
>
,
pub
push_buffer
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstBuffer
)
->
gst
::
GstFlowReturn
>
,
pub
end_of_stream
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
)
->
gst
::
GstFlowReturn
>
,
pub
push_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstSample
)
->
gst
::
GstFlowReturn
>
,
pub
push_buffer_list
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstBufferList
)
->
gst
::
GstFlowReturn
>
,
pub
push_sample
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstSample
)
->
gst
::
GstFlowReturn
>
,
pub
push_buffer_list
:
Option
<
unsafe
extern
"C"
fn
(
*
mut
GstAppSrc
,
*
mut
gst
::
GstBufferList
)
->
gst
::
GstFlowReturn
>
,
pub
_
gst_reserved
:
[
gpointer
;
2
],
}
impl
::
std
::
fmt
::
Debug
for
GstAppSrcClass
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSrcClass @ {:?}"
,
self
as
*
const
_
))
.field
(
"basesrc_class"
,
&
self
.basesrc_class
)
.field
(
"need_data"
,
&
self
.need_data
)
.field
(
"enough_data"
,
&
self
.enough_data
)
.field
(
"seek_data"
,
&
self
.seek_data
)
.field
(
"push_buffer"
,
&
self
.push_buffer
)
.field
(
"end_of_stream"
,
&
self
.end_of_stream
)
.field
(
"push_sample"
,
&
self
.push_sample
)
.field
(
"push_buffer_list"
,
&
self
.push_buffer_list
)
.finish
()
.field
(
"basesrc_class"
,
&
self
.basesrc_class
)
.field
(
"need_data"
,
&
self
.need_data
)
.field
(
"enough_data"
,
&
self
.enough_data
)
.field
(
"seek_data"
,
&
self
.seek_data
)
.field
(
"push_buffer"
,
&
self
.push_buffer
)
.field
(
"end_of_stream"
,
&
self
.end_of_stream
)
.field
(
"push_sample"
,
&
self
.push_sample
)
.field
(
"push_buffer_list"
,
&
self
.push_buffer_list
)
.finish
()
}
}
...
...
@@ -143,8 +153,8 @@ pub struct GstAppSink {
impl
::
std
::
fmt
::
Debug
for
GstAppSink
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSink @ {:?}"
,
self
as
*
const
_
))
.field
(
"basesink"
,
&
self
.basesink
)
.finish
()
.field
(
"basesink"
,
&
self
.basesink
)
.finish
()
}
}
...
...
@@ -159,8 +169,8 @@ pub struct GstAppSrc {
impl
::
std
::
fmt
::
Debug
for
GstAppSrc
{
fn
fmt
(
&
self
,
f
:
&
mut
::
std
::
fmt
::
Formatter
)
->
::
std
::
fmt
::
Result
{
f
.debug_struct
(
&
format!
(
"GstAppSrc @ {:?}"
,
self
as
*
const
_
))
.field
(
"basesrc"
,
&
self
.basesrc
)
.finish
()
.field
(
"basesrc"
,
&
self
.basesrc
)
.finish
()
}
}
...
...
@@ -187,16 +197,27 @@ extern "C" {
pub
fn
gst_app_sink_pull_sample
(
appsink
:
*
mut
GstAppSink
)
->
*
mut
gst
::
GstSample
;
#[cfg(any(feature
=
"v1_12"
,
feature
=
"dox"
))]
pub
fn
gst_app_sink_set_buffer_list_support
(
appsink
:
*
mut
GstAppSink
,
enable_lists
:
gboolean
);
pub
fn
gst_app_sink_set_callbacks
(
appsink
:
*
mut
GstAppSink
,
callbacks
:
*
mut
GstAppSinkCallbacks
,
user_data
:
gpointer
,
notify
:
glib
::
GDestroyNotify
);
pub
fn
gst_app_sink_set_callbacks
(
appsink
:
*
mut
GstAppSink
,
callbacks
:
*
mut
GstAppSinkCallbacks
,
user_data
:
gpointer
,
notify
:
glib
::
GDestroyNotify
,
);
pub
fn
gst_app_sink_set_caps
(
appsink
:
*
mut
GstAppSink
,
caps
:
*
const
gst
::
GstCaps
);
pub
fn
gst_app_sink_set_drop
(
appsink
:
*
mut
GstAppSink
,
drop
:
gboolean
);
pub
fn
gst_app_sink_set_emit_signals
(
appsink
:
*
mut
GstAppSink
,
emit
:
gboolean
);
pub
fn
gst_app_sink_set_max_buffers
(
appsink
:
*
mut
GstAppSink
,
max
:
c_uint
);
pub
fn
gst_app_sink_set_wait_on_eos
(
appsink
:
*
mut
GstAppSink
,
wait
:
gboolean
);
#[cfg(any(feature
=
"v1_10"
,
feature
=
"dox"
))]
pub
fn
gst_app_sink_try_pull_preroll
(
appsink
:
*
mut
GstAppSink
,
timeout
:
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
;
pub
fn
gst_app_sink_try_pull_preroll
(
appsink
:
*
mut
GstAppSink
,
timeout
:
gst
::
GstClockTime
,
)
->
*
mut
gst
::
GstSample
;
#[cfg(any(feature
=
"v1_10"
,
feature
=
"dox"
))]
pub
fn
gst_app_sink_try_pull_sample
(
appsink
:
*
mut
GstAppSink
,
timeout
:
gst
::
GstClockTime
)
->
*
mut
gst
::
GstSample
;
pub
fn
gst_app_sink_try_pull_sample
(
appsink
:
*
mut
GstAppSink
,
timeout
:
gst
::
GstClockTime
,
)
->
*
mut
gst
::
GstSample
;
//=========================================================================
// GstAppSrc
...
...
@@ -213,12 +234,26 @@ extern "C" {
pub
fn
gst_app_src_get_max_bytes
(
appsrc
:
*
mut
GstAppSrc
)
->
u64
;
pub
fn
gst_app_src_get_size
(
appsrc
:
*
mut
GstAppSrc
)
->
i64
;
pub
fn
gst_app_src_get_stream_type
(
appsrc
:
*
mut
GstAppSrc
)
->
GstAppStreamType
;
pub
fn
gst_app_src_push_buffer
(
appsrc
:
*
mut
GstAppSrc
,
buffer
:
*
mut
gst
::
GstBuffer
)
->
gst
::
GstFlowReturn
;
pub
fn
gst_app_src_push_buffer
(
appsrc
:
*
mut
GstAppSrc
,
buffer
:
*
mut
gst
::
GstBuffer
,
)
->
gst
::
GstFlowReturn
;
#[cfg(any(feature
=
"v1_14"
,
feature
=
"dox"
))]
pub
fn
gst_app_src_push_buffer_list
(
appsrc
:
*
mut
GstAppSrc
,
buffer_list
:
*
mut
gst
::
GstBufferList
)
->
gst
::
GstFlowReturn
;
pub
fn
gst_app_src_push_buffer_list
(
appsrc
:
*
mut
GstAppSrc
,
buffer_list
:
*
mut
gst
::
GstBufferList
,
)
->
gst
::
GstFlowReturn
;
#[cfg(any(feature
=
"v1_6"
,
feature
=
"dox"
))]
pub
fn
gst_app_src_push_sample
(
appsrc
:
*
mut
GstAppSrc
,
sample
:
*
mut
gst
::
GstSample
)
->
gst
::
GstFlowReturn
;
pub
fn
gst_app_src_set_callbacks
(
appsrc
:
*
mut
GstAppSrc
,
callbacks
:
*
mut
GstAppSrcCallbacks
,
user_data
:
gpointer
,
notify
:
glib
::
GDestroyNotify
);
pub
fn
gst_app_src_push_sample
(
appsrc
:
*
mut
GstAppSrc
,
sample
:
*
mut
gst
::
GstSample
,
)
->
gst
::
GstFlowReturn
;
pub
fn
gst_app_src_set_callbacks
(
appsrc
:
*
mut
GstAppSrc
,
callbacks
:
*
mut
GstAppSrcCallbacks
,
user_data
:
gpointer
,
notify
:
glib
::
GDestroyNotify
,
);
pub
fn
gst_app_src_set_caps
(
appsrc
:
*
mut
GstAppSrc
,
caps
:
*
const
gst
::
GstCaps
);
#[cfg(any(feature
=
"v1_10"
,
feature
=
"dox"
))]
pub
fn
gst_app_src_set_duration
(
appsrc
:
*
mut
GstAppSrc
,
duration
:
gst
::
GstClockTime
);
...
...
gstreamer-app-sys/tests/abi.rs
View file @
be0f64ce
...
...
@@ -5,13 +5,13 @@
extern
crate
gstreamer_app_sys
;
extern
crate
shell_words
;
extern
crate
tempdir
;
use
gstreamer_app_sys
::
*
;
use
std
::
env
;
use
std
::
error
::
Error
;
use
std
::
path
::
Path
;
use
std
::
mem
::{
align_of
,
size_of
};
use
std
::
path
::
Path
;
use
std
::
process
::
Command
;
use
std
::
str
;
use
gstreamer_app_sys
::
*
;
static
PACKAGES
:
&
[
&
str
]
=
&
[
"gstreamer-app-1.0"
];
...
...
@@ -47,8 +47,7 @@ impl Compiler {
cmd
.arg
(
out
);
let
status
=
cmd
.spawn
()
?
.wait
()
?
;
if
!
status
.success
()
{
return
Err
(
format!
(
"compilation command {:?} failed, {}"
,
&
cmd
,
status
)
.into
());
return
Err
(
format!
(
"compilation command {:?} failed, {}"
,
&
cmd
,
status
)
.into
());
}
Ok
(())
}
...
...
@@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
cmd
.args
(
packages
);
let
out
=
cmd
.output
()
?
;
if
!
out
.status
.success
()
{
return
Err
(
format!
(
"command {:?} returned {}"
,
&
cmd
,
out
.status
)
.into
());
return
Err
(
format!
(
"command {:?} returned {}"
,
&
cmd
,
out
.status
)
.into
());
}
let
stdout
=
str
::
from_utf8
(
&
out
.stdout
)
?
;
Ok
(
shell_words
::
split
(
stdout
.trim
())
?
)
}
#[derive(Copy,
Clone,
Debug,
Eq,
PartialEq)]
struct
Layout
{
size
:
usize
,
...
...
@@ -115,9 +112,8 @@ impl Results {
fn
summary
(
&
self
)
->
String
{
format!
(
"{} passed; {} failed (compilation errors: {})"
,
self
.passed
,
self
.failed
,
self
.failed_to_compile
)
self
.passed
,
self
.failed
,
self
.failed_to_compile
)
}
fn
expect_total_success
(
&
self
)
{
if
self
.failed
==
0
{
...
...
@@ -133,24 +129,28 @@ fn cross_validate_constants_with_c() {
let
tmpdir
=
tempdir
::
TempDir
::
new
(
"abi"
)
.expect
(
"temporary directory"
);
let
cc
=
Compiler
::
new
()
.expect
(
"configured compiler"
);
assert_eq!
(
"1"
,
get_c_value
(
tmpdir
.path
(),
&
cc
,
"1"
)
.expect
(
"C constant"
),
"failed to obtain correct constant value for 1"
);
assert_eq!
(
"1"
,
get_c_value
(
tmpdir
.path
(),
&
cc
,
"1"
)
.expect
(
"C constant"
),
"failed to obtain correct constant value for 1"
);
let
mut
results
:
Results
=
Default
::
default
();
let
mut
results
:
Results
=
Default
::
default
();
for
(
i
,
&
(
name
,
rust_value
))
in
RUST_CONSTANTS
.iter
()
.enumerate
()
{
match
get_c_value
(
tmpdir
.path
(),
&
cc
,
name
)
{
Err
(
e
)
=>
{
results
.record_failed_to_compile
();
eprintln!
(
"{}"
,
e
);
}
,
}
Ok
(
ref
c_value
)
=>
{
if
rust_value
==
c_value
{
results
.record_passed
();
}
else
{
results
.record_failed
();
eprintln!
(
"Constant value mismatch for {}
\n
Rust: {:?}
\n
C: {:?}"
,
name
,
rust_value
,
c_value
);
eprintln!
(
"Constant value mismatch for {}
\n
Rust: {:?}
\n
C: {:?}"
,
name
,
rust_value
,
c_value
);
}
}
};
...
...
@@ -166,24 +166,31 @@ fn cross_validate_layout_with_c() {
let
tmpdir
=
tempdir
::
TempDir
::
new
(
"abi"
)
.expect
(
"temporary directory"
);
let
cc
=
Compiler
::
new
()
.expect
(
"configured compiler"
);
assert_eq!
(
Layout
{
size
:
1
,
alignment
:
1
},
get_c_layout
(
tmpdir
.path
(),
&
cc
,
"char"
)
.expect
(
"C layout"
),
"failed to obtain correct layout for char type"
);
assert_eq!
(
Layout
{
size
:
1
,
alignment
:
1
},
get_c_layout
(
tmpdir
.path
(),
&
cc
,
"char"
)
.expect
(
"C layout"
),
"failed to obtain correct layout for char type"
);
let
mut
results
:
Results
=
Default
::
default
();
let
mut
results
:
Results
=
Default
::
default
();
for
(
i
,
&
(
name
,
rust_layout
))
in
RUST_LAYOUTS
.iter
()
.enumerate
()
{
match
get_c_layout
(
tmpdir
.path
(),
&
cc
,
name
)
{
Err
(
e
)
=>
{
results
.record_failed_to_compile
();
eprintln!
(
"{}"
,
e
);
}
,
}
Ok
(
c_layout
)
=>
{
if
rust_layout
==
c_layout
{
results
.record_passed
();
}
else
{
results
.record_failed
();
eprintln!
(
"Layout mismatch for {}
\n
Rust: {:?}
\n
C: {:?}"
,
name
,
rust_layout
,
&
c_layout
);
eprintln!
(
"Layout mismatch for {}
\n
Rust: {:?}
\n
C: {:?}"
,
name
,
rust_layout
,
&
c_layout
);
}
}
};
...
...
@@ -203,15 +210,14 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
let
mut
abi_cmd
=
Command
::
new
(
exe
);
let
output
=
abi_cmd
.output
()
?
;
if
!
output
.status
.success
()
{
return
Err
(
format!
(
"command {:?} failed, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
return
Err
(
format!
(
"command {:?} failed, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
}
let
stdout
=
str
::
from_utf8
(
&
output
.stdout
)
?
;
let
mut
words
=
stdout
.trim
()
.split_whitespace
();
let
size
=
words
.next
()
.unwrap
()
.parse
()
.unwrap
();
let
alignment
=
words
.next
()
.unwrap
()
.parse
()
.unwrap
();
Ok
(
Layout
{
size
,
alignment
})
Ok
(
Layout
{
size
,
alignment
})
}
fn
get_c_value
(
dir
:
&
Path
,
cc
:
&
Compiler
,
name
:
&
str
)
->
Result
<
String
,
Box
<
Error
>>
{
...
...
@@ -223,28 +229,71 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
let
mut
abi_cmd
=
Command
::
new
(
exe
);
let
output
=
abi_cmd
.output
()
?
;
if
!
output
.status
.success
()
{
return
Err
(
format!
(
"command {:?} failed, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
return
Err
(
format!
(
"command {:?} failed, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
}
let
output
=
str
::
from_utf8
(
&
output
.stdout
)
?
.trim
();
if
!
output
.starts_with
(
"###gir test###"
)
||
!
output
.ends_with
(
"###gir test###"
)
{
return
Err
(
format!
(
"command {:?} return invalid output, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
if
!
output
.starts_with
(
"###gir test###"
)
||
!
output
.ends_with
(
"###gir test###"
)
{
return
Err
(
format!
(
"command {:?} return invalid output, {:?}"
,
&
abi_cmd
,
&
output
)
.into
());
}
Ok
(
String
::
from
(
&
output
[
14
..
(
output
.len
()
-
14
)]))
}
const
RUST_LAYOUTS
:
&
[(
&
str
,
Layout
)]
=
&
[
(
"GstAppSink"
,
Layout
{
size
:
size_of
::
<
GstAppSink
>
(),
alignment
:
align_of
::
<
GstAppSink
>
()}),
(
"GstAppSinkCallbacks"
,
Layout
{
size
:
size_of
::
<
GstAppSinkCallbacks
>
(),
alignment
:
align_of
::
<
GstAppSinkCallbacks
>
()}),
(
"GstAppSinkClass"
,
Layout
{
size
:
size_of
::
<
GstAppSinkClass
>
(),
alignment
:
align_of
::
<
GstAppSinkClass
>
()}),
(
"GstAppSrc"
,
Layout
{
size
:
size_of
::
<
GstAppSrc
>
(),
alignment
:
align_of
::
<
GstAppSrc
>
()}),
(
"GstAppSrcCallbacks"
,
Layout
{
size
:
size_of
::
<
GstAppSrcCallbacks
>
(),
alignment
:
align_of
::
<
GstAppSrcCallbacks
>
()}),
(
"GstAppSrcClass"
,
Layout
{
size
:
size_of
::
<
GstAppSrcClass
>
(),
alignment
:
align_of
::
<
GstAppSrcClass
>
()}),
(
"GstAppStreamType"
,
Layout
{
size
:
size_of
::
<
GstAppStreamType
>
(),
alignment
:
align_of
::
<
GstAppStreamType
>
()}),
(
"GstAppSink"
,
Layout
{
size
:
size_of
::
<
GstAppSink
>
(),
alignment
:
align_of
::
<
GstAppSink
>
(),
},
),
(
"GstAppSinkCallbacks"
,
Layout
{
size
:
size_of
::
<
GstAppSinkCallbacks
>
(),
alignment
:
align_of
::
<
GstAppSinkCallbacks
>
(),
},
),
(
"GstAppSinkClass"
,
Layout
{
size
:
size_of
::
<
GstAppSinkClass
>
(),
alignment
:
align_of
::
<
GstAppSinkClass
>
(),
},
),
(
"GstAppSrc"
,
Layout
{
size
:
size_of
::
<
GstAppSrc
>
(),
alignment
:
align_of
::
<
GstAppSrc
>
(),
},
),
(
"GstAppSrcCallbacks"
,
Layout
{
size
:
size_of
::
<
GstAppSrcCallbacks
>
(),
alignment
:
align_of
::
<
GstAppSrcCallbacks
>
(),
},
),
(
"GstAppSrcClass"
,
Layout
{
size
:
size_of
::
<
GstAppSrcClass
>
(),
alignment
:
align_of
::
<
GstAppSrcClass
>
(),
},
),
(
"GstAppStreamType"
,
Layout
{
size
:
size_of
::
<
GstAppStreamType
>
(),
alignment
:
align_of
::
<
GstAppStreamType
>
(),
},
),
];
const
RUST_CONSTANTS
:
&
[(
&
str
,
&
str
)]
=
&
[
...
...
@@ -252,5 +301,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
(
"(gint) GST_APP_STREAM_TYPE_SEEKABLE"
,
"1"
),
(
"(gint) GST_APP_STREAM_TYPE_STREAM"
,
"0"
),
];
gstreamer-audio-sys/build.rs
View file @
be0f64ce
...
...
@@ -6,8 +6,8 @@ extern crate pkg_config;
use
pkg_config
::{
Config
,
Error
};
use
std
::
env
;
use
std
::
io
::
prelude
::
*
;
use
std
::
io
;
use
std
::
io
::
prelude
::
*
;
use
std
::
process
;
fn
main
()
{
...
...
@@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
println!
(
"cargo:rustc-link-search=native={}"
,
lib_dir
);
return
Ok
(())
return
Ok
(())
;
}
let
target
=
env
::
var
(
"TARGET"
)
.expect
(
"TARGET environment variable doesn't exist"
);
...
...
@@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
for
path
in
library
.link_paths
.iter
()
{
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
));
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
)
);
}
}
Ok
(())
...
...
@@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
Err
(
err
)
=>
Err
(
err
),
}
}
gstreamer-audio-sys/src/lib.rs
View file @
be0f64ce
This diff is collapsed.
Click to expand it.
gstreamer-audio-sys/tests/abi.rs
View file @
be0f64ce
This diff is collapsed.
Click to expand it.
gstreamer-base-sys/build.rs
View file @
be0f64ce
...
...
@@ -6,8 +6,8 @@ extern crate pkg_config;
use
pkg_config
::{
Config
,
Error
};
use
std
::
env
;
use
std
::
io
::
prelude
::
*
;
use
std
::
io
;
use
std
::
io
::
prelude
::
*
;
use
std
::
process
;
fn
main
()
{
...
...
@@ -56,7 +56,7 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
println!
(
"cargo:rustc-link-search=native={}"
,
lib_dir
);
return
Ok
(())
return
Ok
(())
;
}
let
target
=
env
::
var
(
"TARGET"
)
.expect
(
"TARGET environment variable doesn't exist"
);
...
...
@@ -78,8 +78,10 @@ fn find() -> Result<(), Error> {
println!
(
"cargo:rustc-link-lib=dylib={}"
,
lib_
);
}
for
path
in
library
.link_paths
.iter
()
{
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
));
println!
(
"cargo:rustc-link-search=native={}"
,
path
.to_str
()
.expect
(
"library path doesn't exist"
)
);
}
}
Ok
(())
...
...
@@ -93,4 +95,3 @@ fn find() -> Result<(), Error> {
Err
(
err
)
=>
Err
(
err
),
}
}
gstreamer-base-sys/src/lib.rs
View file @
be0f64ce
This diff is collapsed.
Click to expand it.
gstreamer-base-sys/tests/abi.rs
View file @
be0f64ce
...
...
@@ -5,13 +5,13 @@
extern
crate
gstreamer_base_sys
;
extern
crate
shell_words
;
extern
crate
tempdir
;
use
gstreamer_base_sys
::
*
;
use
std
::
env
;
use
std
::
error
::
Error
;
use
std
::
path
::
Path
;
use
std
::
mem
::{
align_of
,
size_of
};
use
std
::
path
::
Path
;
use
std
::
process
::
Command
;
use
std
::
str
;
use
gstreamer_base_sys
::
*
;
static
PACKAGES
:
&
[
&
str
]
=
&
[
"gstreamer-base-1.0"
];
...
...
@@ -47,8 +47,7 @@ impl Compiler {
cmd
.arg
(
out
);
let
status
=
cmd
.spawn
()
?
.wait
()
?
;