Commit 97fd8305 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

webrtc-insertable streams: test more frame metadata elements

tests the equality of the synchronizationSource, timestamp and type
(which is undefined for audio) in addition to frame data equality.

BUG=chromium:1069278

Change-Id: If9d3c3de747b6b9ede71a90477e9a8aec88f0716
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148603Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarMarina Ciocea <marinaciocea@chromium.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#759151}
parent 087e3211
...@@ -22,7 +22,10 @@ function areArrayBuffersEqual(buffer1, buffer2) ...@@ -22,7 +22,10 @@ function areArrayBuffersEqual(buffer1, buffer2)
} }
function areFrameInfosEqual(frame1, frame2) { function areFrameInfosEqual(frame1, frame2) {
return areArrayBuffersEqual(frame1.data, frame2.data); return frame1.type === frame2.type &&
frame1.synchronizationSource === frame2.synchronizationSource &&
frame1.timestamp === frame2.timestamp &&
areArrayBuffersEqual(frame1.data, frame2.data);
} }
async function doInverseSignalingHandshake(pc1, pc2) { async function doInverseSignalingHandshake(pc1, pc2) {
...@@ -98,7 +101,12 @@ async function testAudioFlow(t, negotiationFunction) { ...@@ -98,7 +101,12 @@ async function testAudioFlow(t, negotiationFunction) {
// Pass frames as they come from the encoder. // Pass frames as they come from the encoder.
for (let i = 0; i < numFramesPassthrough; i++) { for (let i = 0; i < numFramesPassthrough; i++) {
const result = await senderReader.read() const result = await senderReader.read()
frameInfos.push({data: result.value.data}); frameInfos.push({
data: result.value.data,
synchronizationSource: result.value.synchronizationSource,
timestamp: result.value.timestamp,
type: result.value.type,
});
senderWriter.write(result.value); senderWriter.write(result.value);
} }
...@@ -111,7 +119,12 @@ async function testAudioFlow(t, negotiationFunction) { ...@@ -111,7 +119,12 @@ async function testAudioFlow(t, negotiationFunction) {
int8View.fill(i); int8View.fill(i);
result.value.data = buffer; result.value.data = buffer;
frameInfos.push({data: result.value.data}); frameInfos.push({
data: result.value.data,
synchronizationSource: result.value.synchronizationSource,
timestamp: result.value.timestamp,
type: result.value.type,
});
senderWriter.write(result.value); senderWriter.write(result.value);
} }
...@@ -121,7 +134,12 @@ async function testAudioFlow(t, negotiationFunction) { ...@@ -121,7 +134,12 @@ async function testAudioFlow(t, negotiationFunction) {
const int8View = new Int8Array(result.value.data); const int8View = new Int8Array(result.value.data);
int8View.fill(i); int8View.fill(i);
frameInfos.push({data: result.value.data}); frameInfos.push({
data: result.value.data,
synchronizationSource: result.value.synchronizationSource,
timestamp: result.value.timestamp,
type: result.value.type,
});
senderWriter.write(result.value); senderWriter.write(result.value);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment