Comments (3)
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.
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.
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)
- Can't iterate over ReadyFramesQueue<T> without consuming it
- Remove unwraps and other runtime panics that result from invalid input HOT 1
- Limit use of anyhow HOT 2
- av1: max for secondary strength looks incorrect HOT 2
- encoder: Enable zero copy
- decoder/h264: support streams for which num_slice_groups_minus1 > 0
- Feature: V4L2 stateless decoder support
- Feature: device discovery
- Feature: stateful decoder interface
- Consider moving codec parsers to separate crate HOT 3
- `StatelessVideoDecoder` implementations for `StatelessDecoder` can be factorized?
- `codec` module should never panic under any condition
- Possible typo in AV1 synthetizer HOT 1
- H.264/5: confirm `visible_rectangle`'s semantics
- Get reference to decoded frame from `StatelessVideoDecoder`
- decoder/stateless: backends should check the number of available output buffers, if needed.
- decoder/stateless: `parser` should be moved outside of the decoder state struct
- decoder/stateless/h265: output buffers computation does not look correct
- decoder/stateless/h265: VPSes are apparently never used
- Releasing a new version with encoders HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cros-codecs.