DescriptionUse MIDIMessageQueue/IsValidWebMIDIData for MIDI byte stream validation
WebMIDI spec draft: http://www.w3.org/TR/webmidi/
WebMIDI API guarantees that MIDIInput::onmessage is called back with a single MIDI message. To guarantee this, this CL introduces MIDIMessageQueue class, which allows you to
- maintain fragmented MIDI message.
- Skip any invalid data sequence.
- Reorder MIDI messages so that "System Real Time Message", which can be inserted at any point of the byte stream, can be placed at the boundary of complete MIDI messages.
- (Optional) Reconstruct complete MIDI messages from data stream that is compressed with "running status".
This CL also replaces existing System Exclusive message validation logic in MIDIHost::OnSendData with MIDIHost::IsValidWebMIDIData, which can detect SysEx message even when it is concatenated with non-SysEx messages.
With this change, renderer/blink can be much simpler and free from this kind of data validation.
BUG=303599, 317355
TEST=media_unittests --gtest_filter=MIDI*, content_unittests --gtest_filter=MIDI*
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=237558
Patch Set 1 : Use ScopedVector<T> instead to make legacy compilers happy. #
Total comments: 2
Patch Set 2 : Use MIDIMessageQueue from MIDIHost #
Total comments: 2
Patch Set 3 : Use MIDIMessageQueue in MIDIHost::OnSendData as well as MIDIHost::ReceiveMIDIData #
Total comments: 37
Patch Set 4 : Address comment except for the location of media/midi/midi_message_queue* #Patch Set 5 : Address comment (CPSPolicy is cached, fixed vague comments) #Patch Set 6 : Add IsValidMIDIMessagesForWebMIDI to avoid memory copy #
Total comments: 8
Patch Set 7 : Address comment #
Total comments: 11
Patch Set 8 : Address comments from scherkus, make GetMIDIMessageLength visible for future use #Patch Set 9 : Address comments from scherkus. Rename IsValidWebMIDIMessage to IsValidWebMIDIData #Patch Set 10 : rebase #
Total comments: 2
Patch Set 11 : Removed unnecessary notation from a header comment, to address scherkus' comment. #
Messages
Total messages: 23 (0 generated)
|