sdroege / rtsp-server Goto Github PK
View Code? Open in Web Editor NEWRTSP Server Library
License: Mozilla Public License 2.0
RTSP Server Library
License: Mozilla Public License 2.0
<slomo>
the problem is that it is only binding later when you actually start the server, so at that point it can't yet know. i wonder how actix does that. maybe something to steal an idea from.
See
rtsp-server/examples/simple_server.rs
Line 717 in 445f1b4
I tried to implement handle_request
on the client::Client
like this:
use std::pin::Pin;
use futures::prelude::*;
#[derive(Debug)]
pub struct Client {
basic_client: rtsp_server::client::basic_client::Client,
}
impl Default for Client {
fn default() -> Self {
Client {
basic_client: rtsp_server::client::basic_client::Client::default(),
}
}
}
impl rtsp_server::client::Client for Client {
fn handle_request(
&mut self,
ctx: &mut rtsp_server::client::Context<Self>,
request: rtsp_server::client::OriginalRequest,
) -> Pin<
Box<
dyn Future<
Output = Result<
rtsp_types::Response<rtsp_server::body::Body>,
rtsp_server::error::Error
>
> + Send
>
> {
self.basic_client.handle_request(ctx, request)
}
}
But this fails with:
error[E0308]: mismatched types
--> src/client/mod.rs:32:42
|
32 | self.basic_client.handle_request(ctx, request)
| ^^^ expected struct `rtsp_server::client::basic_client::Client`, found struct `client::Client`
|
= note: expected mutable reference `&mut rtsp_server::client::Context<rtsp_server::client::basic_client::Client>`
found mutable reference `&mut rtsp_server::client::Context<client::Client>`
I tried to implement a From
trait for the clients, but that didn't work either. The workaround is to simply copy basic_client and change whatever you need to.
See
rtsp-server/src/listener/message_socket.rs
Line 177 in 445f1b4
Should also ideally make use of vectored writes.
appsink
/appsrc
helpers should be separate APIsdp_types
crate)See
rtsp-server/src/client/basic_client/mod.rs
Lines 420 to 421 in 445f1b4
server::Server
should get API for listing clients, sessions, etc. and getting information from them, terminating them, etcSee
rtsp-server/src/stream_handler.rs
Lines 91 to 92 in 445f1b4
Check the user agent version and if old enough use RTSP 1.0 Transport/RTP-Info instead.
See
rtsp-server/src/client/basic_client/mod.rs
Lines 420 to 421 in 445f1b4
rtsp-server/src/client/basic_client/mod.rs
Line 546 in 445f1b4
Related GStreamer bugs:
Maybe via specific error types for those error codes
Requires adding Terminate-Reason
support to rtsp-types
and then adding some API here to make use of it, and also do that automatically in basic_client
and other places where it makes sense to kick out the client.
See
rtsp-server/src/client/task.rs
Line 155 in 445f1b4
I tried to build the rtsp-server with an older cargo version, but it fails because the default branch of the dependency rtsp-types was changed to 'main'. In older Cargo Versions, Cargo tries to pull repos with the default branch master which does not exist anymore.
This can easily be fixed by changing line 18 in Cargo.toml
to:
rtsp-types = { git = "https://github.com/sdroege/rtps-types.git", branch = "main" }
I would be very pleased, if this will be fixed. Thx :)
See
rtsp-server/src/client/task.rs
Line 422 in 445f1b4
rtsp-server/src/client/task.rs
Line 584 in 445f1b4
rtsp-server/src/client/context.rs
Line 618 in 445f1b4
Hello, I did not have time to read the server yet. I used in my client the message_socket.rs code you pointed me, very good.
I just made my client work with authentication (RTSP uses the same basic/digest scheme as HTTP). I implemented it myself as the ones I found in Rust were either tied to hyperx or not very good. Are there plans to include digest authentication in the server? I didn't see any crypto dependencies on your cargo.toml so I assume there's no digest authentication support. If you'd like to join forces to enhance mine, it would be nice. I just didn't release the code yet as I'm cleaning.
I just tested MD5, Sha2 and Sha512 with examples from RFC and it worked. I just tested on a real camera and it worked. Added some nice tests to it.
See
rtsp-server/examples/simple_server.rs
Lines 745 to 746 in 445f1b4
Also backpressure should generally be implemented better.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.