Add FakeSampleStreamItem to an existing FakeSampleStream.

Allows items to be added to the queue once the sample stream has already been created.
Means tests can simulate data not all being available at the start.

PiperOrigin-RevId: 290613392
This commit is contained in:
samrobinson 2020-01-20 15:23:20 +00:00 committed by Ian Baker
parent 04d325331b
commit df41ae3f42

View file

@ -133,6 +133,15 @@ public final class FakeSampleStream implements SampleStream {
this.timeUs = timeUs;
}
/**
* Adds an item to the end of the queue of {@link FakeSampleStreamItem items}.
*
* @param item The item to add.
*/
public void addFakeSampleStreamItem(FakeSampleStreamItem item) {
this.fakeSampleStreamItems.add(item);
}
@Override
public boolean isReady() {
return true;