Giter VIP home page Giter VIP logo

rtsp-server's People

Contributors

jh-hsd avatar sdroege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtsp-server's Issues

Can't implement client::Client while proxying to basic_client::Client

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.

Refactor simple_server media into API

  • appsink/appsrc helpers should be separate API
  • Have some kind of "gst-launch" style media factory / media
  • Also API for explicit pipelines
  • SDP<->caps conversion API (and should probably implement SDP builders, see issue in sdp_types crate)

Add application API

  • server::Server should get API for listing clients, sessions, etc. and getting information from them, terminating them, etc
  • Media, factory, client, specific API in the same style

Work around broken GStreamer RTSP 2.0 Transport/RTP-Info handling

Check the user agent version and if old enough use RTSP 1.0 Transport/RTP-Info instead.

See

// TODO: Convert 1.0/2.0 transports for UDP by splitting/combining IP:port and
// the separate fields
and
// FIXME: GStreamer wants 1.0 RTP-Info for RTSP 2.0...

Related GStreamer bugs:

Implement Server -> Client TEARDOWN

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.

Cargo Dependency: rtsp-types default branch

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 :)

Digest authentication support (HTTP)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.