cros-codecs
cros-codecs copied to clipboard
decoder/stateless: `parser` should be moved outside of the decoder state struct
We often perform mutable calls to the state while holding a non-mutable reference to the parser (e.g. to pass SPS information). This is currently not allowed because the parser is part of the state.
Every decoder has both a parser and a state though, so if we move the parser out of the state structure and make it another type parameter of StatelessCodec, we should be able to perform these calls avoid save a few redundant calls to fetch the same data.