Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer-rs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zeeshan Ali
gstreamer-rs
Commits
cf9e8758
Commit
cf9e8758
authored
Aug 06, 2018
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Ord/PartialOrd on Seqnum
parent
58741b7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
gstreamer/src/event.rs
gstreamer/src/event.rs
+21
-0
No files found.
gstreamer/src/event.rs
View file @
cf9e8758
...
...
@@ -58,6 +58,27 @@ impl From<u32> for Seqnum {
}
}
impl
cmp
::
PartialOrd
for
Seqnum
{
fn
partial_cmp
(
&
self
,
other
:
&
Seqnum
)
->
Option
<
cmp
::
Ordering
>
{
Some
(
self
.cmp
(
other
))
}
}
impl
cmp
::
Ord
for
Seqnum
{
fn
cmp
(
&
self
,
other
:
&
Seqnum
)
->
cmp
::
Ordering
{
unsafe
{
let
ret
=
ffi
::
gst_util_seqnum_compare
(
self
.
0
,
other
.
0
);
if
ret
<
0
{
cmp
::
Ordering
::
Less
}
else
if
ret
>
0
{
cmp
::
Ordering
::
Greater
}
else
{
cmp
::
Ordering
::
Equal
}
}
}
}
#[derive(Debug,
Clone,
Copy,
Default,
PartialEq,
Eq)]
pub
struct
GroupId
(
pub
u32
);
pub
const
GROUP_ID_INVALID
:
GroupId
=
GroupId
(
0
);
...
...
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