• Home
  • Raw
  • Download

Lines Matching refs:cmd

316 void AudioHandler::StreamsInfo(StreamInfoCommand& cmd) {  in StreamsInfo()  argument
317 if (cmd.start_id() >= NUM_STREAMS || in StreamsInfo()
318 cmd.start_id() + cmd.count() > NUM_STREAMS) { in StreamsInfo()
319 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG, {}); in StreamsInfo()
323 &STREAMS[cmd.start_id()], &STREAMS[0] + cmd.start_id() + cmd.count()); in StreamsInfo()
324 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK, stream_info); in StreamsInfo()
327 void AudioHandler::SetStreamParameters(StreamSetParamsCommand& cmd) { in SetStreamParameters() argument
328 if (cmd.stream_id() >= NUM_STREAMS) { in SetStreamParameters()
329 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in SetStreamParameters()
332 const auto& stream_info = STREAMS[cmd.stream_id()]; in SetStreamParameters()
333 auto bits_per_sample = BitsPerSample(cmd.format()); in SetStreamParameters()
334 auto sample_rate = SampleRate(cmd.rate()); in SetStreamParameters()
335 auto channels = cmd.channels(); in SetStreamParameters()
339 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in SetStreamParameters()
343 std::lock_guard<std::mutex> lock(stream_descs_[cmd.stream_id()].mtx); in SetStreamParameters()
344 stream_descs_[cmd.stream_id()].bits_per_sample = bits_per_sample; in SetStreamParameters()
345 stream_descs_[cmd.stream_id()].sample_rate = sample_rate; in SetStreamParameters()
346 stream_descs_[cmd.stream_id()].channels = channels; in SetStreamParameters()
348 stream_descs_[cmd.stream_id()].buffer.Reset(len10ms); in SetStreamParameters()
350 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK); in SetStreamParameters()
353 void AudioHandler::PrepareStream(StreamControlCommand& cmd) { in PrepareStream() argument
354 if (cmd.stream_id() >= NUM_STREAMS) { in PrepareStream()
355 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in PrepareStream()
358 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK); in PrepareStream()
361 void AudioHandler::ReleaseStream(StreamControlCommand& cmd) { in ReleaseStream() argument
362 if (cmd.stream_id() >= NUM_STREAMS) { in ReleaseStream()
363 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in ReleaseStream()
366 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK); in ReleaseStream()
369 void AudioHandler::StartStream(StreamControlCommand& cmd) { in StartStream() argument
370 if (cmd.stream_id() >= NUM_STREAMS) { in StartStream()
371 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in StartStream()
374 stream_descs_[cmd.stream_id()].active = true; in StartStream()
375 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK); in StartStream()
378 void AudioHandler::StopStream(StreamControlCommand& cmd) { in StopStream() argument
379 if (cmd.stream_id() >= NUM_STREAMS) { in StopStream()
380 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG); in StopStream()
383 stream_descs_[cmd.stream_id()].active = false; in StopStream()
384 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK); in StopStream()
387 void AudioHandler::ChmapsInfo(ChmapInfoCommand& cmd) { in ChmapsInfo() argument
388 if (cmd.start_id() >= NUM_CHMAPS || in ChmapsInfo()
389 cmd.start_id() + cmd.count() > NUM_CHMAPS) { in ChmapsInfo()
390 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG, {}); in ChmapsInfo()
394 &CHMAPS[cmd.start_id()], &CHMAPS[cmd.start_id()] + cmd.count()); in ChmapsInfo()
395 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK, chmap_info); in ChmapsInfo()
398 void AudioHandler::JacksInfo(JackInfoCommand& cmd) { in JacksInfo() argument
399 if (cmd.start_id() >= NUM_JACKS || in JacksInfo()
400 cmd.start_id() + cmd.count() > NUM_JACKS) { in JacksInfo()
401 cmd.Reply(AudioStatus::VIRTIO_SND_S_BAD_MSG, {}); in JacksInfo()
405 &JACKS[cmd.start_id()], &JACKS[cmd.start_id()] + cmd.count()); in JacksInfo()
406 cmd.Reply(AudioStatus::VIRTIO_SND_S_OK, jack_info); in JacksInfo()