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
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zeeshan Ali
gstreamer-rs
Commits
7207bbed
Commit
7207bbed
authored
Oct 28, 2018
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add various global functions to the pbutils library
parent
0947c8f0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
0 deletions
+197
-0
Gir_GstPbutils.toml
Gir_GstPbutils.toml
+52
-0
gstreamer-pbutils/src/auto/functions.rs
gstreamer-pbutils/src/auto/functions.rs
+65
-0
gstreamer-pbutils/src/auto/mod.rs
gstreamer-pbutils/src/auto/mod.rs
+2
-0
gstreamer-pbutils/src/functions.rs
gstreamer-pbutils/src/functions.rs
+72
-0
gstreamer-pbutils/src/lib.rs
gstreamer-pbutils/src/lib.rs
+6
-0
No files found.
Gir_GstPbutils.toml
View file @
7207bbed
...
...
@@ -234,3 +234,55 @@ trait = false
pattern
=
"set_.*"
ignore
=
true
[[object]]
name
=
"GstPbutils.*"
status
=
"generate"
# We'll opt-in for constants at a later time
[[object.constant]]
pattern
=
".+"
ignore
=
true
# Codec utils need some special care
[[object.function]]
pattern
=
"codec_utils.*"
ignore
=
true
# Plugin installer API needs some manual impls
[[object.function]]
pattern
=
"install_plugins.*"
ignore
=
true
# Plugin installer API needs some manual impls
[[object.function]]
pattern
=
"missing_.*"
ignore
=
true
# Plugin installer API needs some manual impls
[[object.function]]
name
=
"is_missing_plugin_message"
ignore
=
true
# Initialization is handled implicitely
[[object.function]]
name
=
"pb_utils_init"
ignore
=
true
# Needs special handling for mutable taglists
[[object.function]]
name
=
"pb_utils_add_codec_description_to_tag_list"
ignore
=
true
# Needs special handling for caps refs
[[object.function]]
name
=
"pb_utils_get_codec_description"
ignore
=
true
# Needs special handling for caps refs
[[object.function]]
name
=
"pb_utils_get_decoder_description"
ignore
=
true
# Needs special handling for caps refs
[[object.function]]
name
=
"pb_utils_get_encoder_description"
ignore
=
true
gstreamer-pbutils/src/auto/functions.rs
0 → 100644
View file @
7207bbed
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use
EncodingTarget
;
use
ffi
;
use
glib
::
translate
::
*
;
use
std
::
mem
;
pub
fn
encoding_list_all_targets
<
'a
,
P
:
Into
<
Option
<&
'a
str
>>>
(
categoryname
:
P
)
->
Vec
<
EncodingTarget
>
{
assert_initialized_main_thread!
();
let
categoryname
=
categoryname
.into
();
let
categoryname
=
categoryname
.to_glib_none
();
unsafe
{
FromGlibPtrContainer
::
from_glib_full
(
ffi
::
gst_encoding_list_all_targets
(
categoryname
.0
))
}
}
pub
fn
encoding_list_available_categories
()
->
Vec
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
FromGlibPtrContainer
::
from_glib_full
(
ffi
::
gst_encoding_list_available_categories
())
}
}
pub
fn
pb_utils_get_element_description
(
factory_name
:
&
str
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_element_description
(
factory_name
.to_glib_none
()
.0
))
}
}
pub
fn
pb_utils_get_sink_description
(
protocol
:
&
str
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_sink_description
(
protocol
.to_glib_none
()
.0
))
}
}
pub
fn
pb_utils_get_source_description
(
protocol
:
&
str
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_source_description
(
protocol
.to_glib_none
()
.0
))
}
}
pub
fn
plugins_base_version
()
->
(
u32
,
u32
,
u32
,
u32
)
{
assert_initialized_main_thread!
();
unsafe
{
let
mut
major
=
mem
::
uninitialized
();
let
mut
minor
=
mem
::
uninitialized
();
let
mut
micro
=
mem
::
uninitialized
();
let
mut
nano
=
mem
::
uninitialized
();
ffi
::
gst_plugins_base_version
(
&
mut
major
,
&
mut
minor
,
&
mut
micro
,
&
mut
nano
);
(
major
,
minor
,
micro
,
nano
)
}
}
pub
fn
plugins_base_version_string
()
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_plugins_base_version_string
())
}
}
gstreamer-pbutils/src/auto/mod.rs
View file @
7207bbed
...
...
@@ -49,6 +49,8 @@ pub use self::enums::DiscovererResult;
mod
flags
;
pub
use
self
::
flags
::
DiscovererSerializeFlags
;
pub
mod
functions
;
#[doc(hidden)]
pub
mod
traits
{
pub
use
super
::
DiscovererInfoExt
;
...
...
gstreamer-pbutils/src/functions.rs
0 → 100644
View file @
7207bbed
// Copyright (C) 2018 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
;
use
glib
::
translate
::
*
;
use
gst
;
use
gst
::
MiniObject
;
use
std
::
ptr
;
pub
unsafe
trait
CodecTag
<
'a
>
:
gst
::
Tag
<
'a
,
TagType
=
&
'a
str
>
{}
unsafe
impl
<
'a
>
CodecTag
<
'a
>
for
gst
::
tags
::
ContainerFormat
{}
unsafe
impl
<
'a
>
CodecTag
<
'a
>
for
gst
::
tags
::
AudioCodec
{}
unsafe
impl
<
'a
>
CodecTag
<
'a
>
for
gst
::
tags
::
VideoCodec
{}
unsafe
impl
<
'a
>
CodecTag
<
'a
>
for
gst
::
tags
::
SubtitleCodec
{}
unsafe
impl
<
'a
>
CodecTag
<
'a
>
for
gst
::
tags
::
Codec
{}
pub
fn
pb_utils_add_codec_description_to_tag_list_for_tag
<
'a
,
T
:
CodecTag
<
'a
>>
(
taglist
:
&
mut
gst
::
TagListRef
,
caps
:
&
gst
::
CapsRef
,
)
->
Result
<
(),
glib
::
BoolError
>
{
assert_initialized_main_thread!
();
let
codec_tag
=
T
::
tag_name
();
unsafe
{
glib
::
BoolError
::
from_glib
(
ffi
::
gst_pb_utils_add_codec_description_to_tag_list
(
taglist
.as_mut_ptr
(),
codec_tag
.to_glib_none
()
.0
,
caps
.as_ptr
(),
),
"Failed to find codec description"
,
)
}
}
pub
fn
pb_utils_add_codec_description_to_tag_list
(
taglist
:
&
mut
gst
::
TagListRef
,
caps
:
&
gst
::
CapsRef
,
)
->
Result
<
(),
glib
::
BoolError
>
{
assert_initialized_main_thread!
();
unsafe
{
glib
::
BoolError
::
from_glib
(
ffi
::
gst_pb_utils_add_codec_description_to_tag_list
(
taglist
.as_mut_ptr
(),
ptr
::
null_mut
(),
caps
.as_ptr
(),
),
"Failed to find codec description"
,
)
}
}
pub
fn
pb_utils_get_encoder_description
(
caps
:
&
gst
::
CapsRef
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_encoder_description
(
caps
.as_ptr
()))
}
}
pub
fn
pb_utils_get_decoder_description
(
caps
:
&
gst
::
CapsRef
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_decoder_description
(
caps
.as_ptr
()))
}
}
pub
fn
pb_utils_get_codec_description
(
caps
:
&
gst
::
CapsRef
)
->
Option
<
String
>
{
assert_initialized_main_thread!
();
unsafe
{
from_glib_full
(
ffi
::
gst_pb_utils_get_codec_description
(
caps
.as_ptr
()))
}
}
gstreamer-pbutils/src/lib.rs
View file @
7207bbed
...
...
@@ -45,6 +45,7 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[cfg_attr(feature
=
"cargo-clippy"
,
allow(match_same_arms))]
#[cfg_attr(feature
=
"cargo-clippy"
,
allow(type_complexity))]
mod
auto
;
pub
use
auto
::
functions
::
*
;
pub
use
auto
::
*
;
mod
discoverer
;
...
...
@@ -58,6 +59,9 @@ pub use discoverer_video_info::*;
mod
encoding_profile
;
pub
use
encoding_profile
::
*
;
pub
mod
functions
;
pub
use
functions
::
*
;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts
pub
mod
prelude
{
...
...
@@ -66,4 +70,6 @@ pub mod prelude {
pub
use
auto
::
traits
::
*
;
pub
use
encoding_profile
::
EncodingProfileBuilder
;
pub
use
functions
::
CodecTag
;
}
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