Home | History | Annotate | Download | only in base

Lines Matching refs:fifo

30   AudioFifo fifo(kChannels, kMaxFrameCount);
31 EXPECT_EQ(fifo.frames(), 0);
34 // Pushes audio bus objects to a FIFO and fill it up to different degrees.
38 AudioFifo fifo(kChannels, kMaxFrameCount);
42 EXPECT_EQ(fifo.frames(), 0);
43 fifo.Push(bus.get());
44 EXPECT_EQ(fifo.frames(), bus->frames());
45 fifo.Clear();
50 EXPECT_EQ(fifo.frames(), 0);
51 fifo.Push(bus.get());
52 EXPECT_EQ(fifo.frames(), bus->frames());
53 fifo.Clear();
57 // Consumes audio bus objects from a FIFO and empty it to different degrees.
61 AudioFifo fifo(kChannels, kMaxFrameCount);
64 fifo.Push(bus.get());
65 EXPECT_EQ(fifo.frames(), kMaxFrameCount);
70 fifo.Consume(bus.get(), 0, bus->frames());
71 EXPECT_TRUE(fifo.frames() == bus->frames());
72 fifo.Push(bus.get());
73 EXPECT_EQ(fifo.frames(), kMaxFrameCount);
78 fifo.Consume(bus.get(), 0, bus->frames());
79 EXPECT_EQ(fifo.frames(), 0);
80 fifo.Push(bus.get());
81 EXPECT_EQ(fifo.frames(), kMaxFrameCount);
85 // Verify that the frames() method of the FIFO works as intended while
86 // appending and removing audio bus elements to/from the FIFO.
90 AudioFifo fifo(kChannels, kMaxFrameCount);
92 // Fill up the FIFO and verify that the size grows as it should while adding
96 while (fifo.frames() < kMaxFrameCount) {
97 fifo.Push(bus.get());
98 EXPECT_EQ(fifo.frames(), ++n);
100 EXPECT_EQ(fifo.frames(), kMaxFrameCount);
102 // Empty the FIFO and verify that the size decreases as it should.
103 // Reduce the size of the FIFO by one frame each time.
104 while (fifo.frames() > 0) {
105 fifo.Consume(bus.get(), 0, bus->frames());
106 EXPECT_EQ(fifo.frames(), --n);
108 EXPECT_EQ(fifo.frames(), 0);
110 // Verify that a steady-state size of #frames in the FIFO is maintained
112 // wrapping by selecting a buffer size which does divides the FIFO size
117 fifo.Push(bus2.get());
118 EXPECT_EQ(fifo.frames(), frames_in_fifo);
120 fifo.Push(bus2.get());
121 fifo.Consume(bus2.get(), 0, frames_in_fifo);
122 EXPECT_EQ(fifo.frames(), frames_in_fifo);
127 // to the FIFO is correctly retrieved, i.e., that the order is correct and the
134 AudioFifo fifo(kChannels, kFifoFrameCount);
136 EXPECT_EQ(fifo.frames(), 0);
139 // Start by filling up the FIFO with audio frames. The first audio frame
143 while (fifo.frames() < kFifoFrameCount) {
146 fifo.Push(bus.get());
147 EXPECT_EQ(fifo.frames(), bus->frames() * value);
151 // FIFO should be full now.
152 EXPECT_EQ(fifo.frames(), kFifoFrameCount);
154 // Consume all audio frames in the FIFO and verify that the stored values
161 while (fifo.frames() > 0) {
162 fifo.Consume(bus.get(), 0, frames_to_consume);
169 // FIFO should be empty now.
170 EXPECT_EQ(fifo.frames(), 0);
172 // Push one audio bus to the FIFO and fill it with 1's.
176 fifo.Push(bus.get());
177 EXPECT_EQ(fifo.frames(), bus->frames());
183 fifo.Consume(bus.get(), 0, bus->frames());
188 fifo.Push(bus.get());
189 EXPECT_EQ(fifo.frames(), bus->frames());