- log("# of bytes read = " + count);
- return Optional.of(Frame.of(data, config));
+ if (count != bytesPerFrame) {
+ log("Expected to read " + bytesPerFrame + " bytes per frame but read " + count);
+ }
+ return Optional.of(VideoFrame.of(data, config));