Data processing and downstream events
Data parsing, pulling this into subbuffers and sending that to the
source pads of the elementary streams is the one single most
important task of demuxers and parsers. Usually, an element will
have a _loop () function using the
bytestream object to read data. Try to have
a single point of data reading from the bytestream object. In this
single point, do proper event handling (in
case there is any) and proper error handling
in case that's needed. Make your element as fault-tolerant as
possible, but do not go further than possible.