Sorry for vague info,Here's full context(hopefully):
-> Yes,I am defining the struct Myself.
-> The types are defined like this by me:
type InputContext = ffmpeg_next::format::context::Input;
type VideoDecoder = ffmpeg_next::decoder::Video;
type Scaler = ffmpeg_next::software::scaling::Context;
type VideoFrame = ffmpeg_next::frame::Video;
-> Yup,I am using ffmpeg-next
-> i am pretty sure the InputContext,VideoScaler has types that does not implement the SEND trait.
-> ERRROS are below but too long i am pasting short version and full version of error below:
SHORT VERSION
1. `*mut AVFormatContext` cannot be shared between threads safely
within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut AVFormatContext`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
input.rs:13:12: required because it appears within the type `ffmpeg_next::format::context::Input`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
2. required by a bound introduced by this call [E0277]
lib.rs:809:23: original diagnostic
3. required because it's used within this closure [E0277]
lib.rs:809:23: original diagnostic
4. `*mut SwsContext` cannot be shared between threads safely
within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut SwsContext`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
context.rs:16:12: required because it appears within the type `ffmpeg_next::software::scaling::Context`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
5. `*mut SwsContext` cannot be sent between threads safely
within `ThreadVideoStream`, the trait `Send` is not implemented for `*mut SwsContext`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
context.rs:16:12: required because it appears within the type `ffmpeg_next::software::scaling::Context`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
6. `Rc<Destructor>` cannot be shared between threads safely
within `ThreadVideoStream`, the trait `Sync` is not implemented for `Rc<Destructor>`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
common.rs:11:12: required because it appears within the type `ffmpeg_next::format::context::common::Context`
input.rs:13:12: required because it appears within the type `ffmpeg_next::format::context::Input`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
7. `*mut AVCodecContext` cannot be shared between threads safely
within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut AVCodecContext`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
context.rs:13:12: required because it appears within the type `ffmpeg_next::codec::Context`
decoder.rs:9:12: required because it appears within the type `ffmpeg_next::decoder::Decoder`
opened.rs:9:12: required because it appears within the type `Opened`
video.rs:18:12: required because it appears within the type `ffmpeg_next::decoder::Video`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
8. `Rc<(dyn std::any::Any + 'static)>` cannot be shared between threads safely
within `ThreadVideoStream`, the trait `Sync` is not implemented for `Rc<(dyn std::any::Any + 'static)>`
required for `Arc<ThreadVideoStream>` to implement `Send` [E0277]
lib.rs:809:9: required by a bound introduced by this call
option.rs:600:10: required because it appears within the type `Option<Rc<(dyn std::any::Any + 'static)>>`
context.rs:13:12: required because it appears within the type `ffmpeg_next::codec::Context`
decoder.rs:9:12: required because it appears within the type `ffmpeg_next::decoder::Decoder`
opened.rs:9:12: required because it appears within the type `Opened`
video.rs:18:12: required because it appears within the type `ffmpeg_next::decoder::Video`
lib.rs:93:12: required because it appears within the type `ThreadVideoStream`
lib.rs:809:23: required because it's used within this closure
functions.rs:128:8: required by a bound in `spawn`
Full error
error[E0277]: `*mut AVFormatContext` cannot be shared between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `*mut AVFormatContext` cannot be shared between threads safely
|
= help: within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut AVFormatContext`
note: required because it appears within the type `ffmpeg_next::format::context::Input`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/format/context/input.rs:13:12
|
13 | pub struct Input {
| ^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `*mut SwsContext` cannot be shared between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `*mut SwsContext` cannot be shared between threads safely
|
= help: within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut SwsContext`
note: required because it appears within the type `ffmpeg_next::software::scaling::Context`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/software/scaling/context.rs:16:12
|
16 | pub struct Context {
| ^^^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `*mut SwsContext` cannot be sent between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `*mut SwsContext` cannot be sent between threads safely
|
= help: within `ThreadVideoStream`, the trait `Send` is not implemented for `*mut SwsContext`
note: required because it appears within the type `ffmpeg_next::software::scaling::Context`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/software/scaling/context.rs:16:12
|
16 | pub struct Context {
| ^^^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `Rc<Destructor>` cannot be shared between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `Rc<Destructor>` cannot be shared between threads safely
|
= help: within `ThreadVideoStream`, the trait `Sync` is not implemented for `Rc<Destructor>`
note: required because it appears within the type `ffmpeg_next::format::context::common::Context`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/format/context/common.rs:11:12
|
11 | pub struct Context {
| ^^^^^^^
note: required because it appears within the type `ffmpeg_next::format::context::Input`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/format/context/input.rs:13:12
|
13 | pub struct Input {
| ^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `*mut AVCodecContext` cannot be shared between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `*mut AVCodecContext` cannot be shared between threads safely
|
= help: within `ThreadVideoStream`, the trait `Sync` is not implemented for `*mut AVCodecContext`
note: required because it appears within the type `ffmpeg_next::codec::Context`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/context.rs:13:12
|
13 | pub struct Context {
| ^^^^^^^
note: required because it appears within the type `ffmpeg_next::decoder::Decoder`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/decoder.rs:9:12
|
9 | pub struct Decoder(pub Context);
| ^^^^^^^
note: required because it appears within the type `Opened`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/opened.rs:9:12
|
9 | pub struct Opened(pub Decoder);
| ^^^^^^
note: required because it appears within the type `ffmpeg_next::decoder::Video`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/video.rs:18:12
|
18 | pub struct Video(pub Opened);
| ^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `Rc<(dyn std::any::Any + 'static)>` cannot be shared between threads safely
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| _________-------------_^
| | |
| | required by a bound introduced by this call
810 | | App::send_framemeta(&mut first_stream, tx);
811 | | });
| |_________^ `Rc<(dyn std::any::Any + 'static)>` cannot be shared between threads safely
|
= help: within `ThreadVideoStream`, the trait `Sync` is not implemented for `Rc<(dyn std::any::Any + 'static)>`
note: required because it appears within the type `Option<Rc<(dyn std::any::Any + 'static)>>`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:600:10
|
600 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `ffmpeg_next::codec::Context`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/context.rs:13:12
|
13 | pub struct Context {
| ^^^^^^^
note: required because it appears within the type `ffmpeg_next::decoder::Decoder`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/decoder.rs:9:12
|
9 | pub struct Decoder(pub Context);
| ^^^^^^^
note: required because it appears within the type `Opened`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/opened.rs:9:12
|
9 | pub struct Opened(pub Decoder);
| ^^^^^^
note: required because it appears within the type `ffmpeg_next::decoder::Video`
--> /home/sudip/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ffmpeg-next-8.1.0/src/codec/decoder/video.rs:18:12
|
18 | pub struct Video(pub Opened);
| ^^^^^
note: required because it appears within the type `ThreadVideoStream`
--> src/lib.rs:93:12
|
93 | pub struct ThreadVideoStream {
| ^^^^^^^^^^^^^^^^^
= note: required for `Arc<ThreadVideoStream>` to implement `Send`
note: required because it's used within this closure
--> src/lib.rs:809:23
|
809 | thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /home/sudip/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8
|
125 | pub fn spawn<F, T>(f: F) -> JoinHandle<T>
| ----- required by a bound in this function
...
128 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `neo-kut` (lib) due to 6 previous errors