Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 memset(_paServerVersion, 0, sizeof(_paServerVersion)); 99 memset(_paServerVersion, 0, sizeof(_paServerVersion));
100 memset(&_playBufferAttr, 0, sizeof(_playBufferAttr)); 100 memset(&_playBufferAttr, 0, sizeof(_playBufferAttr));
101 memset(&_recBufferAttr, 0, sizeof(_recBufferAttr)); 101 memset(&_recBufferAttr, 0, sizeof(_recBufferAttr));
102 memset(_oldKeyState, 0, sizeof(_oldKeyState)); 102 memset(_oldKeyState, 0, sizeof(_oldKeyState));
103 } 103 }
104 104
105 AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse() 105 AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse()
106 { 106 {
107 WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, 107 WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id,
108 "%s destroyed", __FUNCTION__); 108 "%s destroyed", __FUNCTION__);
109 DCHECK(thread_checker_.CalledOnValidThread()); 109 RTC_DCHECK(thread_checker_.CalledOnValidThread());
110 Terminate(); 110 Terminate();
111 111
112 if (_recBuffer) 112 if (_recBuffer)
113 { 113 {
114 delete [] _recBuffer; 114 delete [] _recBuffer;
115 _recBuffer = NULL; 115 _recBuffer = NULL;
116 } 116 }
117 if (_playBuffer) 117 if (_playBuffer)
118 { 118 {
119 delete [] _playBuffer; 119 delete [] _playBuffer;
(...skipping 12 matching lines...) Expand all
132 132
133 delete &_recStartEvent; 133 delete &_recStartEvent;
134 delete &_playStartEvent; 134 delete &_playStartEvent;
135 delete &_timeEventRec; 135 delete &_timeEventRec;
136 delete &_timeEventPlay; 136 delete &_timeEventPlay;
137 delete &_critSect; 137 delete &_critSect;
138 } 138 }
139 139
140 void AudioDeviceLinuxPulse::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) 140 void AudioDeviceLinuxPulse::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer)
141 { 141 {
142 DCHECK(thread_checker_.CalledOnValidThread()); 142 RTC_DCHECK(thread_checker_.CalledOnValidThread());
143 143
144 _ptrAudioBuffer = audioBuffer; 144 _ptrAudioBuffer = audioBuffer;
145 145
146 // Inform the AudioBuffer about default settings for this implementation. 146 // Inform the AudioBuffer about default settings for this implementation.
147 // Set all values to zero here since the actual settings will be done by 147 // Set all values to zero here since the actual settings will be done by
148 // InitPlayout and InitRecording later. 148 // InitPlayout and InitRecording later.
149 _ptrAudioBuffer->SetRecordingSampleRate(0); 149 _ptrAudioBuffer->SetRecordingSampleRate(0);
150 _ptrAudioBuffer->SetPlayoutSampleRate(0); 150 _ptrAudioBuffer->SetPlayoutSampleRate(0);
151 _ptrAudioBuffer->SetRecordingChannels(0); 151 _ptrAudioBuffer->SetRecordingChannels(0);
152 _ptrAudioBuffer->SetPlayoutChannels(0); 152 _ptrAudioBuffer->SetPlayoutChannels(0);
153 } 153 }
154 154
155 // ---------------------------------------------------------------------------- 155 // ----------------------------------------------------------------------------
156 // ActiveAudioLayer 156 // ActiveAudioLayer
157 // ---------------------------------------------------------------------------- 157 // ----------------------------------------------------------------------------
158 158
159 int32_t AudioDeviceLinuxPulse::ActiveAudioLayer( 159 int32_t AudioDeviceLinuxPulse::ActiveAudioLayer(
160 AudioDeviceModule::AudioLayer& audioLayer) const 160 AudioDeviceModule::AudioLayer& audioLayer) const
161 { 161 {
162 audioLayer = AudioDeviceModule::kLinuxPulseAudio; 162 audioLayer = AudioDeviceModule::kLinuxPulseAudio;
163 return 0; 163 return 0;
164 } 164 }
165 165
166 int32_t AudioDeviceLinuxPulse::Init() 166 int32_t AudioDeviceLinuxPulse::Init()
167 { 167 {
168 DCHECK(thread_checker_.CalledOnValidThread()); 168 RTC_DCHECK(thread_checker_.CalledOnValidThread());
169 if (_initialized) 169 if (_initialized)
170 { 170 {
171 return 0; 171 return 0;
172 } 172 }
173 173
174 // Initialize PulseAudio 174 // Initialize PulseAudio
175 if (InitPulseAudio() < 0) 175 if (InitPulseAudio() < 0)
176 { 176 {
177 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, 177 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
178 " failed to initialize PulseAudio"); 178 " failed to initialize PulseAudio");
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 _ptrThreadPlay->SetPriority(kRealtimePriority); 229 _ptrThreadPlay->SetPriority(kRealtimePriority);
230 230
231 _initialized = true; 231 _initialized = true;
232 232
233 return 0; 233 return 0;
234 } 234 }
235 235
236 int32_t AudioDeviceLinuxPulse::Terminate() 236 int32_t AudioDeviceLinuxPulse::Terminate()
237 { 237 {
238 DCHECK(thread_checker_.CalledOnValidThread()); 238 RTC_DCHECK(thread_checker_.CalledOnValidThread());
239 if (!_initialized) 239 if (!_initialized)
240 { 240 {
241 return 0; 241 return 0;
242 } 242 }
243 243
244 _mixerManager.Close(); 244 _mixerManager.Close();
245 245
246 // RECORDING 246 // RECORDING
247 if (_ptrThreadRec) 247 if (_ptrThreadRec)
248 { 248 {
(...skipping 30 matching lines...) Expand all
279 279
280 _initialized = false; 280 _initialized = false;
281 _outputDeviceIsSpecified = false; 281 _outputDeviceIsSpecified = false;
282 _inputDeviceIsSpecified = false; 282 _inputDeviceIsSpecified = false;
283 283
284 return 0; 284 return 0;
285 } 285 }
286 286
287 bool AudioDeviceLinuxPulse::Initialized() const 287 bool AudioDeviceLinuxPulse::Initialized() const
288 { 288 {
289 DCHECK(thread_checker_.CalledOnValidThread()); 289 RTC_DCHECK(thread_checker_.CalledOnValidThread());
290 return (_initialized); 290 return (_initialized);
291 } 291 }
292 292
293 int32_t AudioDeviceLinuxPulse::InitSpeaker() 293 int32_t AudioDeviceLinuxPulse::InitSpeaker()
294 { 294 {
295 DCHECK(thread_checker_.CalledOnValidThread()); 295 RTC_DCHECK(thread_checker_.CalledOnValidThread());
296 296
297 if (_playing) 297 if (_playing)
298 { 298 {
299 return -1; 299 return -1;
300 } 300 }
301 301
302 if (!_outputDeviceIsSpecified) 302 if (!_outputDeviceIsSpecified)
303 { 303 {
304 return -1; 304 return -1;
305 } 305 }
(...skipping 23 matching lines...) Expand all
329 329
330 // clear _deviceIndex 330 // clear _deviceIndex
331 _deviceIndex = -1; 331 _deviceIndex = -1;
332 _paDeviceIndex = -1; 332 _paDeviceIndex = -1;
333 333
334 return 0; 334 return 0;
335 } 335 }
336 336
337 int32_t AudioDeviceLinuxPulse::InitMicrophone() 337 int32_t AudioDeviceLinuxPulse::InitMicrophone()
338 { 338 {
339 DCHECK(thread_checker_.CalledOnValidThread()); 339 RTC_DCHECK(thread_checker_.CalledOnValidThread());
340 if (_recording) 340 if (_recording)
341 { 341 {
342 return -1; 342 return -1;
343 } 343 }
344 344
345 if (!_inputDeviceIsSpecified) 345 if (!_inputDeviceIsSpecified)
346 { 346 {
347 return -1; 347 return -1;
348 } 348 }
349 349
(...skipping 22 matching lines...) Expand all
372 372
373 // Clear _deviceIndex 373 // Clear _deviceIndex
374 _deviceIndex = -1; 374 _deviceIndex = -1;
375 _paDeviceIndex = -1; 375 _paDeviceIndex = -1;
376 376
377 return 0; 377 return 0;
378 } 378 }
379 379
380 bool AudioDeviceLinuxPulse::SpeakerIsInitialized() const 380 bool AudioDeviceLinuxPulse::SpeakerIsInitialized() const
381 { 381 {
382 DCHECK(thread_checker_.CalledOnValidThread()); 382 RTC_DCHECK(thread_checker_.CalledOnValidThread());
383 return (_mixerManager.SpeakerIsInitialized()); 383 return (_mixerManager.SpeakerIsInitialized());
384 } 384 }
385 385
386 bool AudioDeviceLinuxPulse::MicrophoneIsInitialized() const 386 bool AudioDeviceLinuxPulse::MicrophoneIsInitialized() const
387 { 387 {
388 DCHECK(thread_checker_.CalledOnValidThread()); 388 RTC_DCHECK(thread_checker_.CalledOnValidThread());
389 return (_mixerManager.MicrophoneIsInitialized()); 389 return (_mixerManager.MicrophoneIsInitialized());
390 } 390 }
391 391
392 int32_t AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available) 392 int32_t AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
393 { 393 {
394 DCHECK(thread_checker_.CalledOnValidThread()); 394 RTC_DCHECK(thread_checker_.CalledOnValidThread());
395 bool wasInitialized = _mixerManager.SpeakerIsInitialized(); 395 bool wasInitialized = _mixerManager.SpeakerIsInitialized();
396 396
397 // Make an attempt to open up the 397 // Make an attempt to open up the
398 // output mixer corresponding to the currently selected output device. 398 // output mixer corresponding to the currently selected output device.
399 if (!wasInitialized && InitSpeaker() == -1) 399 if (!wasInitialized && InitSpeaker() == -1)
400 { 400 {
401 // If we end up here it means that the selected speaker has no volume 401 // If we end up here it means that the selected speaker has no volume
402 // control. 402 // control.
403 available = false; 403 available = false;
404 return 0; 404 return 0;
405 } 405 }
406 406
407 // Given that InitSpeaker was successful, we know volume control exists. 407 // Given that InitSpeaker was successful, we know volume control exists.
408 available = true; 408 available = true;
409 409
410 // Close the initialized output mixer 410 // Close the initialized output mixer
411 if (!wasInitialized) 411 if (!wasInitialized)
412 { 412 {
413 _mixerManager.CloseSpeaker(); 413 _mixerManager.CloseSpeaker();
414 } 414 }
415 415
416 return 0; 416 return 0;
417 } 417 }
418 418
419 int32_t AudioDeviceLinuxPulse::SetSpeakerVolume(uint32_t volume) 419 int32_t AudioDeviceLinuxPulse::SetSpeakerVolume(uint32_t volume)
420 { 420 {
421 DCHECK(thread_checker_.CalledOnValidThread()); 421 RTC_DCHECK(thread_checker_.CalledOnValidThread());
422 if (!_playing) { 422 if (!_playing) {
423 // Only update the volume if it's been set while we weren't playing. 423 // Only update the volume if it's been set while we weren't playing.
424 update_speaker_volume_at_startup_ = true; 424 update_speaker_volume_at_startup_ = true;
425 } 425 }
426 return (_mixerManager.SetSpeakerVolume(volume)); 426 return (_mixerManager.SetSpeakerVolume(volume));
427 } 427 }
428 428
429 int32_t AudioDeviceLinuxPulse::SpeakerVolume(uint32_t& volume) const 429 int32_t AudioDeviceLinuxPulse::SpeakerVolume(uint32_t& volume) const
430 { 430 {
431 DCHECK(thread_checker_.CalledOnValidThread()); 431 RTC_DCHECK(thread_checker_.CalledOnValidThread());
432 uint32_t level(0); 432 uint32_t level(0);
433 433
434 if (_mixerManager.SpeakerVolume(level) == -1) 434 if (_mixerManager.SpeakerVolume(level) == -1)
435 { 435 {
436 return -1; 436 return -1;
437 } 437 }
438 438
439 volume = level; 439 volume = level;
440 440
441 return 0; 441 return 0;
(...skipping 15 matching lines...) Expand all
457 { 457 {
458 458
459 WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, 459 WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
460 " API call not supported on this platform"); 460 " API call not supported on this platform");
461 return -1; 461 return -1;
462 } 462 }
463 463
464 int32_t AudioDeviceLinuxPulse::MaxSpeakerVolume( 464 int32_t AudioDeviceLinuxPulse::MaxSpeakerVolume(
465 uint32_t& maxVolume) const 465 uint32_t& maxVolume) const
466 { 466 {
467 DCHECK(thread_checker_.CalledOnValidThread()); 467 RTC_DCHECK(thread_checker_.CalledOnValidThread());
468 uint32_t maxVol(0); 468 uint32_t maxVol(0);
469 469
470 if (_mixerManager.MaxSpeakerVolume(maxVol) == -1) 470 if (_mixerManager.MaxSpeakerVolume(maxVol) == -1)
471 { 471 {
472 return -1; 472 return -1;
473 } 473 }
474 474
475 maxVolume = maxVol; 475 maxVolume = maxVol;
476 476
477 return 0; 477 return 0;
478 } 478 }
479 479
480 int32_t AudioDeviceLinuxPulse::MinSpeakerVolume( 480 int32_t AudioDeviceLinuxPulse::MinSpeakerVolume(
481 uint32_t& minVolume) const 481 uint32_t& minVolume) const
482 { 482 {
483 DCHECK(thread_checker_.CalledOnValidThread()); 483 RTC_DCHECK(thread_checker_.CalledOnValidThread());
484 uint32_t minVol(0); 484 uint32_t minVol(0);
485 485
486 if (_mixerManager.MinSpeakerVolume(minVol) == -1) 486 if (_mixerManager.MinSpeakerVolume(minVol) == -1)
487 { 487 {
488 return -1; 488 return -1;
489 } 489 }
490 490
491 minVolume = minVol; 491 minVolume = minVol;
492 492
493 return 0; 493 return 0;
494 } 494 }
495 495
496 int32_t AudioDeviceLinuxPulse::SpeakerVolumeStepSize( 496 int32_t AudioDeviceLinuxPulse::SpeakerVolumeStepSize(
497 uint16_t& stepSize) const 497 uint16_t& stepSize) const
498 { 498 {
499 DCHECK(thread_checker_.CalledOnValidThread()); 499 RTC_DCHECK(thread_checker_.CalledOnValidThread());
500 uint16_t delta(0); 500 uint16_t delta(0);
501 501
502 if (_mixerManager.SpeakerVolumeStepSize(delta) == -1) 502 if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
503 { 503 {
504 return -1; 504 return -1;
505 } 505 }
506 506
507 stepSize = delta; 507 stepSize = delta;
508 508
509 return 0; 509 return 0;
510 } 510 }
511 511
512 int32_t AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available) 512 int32_t AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
513 { 513 {
514 DCHECK(thread_checker_.CalledOnValidThread()); 514 RTC_DCHECK(thread_checker_.CalledOnValidThread());
515 bool isAvailable(false); 515 bool isAvailable(false);
516 bool wasInitialized = _mixerManager.SpeakerIsInitialized(); 516 bool wasInitialized = _mixerManager.SpeakerIsInitialized();
517 517
518 // Make an attempt to open up the 518 // Make an attempt to open up the
519 // output mixer corresponding to the currently selected output device. 519 // output mixer corresponding to the currently selected output device.
520 // 520 //
521 if (!wasInitialized && InitSpeaker() == -1) 521 if (!wasInitialized && InitSpeaker() == -1)
522 { 522 {
523 // If we end up here it means that the selected speaker has no volume 523 // If we end up here it means that the selected speaker has no volume
524 // control, hence it is safe to state that there is no mute control 524 // control, hence it is safe to state that there is no mute control
(...skipping 11 matching lines...) Expand all
536 if (!wasInitialized) 536 if (!wasInitialized)
537 { 537 {
538 _mixerManager.CloseSpeaker(); 538 _mixerManager.CloseSpeaker();
539 } 539 }
540 540
541 return 0; 541 return 0;
542 } 542 }
543 543
544 int32_t AudioDeviceLinuxPulse::SetSpeakerMute(bool enable) 544 int32_t AudioDeviceLinuxPulse::SetSpeakerMute(bool enable)
545 { 545 {
546 DCHECK(thread_checker_.CalledOnValidThread()); 546 RTC_DCHECK(thread_checker_.CalledOnValidThread());
547 return (_mixerManager.SetSpeakerMute(enable)); 547 return (_mixerManager.SetSpeakerMute(enable));
548 } 548 }
549 549
550 int32_t AudioDeviceLinuxPulse::SpeakerMute(bool& enabled) const 550 int32_t AudioDeviceLinuxPulse::SpeakerMute(bool& enabled) const
551 { 551 {
552 DCHECK(thread_checker_.CalledOnValidThread()); 552 RTC_DCHECK(thread_checker_.CalledOnValidThread());
553 bool muted(0); 553 bool muted(0);
554 if (_mixerManager.SpeakerMute(muted) == -1) 554 if (_mixerManager.SpeakerMute(muted) == -1)
555 { 555 {
556 return -1; 556 return -1;
557 } 557 }
558 558
559 enabled = muted; 559 enabled = muted;
560 return 0; 560 return 0;
561 } 561 }
562 562
563 int32_t AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available) 563 int32_t AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
564 { 564 {
565 DCHECK(thread_checker_.CalledOnValidThread()); 565 RTC_DCHECK(thread_checker_.CalledOnValidThread());
566 bool isAvailable(false); 566 bool isAvailable(false);
567 bool wasInitialized = _mixerManager.MicrophoneIsInitialized(); 567 bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
568 568
569 // Make an attempt to open up the 569 // Make an attempt to open up the
570 // input mixer corresponding to the currently selected input device. 570 // input mixer corresponding to the currently selected input device.
571 // 571 //
572 if (!wasInitialized && InitMicrophone() == -1) 572 if (!wasInitialized && InitMicrophone() == -1)
573 { 573 {
574 // If we end up here it means that the selected microphone has no 574 // If we end up here it means that the selected microphone has no
575 // volume control, hence it is safe to state that there is no 575 // volume control, hence it is safe to state that there is no
(...skipping 12 matching lines...) Expand all
588 if (!wasInitialized) 588 if (!wasInitialized)
589 { 589 {
590 _mixerManager.CloseMicrophone(); 590 _mixerManager.CloseMicrophone();
591 } 591 }
592 592
593 return 0; 593 return 0;
594 } 594 }
595 595
596 int32_t AudioDeviceLinuxPulse::SetMicrophoneMute(bool enable) 596 int32_t AudioDeviceLinuxPulse::SetMicrophoneMute(bool enable)
597 { 597 {
598 DCHECK(thread_checker_.CalledOnValidThread()); 598 RTC_DCHECK(thread_checker_.CalledOnValidThread());
599 return (_mixerManager.SetMicrophoneMute(enable)); 599 return (_mixerManager.SetMicrophoneMute(enable));
600 } 600 }
601 601
602 int32_t AudioDeviceLinuxPulse::MicrophoneMute(bool& enabled) const 602 int32_t AudioDeviceLinuxPulse::MicrophoneMute(bool& enabled) const
603 { 603 {
604 DCHECK(thread_checker_.CalledOnValidThread()); 604 RTC_DCHECK(thread_checker_.CalledOnValidThread());
605 bool muted(0); 605 bool muted(0);
606 if (_mixerManager.MicrophoneMute(muted) == -1) 606 if (_mixerManager.MicrophoneMute(muted) == -1)
607 { 607 {
608 return -1; 608 return -1;
609 } 609 }
610 610
611 enabled = muted; 611 enabled = muted;
612 return 0; 612 return 0;
613 } 613 }
614 614
615 int32_t AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available) 615 int32_t AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
616 { 616 {
617 DCHECK(thread_checker_.CalledOnValidThread()); 617 RTC_DCHECK(thread_checker_.CalledOnValidThread());
618 bool isAvailable(false); 618 bool isAvailable(false);
619 bool wasInitialized = _mixerManager.MicrophoneIsInitialized(); 619 bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
620 620
621 // Enumerate all avaliable microphone and make an attempt to open up the 621 // Enumerate all avaliable microphone and make an attempt to open up the
622 // input mixer corresponding to the currently selected input device. 622 // input mixer corresponding to the currently selected input device.
623 // 623 //
624 if (!wasInitialized && InitMicrophone() == -1) 624 if (!wasInitialized && InitMicrophone() == -1)
625 { 625 {
626 // If we end up here it means that the selected microphone has no 626 // If we end up here it means that the selected microphone has no
627 // volume control, hence it is safe to state that there is no 627 // volume control, hence it is safe to state that there is no
(...skipping 10 matching lines...) Expand all
638 if (!wasInitialized) 638 if (!wasInitialized)
639 { 639 {
640 _mixerManager.CloseMicrophone(); 640 _mixerManager.CloseMicrophone();
641 } 641 }
642 642
643 return 0; 643 return 0;
644 } 644 }
645 645
646 int32_t AudioDeviceLinuxPulse::SetMicrophoneBoost(bool enable) 646 int32_t AudioDeviceLinuxPulse::SetMicrophoneBoost(bool enable)
647 { 647 {
648 DCHECK(thread_checker_.CalledOnValidThread()); 648 RTC_DCHECK(thread_checker_.CalledOnValidThread());
649 return (_mixerManager.SetMicrophoneBoost(enable)); 649 return (_mixerManager.SetMicrophoneBoost(enable));
650 } 650 }
651 651
652 int32_t AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const 652 int32_t AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const
653 { 653 {
654 DCHECK(thread_checker_.CalledOnValidThread()); 654 RTC_DCHECK(thread_checker_.CalledOnValidThread());
655 bool onOff(0); 655 bool onOff(0);
656 656
657 if (_mixerManager.MicrophoneBoost(onOff) == -1) 657 if (_mixerManager.MicrophoneBoost(onOff) == -1)
658 { 658 {
659 return -1; 659 return -1;
660 } 660 }
661 661
662 enabled = onOff; 662 enabled = onOff;
663 663
664 return 0; 664 return 0;
665 } 665 }
666 666
667 int32_t AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available) 667 int32_t AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
668 { 668 {
669 DCHECK(thread_checker_.CalledOnValidThread()); 669 RTC_DCHECK(thread_checker_.CalledOnValidThread());
670 if (_recChannels == 2 && _recording) { 670 if (_recChannels == 2 && _recording) {
671 available = true; 671 available = true;
672 return 0; 672 return 0;
673 } 673 }
674 674
675 available = false; 675 available = false;
676 bool wasInitialized = _mixerManager.MicrophoneIsInitialized(); 676 bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
677 int error = 0; 677 int error = 0;
678 678
679 if (!wasInitialized && InitMicrophone() == -1) 679 if (!wasInitialized && InitMicrophone() == -1)
(...skipping 13 matching lines...) Expand all
693 if (!wasInitialized) 693 if (!wasInitialized)
694 { 694 {
695 _mixerManager.CloseMicrophone(); 695 _mixerManager.CloseMicrophone();
696 } 696 }
697 697
698 return error; 698 return error;
699 } 699 }
700 700
701 int32_t AudioDeviceLinuxPulse::SetStereoRecording(bool enable) 701 int32_t AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
702 { 702 {
703 DCHECK(thread_checker_.CalledOnValidThread()); 703 RTC_DCHECK(thread_checker_.CalledOnValidThread());
704 if (enable) 704 if (enable)
705 _recChannels = 2; 705 _recChannels = 2;
706 else 706 else
707 _recChannels = 1; 707 _recChannels = 1;
708 708
709 return 0; 709 return 0;
710 } 710 }
711 711
712 int32_t AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const 712 int32_t AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
713 { 713 {
714 DCHECK(thread_checker_.CalledOnValidThread()); 714 RTC_DCHECK(thread_checker_.CalledOnValidThread());
715 if (_recChannels == 2) 715 if (_recChannels == 2)
716 enabled = true; 716 enabled = true;
717 else 717 else
718 enabled = false; 718 enabled = false;
719 719
720 return 0; 720 return 0;
721 } 721 }
722 722
723 int32_t AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available) 723 int32_t AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
724 { 724 {
725 DCHECK(thread_checker_.CalledOnValidThread()); 725 RTC_DCHECK(thread_checker_.CalledOnValidThread());
726 if (_playChannels == 2 && _playing) { 726 if (_playChannels == 2 && _playing) {
727 available = true; 727 available = true;
728 return 0; 728 return 0;
729 } 729 }
730 730
731 available = false; 731 available = false;
732 bool wasInitialized = _mixerManager.SpeakerIsInitialized(); 732 bool wasInitialized = _mixerManager.SpeakerIsInitialized();
733 int error = 0; 733 int error = 0;
734 734
735 if (!wasInitialized && InitSpeaker() == -1) 735 if (!wasInitialized && InitSpeaker() == -1)
(...skipping 12 matching lines...) Expand all
748 if (!wasInitialized) 748 if (!wasInitialized)
749 { 749 {
750 _mixerManager.CloseSpeaker(); 750 _mixerManager.CloseSpeaker();
751 } 751 }
752 752
753 return error; 753 return error;
754 } 754 }
755 755
756 int32_t AudioDeviceLinuxPulse::SetStereoPlayout(bool enable) 756 int32_t AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
757 { 757 {
758 DCHECK(thread_checker_.CalledOnValidThread()); 758 RTC_DCHECK(thread_checker_.CalledOnValidThread());
759 if (enable) 759 if (enable)
760 _playChannels = 2; 760 _playChannels = 2;
761 else 761 else
762 _playChannels = 1; 762 _playChannels = 1;
763 763
764 return 0; 764 return 0;
765 } 765 }
766 766
767 int32_t AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const 767 int32_t AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
768 { 768 {
769 DCHECK(thread_checker_.CalledOnValidThread()); 769 RTC_DCHECK(thread_checker_.CalledOnValidThread());
770 if (_playChannels == 2) 770 if (_playChannels == 2)
771 enabled = true; 771 enabled = true;
772 else 772 else
773 enabled = false; 773 enabled = false;
774 774
775 return 0; 775 return 0;
776 } 776 }
777 777
778 int32_t AudioDeviceLinuxPulse::SetAGC(bool enable) 778 int32_t AudioDeviceLinuxPulse::SetAGC(bool enable)
779 { 779 {
780 CriticalSectionScoped lock(&_critSect); 780 CriticalSectionScoped lock(&_critSect);
781 _AGC = enable; 781 _AGC = enable;
782 782
783 return 0; 783 return 0;
784 } 784 }
785 785
786 bool AudioDeviceLinuxPulse::AGC() const 786 bool AudioDeviceLinuxPulse::AGC() const
787 { 787 {
788 CriticalSectionScoped lock(&_critSect); 788 CriticalSectionScoped lock(&_critSect);
789 return _AGC; 789 return _AGC;
790 } 790 }
791 791
792 int32_t AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable( 792 int32_t AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
793 bool& available) 793 bool& available)
794 { 794 {
795 DCHECK(thread_checker_.CalledOnValidThread()); 795 RTC_DCHECK(thread_checker_.CalledOnValidThread());
796 bool wasInitialized = _mixerManager.MicrophoneIsInitialized(); 796 bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
797 797
798 // Make an attempt to open up the 798 // Make an attempt to open up the
799 // input mixer corresponding to the currently selected output device. 799 // input mixer corresponding to the currently selected output device.
800 if (!wasInitialized && InitMicrophone() == -1) 800 if (!wasInitialized && InitMicrophone() == -1)
801 { 801 {
802 // If we end up here it means that the selected microphone has no 802 // If we end up here it means that the selected microphone has no
803 // volume control. 803 // volume control.
804 available = false; 804 available = false;
805 return 0; 805 return 0;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 869 }
870 870
871 minVolume = minVol; 871 minVolume = minVol;
872 872
873 return 0; 873 return 0;
874 } 874 }
875 875
876 int32_t AudioDeviceLinuxPulse::MicrophoneVolumeStepSize( 876 int32_t AudioDeviceLinuxPulse::MicrophoneVolumeStepSize(
877 uint16_t& stepSize) const 877 uint16_t& stepSize) const
878 { 878 {
879 DCHECK(thread_checker_.CalledOnValidThread()); 879 RTC_DCHECK(thread_checker_.CalledOnValidThread());
880 uint16_t delta(0); 880 uint16_t delta(0);
881 881
882 if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1) 882 if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
883 { 883 {
884 return -1; 884 return -1;
885 } 885 }
886 886
887 stepSize = delta; 887 stepSize = delta;
888 888
889 return 0; 889 return 0;
(...skipping 13 matching lines...) Expand all
903 903
904 WaitForOperationCompletion(paOperation); 904 WaitForOperationCompletion(paOperation);
905 905
906 PaUnLock(); 906 PaUnLock();
907 907
908 return _numPlayDevices; 908 return _numPlayDevices;
909 } 909 }
910 910
911 int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(uint16_t index) 911 int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(uint16_t index)
912 { 912 {
913 DCHECK(thread_checker_.CalledOnValidThread()); 913 RTC_DCHECK(thread_checker_.CalledOnValidThread());
914 if (_playIsInitialized) 914 if (_playIsInitialized)
915 { 915 {
916 return -1; 916 return -1;
917 } 917 }
918 918
919 const uint16_t nDevices = PlayoutDevices(); 919 const uint16_t nDevices = PlayoutDevices();
920 920
921 WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, 921 WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
922 " number of availiable output devices is %u", nDevices); 922 " number of availiable output devices is %u", nDevices);
923 923
(...skipping 16 matching lines...) Expand all
940 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, 940 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
941 "WindowsDeviceType not supported"); 941 "WindowsDeviceType not supported");
942 return -1; 942 return -1;
943 } 943 }
944 944
945 int32_t AudioDeviceLinuxPulse::PlayoutDeviceName( 945 int32_t AudioDeviceLinuxPulse::PlayoutDeviceName(
946 uint16_t index, 946 uint16_t index,
947 char name[kAdmMaxDeviceNameSize], 947 char name[kAdmMaxDeviceNameSize],
948 char guid[kAdmMaxGuidSize]) 948 char guid[kAdmMaxGuidSize])
949 { 949 {
950 DCHECK(thread_checker_.CalledOnValidThread()); 950 RTC_DCHECK(thread_checker_.CalledOnValidThread());
951 const uint16_t nDevices = PlayoutDevices(); 951 const uint16_t nDevices = PlayoutDevices();
952 952
953 if ((index > (nDevices - 1)) || (name == NULL)) 953 if ((index > (nDevices - 1)) || (name == NULL))
954 { 954 {
955 return -1; 955 return -1;
956 } 956 }
957 957
958 memset(name, 0, kAdmMaxDeviceNameSize); 958 memset(name, 0, kAdmMaxDeviceNameSize);
959 959
960 if (guid != NULL) 960 if (guid != NULL)
(...skipping 21 matching lines...) Expand all
982 _deviceIndex = -1; 982 _deviceIndex = -1;
983 983
984 return 0; 984 return 0;
985 } 985 }
986 986
987 int32_t AudioDeviceLinuxPulse::RecordingDeviceName( 987 int32_t AudioDeviceLinuxPulse::RecordingDeviceName(
988 uint16_t index, 988 uint16_t index,
989 char name[kAdmMaxDeviceNameSize], 989 char name[kAdmMaxDeviceNameSize],
990 char guid[kAdmMaxGuidSize]) 990 char guid[kAdmMaxGuidSize])
991 { 991 {
992 DCHECK(thread_checker_.CalledOnValidThread()); 992 RTC_DCHECK(thread_checker_.CalledOnValidThread());
993 const uint16_t nDevices(RecordingDevices()); 993 const uint16_t nDevices(RecordingDevices());
994 994
995 if ((index > (nDevices - 1)) || (name == NULL)) 995 if ((index > (nDevices - 1)) || (name == NULL))
996 { 996 {
997 return -1; 997 return -1;
998 } 998 }
999 999
1000 memset(name, 0, kAdmMaxDeviceNameSize); 1000 memset(name, 0, kAdmMaxDeviceNameSize);
1001 1001
1002 if (guid != NULL) 1002 if (guid != NULL)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 1040
1041 WaitForOperationCompletion(paOperation); 1041 WaitForOperationCompletion(paOperation);
1042 1042
1043 PaUnLock(); 1043 PaUnLock();
1044 1044
1045 return _numRecDevices; 1045 return _numRecDevices;
1046 } 1046 }
1047 1047
1048 int32_t AudioDeviceLinuxPulse::SetRecordingDevice(uint16_t index) 1048 int32_t AudioDeviceLinuxPulse::SetRecordingDevice(uint16_t index)
1049 { 1049 {
1050 DCHECK(thread_checker_.CalledOnValidThread()); 1050 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1051 if (_recIsInitialized) 1051 if (_recIsInitialized)
1052 { 1052 {
1053 return -1; 1053 return -1;
1054 } 1054 }
1055 1055
1056 const uint16_t nDevices(RecordingDevices()); 1056 const uint16_t nDevices(RecordingDevices());
1057 1057
1058 WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, 1058 WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
1059 " number of availiable input devices is %u", nDevices); 1059 " number of availiable input devices is %u", nDevices);
1060 1060
(...skipping 13 matching lines...) Expand all
1074 int32_t AudioDeviceLinuxPulse::SetRecordingDevice( 1074 int32_t AudioDeviceLinuxPulse::SetRecordingDevice(
1075 AudioDeviceModule::WindowsDeviceType /*device*/) 1075 AudioDeviceModule::WindowsDeviceType /*device*/)
1076 { 1076 {
1077 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, 1077 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
1078 "WindowsDeviceType not supported"); 1078 "WindowsDeviceType not supported");
1079 return -1; 1079 return -1;
1080 } 1080 }
1081 1081
1082 int32_t AudioDeviceLinuxPulse::PlayoutIsAvailable(bool& available) 1082 int32_t AudioDeviceLinuxPulse::PlayoutIsAvailable(bool& available)
1083 { 1083 {
1084 DCHECK(thread_checker_.CalledOnValidThread()); 1084 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1085 available = false; 1085 available = false;
1086 1086
1087 // Try to initialize the playout side 1087 // Try to initialize the playout side
1088 int32_t res = InitPlayout(); 1088 int32_t res = InitPlayout();
1089 1089
1090 // Cancel effect of initialization 1090 // Cancel effect of initialization
1091 StopPlayout(); 1091 StopPlayout();
1092 1092
1093 if (res != -1) 1093 if (res != -1)
1094 { 1094 {
1095 available = true; 1095 available = true;
1096 } 1096 }
1097 1097
1098 return res; 1098 return res;
1099 } 1099 }
1100 1100
1101 int32_t AudioDeviceLinuxPulse::RecordingIsAvailable(bool& available) 1101 int32_t AudioDeviceLinuxPulse::RecordingIsAvailable(bool& available)
1102 { 1102 {
1103 DCHECK(thread_checker_.CalledOnValidThread()); 1103 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1104 available = false; 1104 available = false;
1105 1105
1106 // Try to initialize the playout side 1106 // Try to initialize the playout side
1107 int32_t res = InitRecording(); 1107 int32_t res = InitRecording();
1108 1108
1109 // Cancel effect of initialization 1109 // Cancel effect of initialization
1110 StopRecording(); 1110 StopRecording();
1111 1111
1112 if (res != -1) 1112 if (res != -1)
1113 { 1113 {
1114 available = true; 1114 available = true;
1115 } 1115 }
1116 1116
1117 return res; 1117 return res;
1118 } 1118 }
1119 1119
1120 int32_t AudioDeviceLinuxPulse::InitPlayout() 1120 int32_t AudioDeviceLinuxPulse::InitPlayout()
1121 { 1121 {
1122 DCHECK(thread_checker_.CalledOnValidThread()); 1122 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1123 1123
1124 if (_playing) 1124 if (_playing)
1125 { 1125 {
1126 return -1; 1126 return -1;
1127 } 1127 }
1128 1128
1129 if (!_outputDeviceIsSpecified) 1129 if (!_outputDeviceIsSpecified)
1130 { 1130 {
1131 return -1; 1131 return -1;
1132 } 1132 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 // Mark playout side as initialized 1234 // Mark playout side as initialized
1235 _playIsInitialized = true; 1235 _playIsInitialized = true;
1236 _sndCardPlayDelay = 0; 1236 _sndCardPlayDelay = 0;
1237 _sndCardRecDelay = 0; 1237 _sndCardRecDelay = 0;
1238 1238
1239 return 0; 1239 return 0;
1240 } 1240 }
1241 1241
1242 int32_t AudioDeviceLinuxPulse::InitRecording() 1242 int32_t AudioDeviceLinuxPulse::InitRecording()
1243 { 1243 {
1244 DCHECK(thread_checker_.CalledOnValidThread()); 1244 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1245 1245
1246 if (_recording) 1246 if (_recording)
1247 { 1247 {
1248 return -1; 1248 return -1;
1249 } 1249 }
1250 1250
1251 if (!_inputDeviceIsSpecified) 1251 if (!_inputDeviceIsSpecified)
1252 { 1252 {
1253 return -1; 1253 return -1;
1254 } 1254 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 this); 1346 this);
1347 1347
1348 // Mark recording side as initialized 1348 // Mark recording side as initialized
1349 _recIsInitialized = true; 1349 _recIsInitialized = true;
1350 1350
1351 return 0; 1351 return 0;
1352 } 1352 }
1353 1353
1354 int32_t AudioDeviceLinuxPulse::StartRecording() 1354 int32_t AudioDeviceLinuxPulse::StartRecording()
1355 { 1355 {
1356 DCHECK(thread_checker_.CalledOnValidThread()); 1356 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1357 if (!_recIsInitialized) 1357 if (!_recIsInitialized)
1358 { 1358 {
1359 return -1; 1359 return -1;
1360 } 1360 }
1361 1361
1362 if (_recording) 1362 if (_recording)
1363 { 1363 {
1364 return 0; 1364 return 0;
1365 } 1365 }
1366 1366
(...skipping 26 matching lines...) Expand all
1393 " failed to activate recording"); 1393 " failed to activate recording");
1394 return -1; 1394 return -1;
1395 } 1395 }
1396 } 1396 }
1397 1397
1398 return 0; 1398 return 0;
1399 } 1399 }
1400 1400
1401 int32_t AudioDeviceLinuxPulse::StopRecording() 1401 int32_t AudioDeviceLinuxPulse::StopRecording()
1402 { 1402 {
1403 DCHECK(thread_checker_.CalledOnValidThread()); 1403 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1404 CriticalSectionScoped lock(&_critSect); 1404 CriticalSectionScoped lock(&_critSect);
1405 1405
1406 if (!_recIsInitialized) 1406 if (!_recIsInitialized)
1407 { 1407 {
1408 return 0; 1408 return 0;
1409 } 1409 }
1410 1410
1411 if (_recStream == NULL) 1411 if (_recStream == NULL)
1412 { 1412 {
1413 return -1; 1413 return -1;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 { 1456 {
1457 delete [] _recBuffer; 1457 delete [] _recBuffer;
1458 _recBuffer = NULL; 1458 _recBuffer = NULL;
1459 } 1459 }
1460 1460
1461 return 0; 1461 return 0;
1462 } 1462 }
1463 1463
1464 bool AudioDeviceLinuxPulse::RecordingIsInitialized() const 1464 bool AudioDeviceLinuxPulse::RecordingIsInitialized() const
1465 { 1465 {
1466 DCHECK(thread_checker_.CalledOnValidThread()); 1466 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1467 return (_recIsInitialized); 1467 return (_recIsInitialized);
1468 } 1468 }
1469 1469
1470 bool AudioDeviceLinuxPulse::Recording() const 1470 bool AudioDeviceLinuxPulse::Recording() const
1471 { 1471 {
1472 DCHECK(thread_checker_.CalledOnValidThread()); 1472 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1473 return (_recording); 1473 return (_recording);
1474 } 1474 }
1475 1475
1476 bool AudioDeviceLinuxPulse::PlayoutIsInitialized() const 1476 bool AudioDeviceLinuxPulse::PlayoutIsInitialized() const
1477 { 1477 {
1478 DCHECK(thread_checker_.CalledOnValidThread()); 1478 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1479 return (_playIsInitialized); 1479 return (_playIsInitialized);
1480 } 1480 }
1481 1481
1482 int32_t AudioDeviceLinuxPulse::StartPlayout() 1482 int32_t AudioDeviceLinuxPulse::StartPlayout()
1483 { 1483 {
1484 DCHECK(thread_checker_.CalledOnValidThread()); 1484 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1485 1485
1486 if (!_playIsInitialized) 1486 if (!_playIsInitialized)
1487 { 1487 {
1488 return -1; 1488 return -1;
1489 } 1489 }
1490 1490
1491 if (_playing) 1491 if (_playing)
1492 { 1492 {
1493 return 0; 1493 return 0;
1494 } 1494 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 " failed to activate playing"); 1528 " failed to activate playing");
1529 return -1; 1529 return -1;
1530 } 1530 }
1531 } 1531 }
1532 1532
1533 return 0; 1533 return 0;
1534 } 1534 }
1535 1535
1536 int32_t AudioDeviceLinuxPulse::StopPlayout() 1536 int32_t AudioDeviceLinuxPulse::StopPlayout()
1537 { 1537 {
1538 DCHECK(thread_checker_.CalledOnValidThread()); 1538 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1539 CriticalSectionScoped lock(&_critSect); 1539 CriticalSectionScoped lock(&_critSect);
1540 1540
1541 if (!_playIsInitialized) 1541 if (!_playIsInitialized)
1542 { 1542 {
1543 return 0; 1543 return 0;
1544 } 1544 }
1545 1545
1546 if (_playStream == NULL) 1546 if (_playStream == NULL)
1547 { 1547 {
1548 return -1; 1548 return -1;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 1600
1601 int32_t AudioDeviceLinuxPulse::PlayoutDelay(uint16_t& delayMS) const 1601 int32_t AudioDeviceLinuxPulse::PlayoutDelay(uint16_t& delayMS) const
1602 { 1602 {
1603 CriticalSectionScoped lock(&_critSect); 1603 CriticalSectionScoped lock(&_critSect);
1604 delayMS = (uint16_t) _sndCardPlayDelay; 1604 delayMS = (uint16_t) _sndCardPlayDelay;
1605 return 0; 1605 return 0;
1606 } 1606 }
1607 1607
1608 int32_t AudioDeviceLinuxPulse::RecordingDelay(uint16_t& delayMS) const 1608 int32_t AudioDeviceLinuxPulse::RecordingDelay(uint16_t& delayMS) const
1609 { 1609 {
1610 DCHECK(thread_checker_.CalledOnValidThread()); 1610 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1611 delayMS = (uint16_t) _sndCardRecDelay; 1611 delayMS = (uint16_t) _sndCardRecDelay;
1612 return 0; 1612 return 0;
1613 } 1613 }
1614 1614
1615 bool AudioDeviceLinuxPulse::Playing() const 1615 bool AudioDeviceLinuxPulse::Playing() const
1616 { 1616 {
1617 DCHECK(thread_checker_.CalledOnValidThread()); 1617 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1618 return (_playing); 1618 return (_playing);
1619 } 1619 }
1620 1620
1621 int32_t AudioDeviceLinuxPulse::SetPlayoutBuffer( 1621 int32_t AudioDeviceLinuxPulse::SetPlayoutBuffer(
1622 const AudioDeviceModule::BufferType type, 1622 const AudioDeviceModule::BufferType type,
1623 uint16_t sizeMS) 1623 uint16_t sizeMS)
1624 { 1624 {
1625 DCHECK(thread_checker_.CalledOnValidThread()); 1625 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1626 if (type != AudioDeviceModule::kFixedBufferSize) 1626 if (type != AudioDeviceModule::kFixedBufferSize)
1627 { 1627 {
1628 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, 1628 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
1629 " Adaptive buffer size not supported on this platform"); 1629 " Adaptive buffer size not supported on this platform");
1630 return -1; 1630 return -1;
1631 } 1631 }
1632 1632
1633 _playBufType = type; 1633 _playBufType = type;
1634 _playBufDelayFixed = sizeMS; 1634 _playBufDelayFixed = sizeMS;
1635 1635
1636 return 0; 1636 return 0;
1637 } 1637 }
1638 1638
1639 int32_t AudioDeviceLinuxPulse::PlayoutBuffer( 1639 int32_t AudioDeviceLinuxPulse::PlayoutBuffer(
1640 AudioDeviceModule::BufferType& type, 1640 AudioDeviceModule::BufferType& type,
1641 uint16_t& sizeMS) const 1641 uint16_t& sizeMS) const
1642 { 1642 {
1643 DCHECK(thread_checker_.CalledOnValidThread()); 1643 RTC_DCHECK(thread_checker_.CalledOnValidThread());
1644 type = _playBufType; 1644 type = _playBufType;
1645 sizeMS = _playBufDelayFixed; 1645 sizeMS = _playBufDelayFixed;
1646 1646
1647 return 0; 1647 return 0;
1648 } 1648 }
1649 1649
1650 int32_t AudioDeviceLinuxPulse::CPULoad(uint16_t& /*load*/) const 1650 int32_t AudioDeviceLinuxPulse::CPULoad(uint16_t& /*load*/) const
1651 { 1651 {
1652 1652
1653 WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, 1653 WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 3013
3014 // A bit change in keymap means a key is pressed 3014 // A bit change in keymap means a key is pressed
3015 for (i = 0; i < sizeof(szKey); i++) 3015 for (i = 0; i < sizeof(szKey); i++)
3016 state |= (szKey[i] ^ _oldKeyState[i]) & szKey[i]; 3016 state |= (szKey[i] ^ _oldKeyState[i]) & szKey[i];
3017 3017
3018 // Save old state 3018 // Save old state
3019 memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState)); 3019 memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState));
3020 return (state != 0); 3020 return (state != 0);
3021 } 3021 }
3022 } 3022 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698