Lines Matching refs:shm
48 struct cras_audio_shm* shm = in InitShm() local
49 static_cast<struct cras_audio_shm*>(calloc(1, sizeof(*shm))); in InitShm()
50 shm->header = in InitShm()
51 static_cast<cras_audio_shm_header*>(calloc(1, sizeof(*shm->header))); in InitShm()
52 cras_shm_set_frame_bytes(shm, 4); in InitShm()
54 cras_shm_set_used_size(shm, used_size); in InitShm()
55 shm->samples_info.length = used_size * 2; in InitShm()
56 memcpy(&shm->header->config, &shm->config, sizeof(shm->config)); in InitShm()
57 return shm; in InitShm()
82 if (stream_.shm) { in TearDown()
83 free(stream_.shm->header); in TearDown()
85 free(stream_.shm); in TearDown()
86 stream_.shm = NULL; in TearDown()
122 struct cras_audio_shm* shm; in TEST_F() local
127 shm = InitShm(); in TEST_F()
128 stream_.shm = shm; in TEST_F()
134 shm->header->write_buf_idx = 0; in TEST_F()
135 shm->header->read_buf_idx = 0; in TEST_F()
136 shm->header->write_offset[0] = 480 * 4; in TEST_F()
137 shm->header->read_offset[0] = 0; in TEST_F()
145 EXPECT_EQ(cras_shm_buff_for_idx(shm, 0), samples_ready_samples_value); in TEST_F()
146 EXPECT_EQ(1, shm->header->read_buf_idx); in TEST_F()
147 EXPECT_EQ(0, shm->header->write_offset[0]); in TEST_F()
148 EXPECT_EQ(0, shm->header->read_offset[0]); in TEST_F()
152 shm->header->read_buf_idx = 0; in TEST_F()
153 shm->header->write_offset[0] = 0; in TEST_F()
154 shm->header->read_offset[0] = 0; in TEST_F()
157 EXPECT_EQ(0, shm->header->read_buf_idx); in TEST_F()
161 shm->header->read_buf_idx = 0; in TEST_F()
162 shm->header->write_offset[0] = 123; in TEST_F()
163 shm->header->read_offset[0] = 0; in TEST_F()
166 EXPECT_EQ(0, shm->header->read_buf_idx); in TEST_F()
197 EXPECT_EQ(header, stream_.shm->header); in StreamConnected()
314 EXPECT_EQ(0.3f, cras_shm_get_volume_scaler(stream_.shm)); in TEST_F()
318 EXPECT_EQ(0.6f, cras_shm_get_volume_scaler(stream_.shm)); in TEST_F()
330 EXPECT_EQ(0.3f, cras_shm_get_volume_scaler(stream_.shm)); in TEST_F()
334 EXPECT_EQ(0.6f, cras_shm_get_volume_scaler(stream_.shm)); in TEST_F()