Giter Site home page Giter Site logo

Comments (3)

Gnurou avatar Gnurou commented on August 20, 2024

Ah indeed this doesn't look right. Is there anything that prevents us from processing all the NALUs sequentially instead of looking for a SPS first?

Or would it help if we made decode return the number of bytes processed in the input, so the caller knows they need to call it again in case it returned without processing all the stream (which would happen if we e.g. have a SPS in the middle like your example)?

from cros-codecs.

dwlsalmeida avatar dwlsalmeida commented on August 20, 2024

Ah indeed this doesn't look right. Is there anything that prevents us from processing all the NALUs sequentially instead of looking for a SPS first?

I don't think so, in fact this is what Chromium and GStreamer do. That is, they parse the NALUs in order, and if they see a SPS, they will renegotiate.

If, for whatever reason, someone sends <slice>, <sps>, <pps> this will return an error though.

I think it is more sane if we just let it error out though, as I do not think it is sane for any stream to contain slice data before its respective SPS and PPS are parsed anyways, in which case we can get rid of peek_sps altogether.

Or would it help if we made decode return the number of bytes processed in the input, so the caller knows they need to call it again in case it returned without processing all the stream (which would happen if we e.g. have a SPS in the middle like your example)?

Even if we remove peek_sps() altogether, we still need to implement the above somehow, see #35.

My original idea was to return the current offset in DecodingState::AwaitingFormat, but returning it from decode() does make more sense indeed.

from cros-codecs.

dwlsalmeida avatar dwlsalmeida commented on August 20, 2024

This is fixed by #37

We now process each NAL by itself and if a SPS is not available when one is needed we reject the stream.

from cros-codecs.

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.