View | Details | Raw Unified | Return to bug 279180
Collapse All | Expand All

(-)b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__input.cc (-5 / +5 lines)
Lines 13-19 Link Here
13
+
13
+
14
+namespace media {
14
+namespace media {
15
+
15
+
16
+static const SampleFormat kSampleFormat = kSampleFormatS16;
16
+static const SampleFormat kSampleFormatAI = kSampleFormatS16;
17
+
17
+
18
+void SndioAudioInputStream::OnMoveCallback(void *arg, int delta)
18
+void SndioAudioInputStream::OnMoveCallback(void *arg, int delta)
19
+{
19
+{
Lines 59-65 Link Here
59
+  sio_initpar(&par);
59
+  sio_initpar(&par);
60
+  par.rate = params.sample_rate();
60
+  par.rate = params.sample_rate();
61
+  par.rchan = params.channels();
61
+  par.rchan = params.channels();
62
+  par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
62
+  par.bits = SampleFormatToBitsPerChannel(kSampleFormatAI);
63
+  par.bps = par.bits / 8;
63
+  par.bps = par.bits / 8;
64
+  par.sig = sig = par.bits != 8 ? 1 : 0;
64
+  par.sig = sig = par.bits != 8 ? 1 : 0;
65
+  par.le = SIO_LE_NATIVE;
65
+  par.le = SIO_LE_NATIVE;
Lines 79-85 Link Here
79
+
79
+
80
+  if (par.rate  != (unsigned int)params.sample_rate() ||
80
+  if (par.rate  != (unsigned int)params.sample_rate() ||
81
+      par.rchan != (unsigned int)params.channels() ||
81
+      par.rchan != (unsigned int)params.channels() ||
82
+      par.bits  != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
82
+      par.bits  != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormatAI) ||
83
+      par.sig   != (unsigned int)sig ||
83
+      par.sig   != (unsigned int)sig ||
84
+      (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
84
+      (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
85
+      (par.bits != par.bps * 8)) {
85
+      (par.bits != par.bps * 8)) {
Lines 87-93 Link Here
87
+    goto bad_close;
87
+    goto bad_close;
88
+  }
88
+  }
89
+  state = kStopped;
89
+  state = kStopped;
90
+  buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
90
+  buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormatAI)];
91
+  sio_onmove(hdl, &OnMoveCallback, this);
91
+  sio_onmove(hdl, &OnMoveCallback, this);
92
+  return OpenOutcome::kSuccess;
92
+  return OpenOutcome::kSuccess;
93
+bad_close:
93
+bad_close:
Lines 176-182 Link Here
176
+    GetAgcVolume(&normalized_volume);
176
+    GetAgcVolume(&normalized_volume);
177
+
177
+
178
+    // read one block
178
+    // read one block
179
+    todo = nframes * params.GetBytesPerFrame(kSampleFormat);
179
+    todo = nframes * params.GetBytesPerFrame(kSampleFormatAI);
180
+    data = buffer;
180
+    data = buffer;
181
+    while (todo > 0) {
181
+    while (todo > 0) {
182
+      n = sio_read(hdl, data, todo);
182
+      n = sio_read(hdl, data, todo);
(-)b/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_audio_sndio_sndio__output.cc (-6 / +6 lines)
Lines 14-20 Link Here
14
+
14
+
15
+namespace media {
15
+namespace media {
16
+
16
+
17
+static const SampleFormat kSampleFormat = kSampleFormatS16;
17
+static const SampleFormat kSampleFormatAO = kSampleFormatS16;
18
+
18
+
19
+void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) {
19
+void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) {
20
+  SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
20
+  SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
Lines 58-64 Link Here
58
+  state = kStopped;
58
+  state = kStopped;
59
+  volpending = 0;
59
+  volpending = 0;
60
+  vol = SIO_MAXVOL;
60
+  vol = SIO_MAXVOL;
61
+  buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
61
+  buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormatAO)];
62
+  return true;
62
+  return true;
63
+}
63
+}
64
+
64
+
Lines 80-86 Link Here
80
+  sio_initpar(&par);
80
+  sio_initpar(&par);
81
+  par.rate = params.sample_rate();
81
+  par.rate = params.sample_rate();
82
+  par.pchan = params.channels();
82
+  par.pchan = params.channels();
83
+  par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
83
+  par.bits = SampleFormatToBitsPerChannel(kSampleFormatAO);
84
+  par.bps = par.bits / 8;
84
+  par.bps = par.bits / 8;
85
+  par.sig = sig = par.bits != 8 ? 1 : 0;
85
+  par.sig = sig = par.bits != 8 ? 1 : 0;
86
+  par.le = SIO_LE_NATIVE;
86
+  par.le = SIO_LE_NATIVE;
Lines 98-104 Link Here
98
+  }
98
+  }
99
+  if (par.rate  != (unsigned int)params.sample_rate() ||
99
+  if (par.rate  != (unsigned int)params.sample_rate() ||
100
+      par.pchan != (unsigned int)params.channels() ||
100
+      par.pchan != (unsigned int)params.channels() ||
101
+      par.bits  != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
101
+      par.bits  != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormatAO) ||
102
+      par.sig   != (unsigned int)sig ||
102
+      par.sig   != (unsigned int)sig ||
103
+      (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
103
+      (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
104
+      (par.bits != par.bps * 8)) {
104
+      (par.bits != par.bps * 8)) {
Lines 170-181 Link Here
170
+    if (count == 0) {
170
+    if (count == 0) {
171
+      // We have to submit something to the device
171
+      // We have to submit something to the device
172
+      count = audio_bus->frames();
172
+      count = audio_bus->frames();
173
+      memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat));
173
+      memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormatAO));
174
+      LOG(WARNING) << "No data to play, running empty cycle.";
174
+      LOG(WARNING) << "No data to play, running empty cycle.";
175
+    }
175
+    }
176
+
176
+
177
+    // Submit data to the device
177
+    // Submit data to the device
178
+    avail = count * params.GetBytesPerFrame(kSampleFormat);
178
+    avail = count * params.GetBytesPerFrame(kSampleFormatAO);
179
+    result = sio_write(hdl, buffer, avail);
179
+    result = sio_write(hdl, buffer, avail);
180
+    if (result == 0) {
180
+    if (result == 0) {
181
+      LOG(WARNING) << "Audio device disconnected.";
181
+      LOG(WARNING) << "Audio device disconnected.";

Return to bug 279180