Coder Social home page Coder Social logo

Comments (18)

pabuhler avatar pabuhler commented on August 26, 2024 1

ok, then I will make the change and we can see if any one reviews it :)

from libsrtp.

saghul avatar saghul commented on August 26, 2024

It's defined on srtp_priv.h, so not totally opaque ;-) You can include that file and you have access to the structure members.

from libsrtp.

ibc avatar ibc commented on August 26, 2024

The doc clearly says that srtp_stream_t is an opaque field and thus I cannot rely (or should not rely) on a non public API file (srtp_priv.h).

from libsrtp.

saghul avatar saghul commented on August 26, 2024

You only live once :-)
On Aug 22, 2014 1:51 PM, "Iñaki Baz Castillo" [email protected]
wrote:

The doc clearly says that srtp_stream_t is an opaque field and thus I
cannot rely (or should not rely) on a non public API file (srtp_priv.h).


Reply to this email directly or view it on GitHub
#67 (comment).

from libsrtp.

jfigus avatar jfigus commented on August 26, 2024

My guess is this is just an oversight by the person that added the event handler API. There's probably no way to address this without significant changes to the API. I've shared my opinion on another thread recently, we may want to look at a major uplift to the API and bump the major from 1 to 2. This will break backwards compatibility, but it'll allow us to clean up these opacity issues.

from libsrtp.

ibc avatar ibc commented on August 26, 2024

Agreed.

from libsrtp.

jfigus avatar jfigus commented on August 26, 2024

Closing issue due to inactivity

from libsrtp.

ibc avatar ibc commented on August 26, 2024

Inactivity? :)
I think the bug was properly reported and no more action was needed (but just a proper fix/implementation). I expected this to be done in the announced future new API design.

from libsrtp.

jfigus avatar jfigus commented on August 26, 2024

This issue is tagged as a "question", not a "bug". Since the most recent discussion was October 9, it looked inactive to me.

from libsrtp.

pabuhler avatar pabuhler commented on August 26, 2024

Looks like this was missed in the move to 2.0, this is a shame I think it will be a long time to 3.0 .
One option would be make a new api in 2.1 and depreciate the old api, removing it in 3.0
The fix would be to swap the srtp_stream_t argument with uint32_t SSRC.
I wounder how many users are actually using this API.

from libsrtp.

ibc avatar ibc commented on August 26, 2024

I wounder how many users are actually using this API.

Probably no one (other than for logging purposes) as such a current API is of very little use.

from libsrtp.

pabuhler avatar pabuhler commented on August 26, 2024

So then the question is if we can just change the srtp_stream_t argument to be a uintptr_t, and set it to the SSRC in version 2.1 Changing it to be uint32_t in 3.0 .

from libsrtp.

ibc avatar ibc commented on August 26, 2024

Same SSRC may happen many times in different SRTP contexts/sessions. I expect the associated session should be given within the callback.

from libsrtp.

pabuhler avatar pabuhler commented on August 26, 2024

in 2.0 the event data signature is

typedef struct srtp_event_data_t {
  srtp_t        session;  /**< The session in which the event happend. */
  srtp_stream_t stream;   /**< The stream in which the event happend.  */
  srtp_event_t  event;

so changing it to

typedef struct srtp_event_data_t {
  srtp_t        session;  /**< The session in which the event happend. */
  uintptr_t    ssrc;       /**< The stream in which the event happend.  */
  srtp_event_t  event;

should be ok, and then you can map it to you application, or?

from libsrtp.

ibc avatar ibc commented on August 26, 2024

You are right.

from libsrtp.

paulej avatar paulej commented on August 26, 2024

I looked at the code. My question: what is the reason for changing "srtp_stream_t stream;" when "srtp_t session;" is also present? It's also a typedef in srtp.h, with the actual type defined in srtp_priv.h. What am I missing?

from libsrtp.

ibc avatar ibc commented on August 26, 2024

It happens that srtp_priv.h is supposed to be private API, and we cannot rely on it.

from libsrtp.

pabuhler avatar pabuhler commented on August 26, 2024

srtp_t session is still opaque but it is used as the first argument to a few of the srtp_xxxx functions. It is also possible for the receiver of the callback to map back to which session the event happened on. With srtp_stream_t it is not possible to use it for anything, not even finding out the SSRC that generated the event. the combination of srtp_t and SSRC should give the user enough context to be able to handle the event.

from libsrtp.

Related Issues (20)

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.