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
GStreamer
gst-plugins-rs
Commits
1260dc42
Commit
1260dc42
authored
Sep 24, 2017
by
Sebastian Dröge
🍵
Browse files
Port sink over to new infrastructure
parent
6e1c89d1
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
gst-plugin-file/src/filesink.rs
View file @
1260dc42
...
...
@@ -32,7 +32,7 @@ pub struct FileSink {
}
impl
FileSink
{
pub
fn
new
(
_sink
:
&
RsSink
Wrapper
)
->
FileSink
{
pub
fn
new
(
_sink
:
&
Rs
Base
Sink
)
->
FileSink
{
FileSink
{
streaming_state
:
StreamingState
::
Stopped
,
cat
:
gst
::
DebugCategory
::
new
(
...
...
@@ -43,7 +43,7 @@ impl FileSink {
}
}
pub
fn
new_boxed
(
sink
:
&
RsSink
Wrapper
)
->
Box
<
Sink
>
{
pub
fn
new_boxed
(
sink
:
&
Rs
Base
Sink
)
->
Box
<
Sink
Impl
>
{
Box
::
new
(
FileSink
::
new
(
sink
))
}
}
...
...
@@ -58,12 +58,12 @@ fn validate_uri(uri: &Url) -> Result<(), UriError> {
Ok
(())
}
impl
Sink
for
FileSink
{
impl
Sink
Impl
for
FileSink
{
fn
uri_validator
(
&
self
)
->
Box
<
UriValidator
>
{
Box
::
new
(
validate_uri
)
}
fn
start
(
&
mut
self
,
sink
:
&
RsSink
Wrapper
,
uri
:
Url
)
->
Result
<
(),
ErrorMessage
>
{
fn
start
(
&
mut
self
,
sink
:
&
Rs
Base
Sink
,
uri
:
Url
)
->
Result
<
(),
ErrorMessage
>
{
if
let
StreamingState
::
Started
{
..
}
=
self
.streaming_state
{
return
Err
(
error_msg!
(
gst
::
LibraryError
::
Failed
,
...
...
@@ -112,13 +112,13 @@ impl Sink for FileSink {
Ok
(())
}
fn
stop
(
&
mut
self
,
_sink
:
&
RsSink
Wrapper
)
->
Result
<
(),
ErrorMessage
>
{
fn
stop
(
&
mut
self
,
_sink
:
&
Rs
Base
Sink
)
->
Result
<
(),
ErrorMessage
>
{
self
.streaming_state
=
StreamingState
::
Stopped
;
Ok
(())
}
fn
render
(
&
mut
self
,
sink
:
&
RsSink
Wrapper
,
buffer
:
&
gst
::
BufferRef
)
->
Result
<
(),
FlowError
>
{
fn
render
(
&
mut
self
,
sink
:
&
Rs
Base
Sink
,
buffer
:
&
gst
::
BufferRef
)
->
Result
<
(),
FlowError
>
{
let
cat
=
self
.cat
;
let
streaming_state
=
&
mut
self
.streaming_state
;
...
...
gst-plugin/src/sink.rs
View file @
1260dc42
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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