OLD | NEW |
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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 LOG(INFO) << __FUNCTION__; | 553 LOG(INFO) << __FUNCTION__; |
554 CHECK_INITIALIZED(); | 554 CHECK_INITIALIZED(); |
555 | 555 |
556 bool isAvailable(0); | 556 bool isAvailable(0); |
557 | 557 |
558 if (_ptrAudioDevice->SpeakerVolumeIsAvailable(isAvailable) == -1) { | 558 if (_ptrAudioDevice->SpeakerVolumeIsAvailable(isAvailable) == -1) { |
559 return -1; | 559 return -1; |
560 } | 560 } |
561 | 561 |
562 *available = isAvailable; | 562 *available = isAvailable; |
563 | 563 LOG(INFO) << "output: " << isAvailable; |
564 if (isAvailable) { | |
565 LOG(INFO) << __FUNCTION__ << " output: available"; | |
566 } else { | |
567 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
568 } | |
569 return (0); | 564 return (0); |
570 } | 565 } |
571 | 566 |
572 // ---------------------------------------------------------------------------- | 567 // ---------------------------------------------------------------------------- |
573 // SetSpeakerVolume | 568 // SetSpeakerVolume |
574 // ---------------------------------------------------------------------------- | 569 // ---------------------------------------------------------------------------- |
575 | 570 |
576 int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume) { | 571 int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume) { |
577 LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; | 572 LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; |
578 CHECK_INITIALIZED(); | 573 CHECK_INITIALIZED(); |
579 return (_ptrAudioDevice->SetSpeakerVolume(volume)); | 574 return (_ptrAudioDevice->SetSpeakerVolume(volume)); |
580 } | 575 } |
581 | 576 |
582 // ---------------------------------------------------------------------------- | 577 // ---------------------------------------------------------------------------- |
583 // SpeakerVolume | 578 // SpeakerVolume |
584 // ---------------------------------------------------------------------------- | 579 // ---------------------------------------------------------------------------- |
585 | 580 |
586 int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const { | 581 int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const { |
587 LOG(INFO) << __FUNCTION__; | 582 LOG(INFO) << __FUNCTION__; |
588 CHECK_INITIALIZED(); | 583 CHECK_INITIALIZED(); |
589 | 584 |
590 uint32_t level(0); | 585 uint32_t level(0); |
591 | 586 |
592 if (_ptrAudioDevice->SpeakerVolume(level) == -1) { | 587 if (_ptrAudioDevice->SpeakerVolume(level) == -1) { |
593 return -1; | 588 return -1; |
594 } | 589 } |
595 | 590 |
596 *volume = level; | 591 *volume = level; |
597 | 592 LOG(INFO) << "output: " << *volume; |
598 LOG(INFO) << __FUNCTION__ << " output: " << *volume; | |
599 return (0); | 593 return (0); |
600 } | 594 } |
601 | 595 |
602 // ---------------------------------------------------------------------------- | 596 // ---------------------------------------------------------------------------- |
603 // SetWaveOutVolume | 597 // SetWaveOutVolume |
604 // ---------------------------------------------------------------------------- | 598 // ---------------------------------------------------------------------------- |
605 | 599 |
606 int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft, | 600 int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft, |
607 uint16_t volumeRight) { | 601 uint16_t volumeRight) { |
608 LOG(INFO) << __FUNCTION__ << "(" << volumeLeft << ", " << volumeRight << ")"; | 602 LOG(INFO) << __FUNCTION__ << "(" << volumeLeft << ", " << volumeRight << ")"; |
(...skipping 12 matching lines...) Expand all Loading... |
621 | 615 |
622 uint16_t volLeft(0); | 616 uint16_t volLeft(0); |
623 uint16_t volRight(0); | 617 uint16_t volRight(0); |
624 | 618 |
625 if (_ptrAudioDevice->WaveOutVolume(volLeft, volRight) == -1) { | 619 if (_ptrAudioDevice->WaveOutVolume(volLeft, volRight) == -1) { |
626 return -1; | 620 return -1; |
627 } | 621 } |
628 | 622 |
629 *volumeLeft = volLeft; | 623 *volumeLeft = volLeft; |
630 *volumeRight = volRight; | 624 *volumeRight = volRight; |
631 | 625 LOG(INFO) << "output: " << *volumeLeft << ", " << *volumeRight; |
632 LOG(INFO) << __FUNCTION__ << " output: volumeLeft = " << *volumeLeft | |
633 << ", volumeRight = " << *volumeRight; | |
634 | 626 |
635 return (0); | 627 return (0); |
636 } | 628 } |
637 | 629 |
638 // ---------------------------------------------------------------------------- | 630 // ---------------------------------------------------------------------------- |
639 // SpeakerIsInitialized | 631 // SpeakerIsInitialized |
640 // ---------------------------------------------------------------------------- | 632 // ---------------------------------------------------------------------------- |
641 | 633 |
642 bool AudioDeviceModuleImpl::SpeakerIsInitialized() const { | 634 bool AudioDeviceModuleImpl::SpeakerIsInitialized() const { |
643 LOG(INFO) << __FUNCTION__; | 635 LOG(INFO) << __FUNCTION__; |
644 CHECK_INITIALIZED_BOOL(); | 636 CHECK_INITIALIZED_BOOL(); |
645 | 637 |
646 bool isInitialized = _ptrAudioDevice->SpeakerIsInitialized(); | 638 bool isInitialized = _ptrAudioDevice->SpeakerIsInitialized(); |
647 | 639 LOG(INFO) << "output: " << isInitialized; |
648 if (isInitialized) { | |
649 LOG(INFO) << __FUNCTION__ << " output: initialized"; | |
650 } else { | |
651 LOG(INFO) << __FUNCTION__ << " output: not initialized"; | |
652 } | |
653 return (isInitialized); | 640 return (isInitialized); |
654 } | 641 } |
655 | 642 |
656 // ---------------------------------------------------------------------------- | 643 // ---------------------------------------------------------------------------- |
657 // MicrophoneIsInitialized | 644 // MicrophoneIsInitialized |
658 // ---------------------------------------------------------------------------- | 645 // ---------------------------------------------------------------------------- |
659 | 646 |
660 bool AudioDeviceModuleImpl::MicrophoneIsInitialized() const { | 647 bool AudioDeviceModuleImpl::MicrophoneIsInitialized() const { |
661 LOG(INFO) << __FUNCTION__; | 648 LOG(INFO) << __FUNCTION__; |
662 CHECK_INITIALIZED_BOOL(); | 649 CHECK_INITIALIZED_BOOL(); |
663 | 650 |
664 bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized(); | 651 bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized(); |
665 | 652 LOG(INFO) << "output: " << isInitialized; |
666 if (isInitialized) { | |
667 LOG(INFO) << __FUNCTION__ << " output: initialized"; | |
668 } else { | |
669 LOG(INFO) << __FUNCTION__ << " output: not initialized"; | |
670 } | |
671 return (isInitialized); | 653 return (isInitialized); |
672 } | 654 } |
673 | 655 |
674 // ---------------------------------------------------------------------------- | 656 // ---------------------------------------------------------------------------- |
675 // MaxSpeakerVolume | 657 // MaxSpeakerVolume |
676 // ---------------------------------------------------------------------------- | 658 // ---------------------------------------------------------------------------- |
677 | 659 |
678 int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { | 660 int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { |
679 LOG(INFO) << __FUNCTION__; | 661 LOG(INFO) << __FUNCTION__; |
680 CHECK_INITIALIZED(); | 662 CHECK_INITIALIZED(); |
681 | 663 |
682 uint32_t maxVol(0); | 664 uint32_t maxVol(0); |
683 | 665 |
684 if (_ptrAudioDevice->MaxSpeakerVolume(maxVol) == -1) { | 666 if (_ptrAudioDevice->MaxSpeakerVolume(maxVol) == -1) { |
685 return -1; | 667 return -1; |
686 } | 668 } |
687 | 669 |
688 *maxVolume = maxVol; | 670 *maxVolume = maxVol; |
689 | 671 LOG(INFO) << "output: " << *maxVolume; |
690 LOG(INFO) << __FUNCTION__ << " output: maxVolume = " << *maxVolume; | |
691 return (0); | 672 return (0); |
692 } | 673 } |
693 | 674 |
694 // ---------------------------------------------------------------------------- | 675 // ---------------------------------------------------------------------------- |
695 // MinSpeakerVolume | 676 // MinSpeakerVolume |
696 // ---------------------------------------------------------------------------- | 677 // ---------------------------------------------------------------------------- |
697 | 678 |
698 int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { | 679 int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { |
699 LOG(INFO) << __FUNCTION__; | 680 LOG(INFO) << __FUNCTION__; |
700 CHECK_INITIALIZED(); | 681 CHECK_INITIALIZED(); |
701 | 682 |
702 uint32_t minVol(0); | 683 uint32_t minVol(0); |
703 | 684 |
704 if (_ptrAudioDevice->MinSpeakerVolume(minVol) == -1) { | 685 if (_ptrAudioDevice->MinSpeakerVolume(minVol) == -1) { |
705 return -1; | 686 return -1; |
706 } | 687 } |
707 | 688 |
708 *minVolume = minVol; | 689 *minVolume = minVol; |
709 | 690 LOG(INFO) << "output: " << *minVolume; |
710 LOG(INFO) << __FUNCTION__ << " output: " << *minVolume; | |
711 return (0); | 691 return (0); |
712 } | 692 } |
713 | 693 |
714 // ---------------------------------------------------------------------------- | 694 // ---------------------------------------------------------------------------- |
715 // SpeakerVolumeStepSize | 695 // SpeakerVolumeStepSize |
716 // ---------------------------------------------------------------------------- | 696 // ---------------------------------------------------------------------------- |
717 | 697 |
718 int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const { | 698 int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const { |
719 LOG(INFO) << __FUNCTION__; | 699 LOG(INFO) << __FUNCTION__; |
720 CHECK_INITIALIZED(); | 700 CHECK_INITIALIZED(); |
721 | 701 |
722 uint16_t delta(0); | 702 uint16_t delta(0); |
723 | 703 |
724 if (_ptrAudioDevice->SpeakerVolumeStepSize(delta) == -1) { | 704 if (_ptrAudioDevice->SpeakerVolumeStepSize(delta) == -1) { |
725 LOG(LERROR) << "failed to retrieve the speaker-volume step size"; | 705 LOG(LERROR) << "failed to retrieve the speaker-volume step size"; |
726 return -1; | 706 return -1; |
727 } | 707 } |
728 | 708 |
729 *stepSize = delta; | 709 *stepSize = delta; |
730 | 710 LOG(INFO) << "output: " << *stepSize; |
731 LOG(INFO) << __FUNCTION__ << " output: " << *stepSize; | |
732 return (0); | 711 return (0); |
733 } | 712 } |
734 | 713 |
735 // ---------------------------------------------------------------------------- | 714 // ---------------------------------------------------------------------------- |
736 // SpeakerMuteIsAvailable | 715 // SpeakerMuteIsAvailable |
737 // ---------------------------------------------------------------------------- | 716 // ---------------------------------------------------------------------------- |
738 | 717 |
739 int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) { | 718 int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) { |
740 LOG(INFO) << __FUNCTION__; | 719 LOG(INFO) << __FUNCTION__; |
741 CHECK_INITIALIZED(); | 720 CHECK_INITIALIZED(); |
742 | 721 |
743 bool isAvailable(0); | 722 bool isAvailable(0); |
744 | 723 |
745 if (_ptrAudioDevice->SpeakerMuteIsAvailable(isAvailable) == -1) { | 724 if (_ptrAudioDevice->SpeakerMuteIsAvailable(isAvailable) == -1) { |
746 return -1; | 725 return -1; |
747 } | 726 } |
748 | 727 |
749 *available = isAvailable; | 728 *available = isAvailable; |
750 | 729 LOG(INFO) << "output: " << isAvailable; |
751 if (isAvailable) { | |
752 LOG(INFO) << __FUNCTION__ << " output: available"; | |
753 } else { | |
754 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
755 } | |
756 return (0); | 730 return (0); |
757 } | 731 } |
758 | 732 |
759 // ---------------------------------------------------------------------------- | 733 // ---------------------------------------------------------------------------- |
760 // SetSpeakerMute | 734 // SetSpeakerMute |
761 // ---------------------------------------------------------------------------- | 735 // ---------------------------------------------------------------------------- |
762 | 736 |
763 int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable) { | 737 int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable) { |
764 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 738 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
765 CHECK_INITIALIZED(); | 739 CHECK_INITIALIZED(); |
766 return (_ptrAudioDevice->SetSpeakerMute(enable)); | 740 return (_ptrAudioDevice->SetSpeakerMute(enable)); |
767 } | 741 } |
768 | 742 |
769 // ---------------------------------------------------------------------------- | 743 // ---------------------------------------------------------------------------- |
770 // SpeakerMute | 744 // SpeakerMute |
771 // ---------------------------------------------------------------------------- | 745 // ---------------------------------------------------------------------------- |
772 | 746 |
773 int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const { | 747 int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const { |
774 LOG(INFO) << __FUNCTION__; | 748 LOG(INFO) << __FUNCTION__; |
775 CHECK_INITIALIZED(); | 749 CHECK_INITIALIZED(); |
776 | 750 |
777 bool muted(false); | 751 bool muted(false); |
778 | 752 |
779 if (_ptrAudioDevice->SpeakerMute(muted) == -1) { | 753 if (_ptrAudioDevice->SpeakerMute(muted) == -1) { |
780 return -1; | 754 return -1; |
781 } | 755 } |
782 | 756 |
783 *enabled = muted; | 757 *enabled = muted; |
784 | 758 LOG(INFO) << "output: " << muted; |
785 if (muted) { | |
786 LOG(INFO) << __FUNCTION__ << " output: muted"; | |
787 } else { | |
788 LOG(INFO) << __FUNCTION__ << " output: not muted"; | |
789 } | |
790 return (0); | 759 return (0); |
791 } | 760 } |
792 | 761 |
793 // ---------------------------------------------------------------------------- | 762 // ---------------------------------------------------------------------------- |
794 // MicrophoneMuteIsAvailable | 763 // MicrophoneMuteIsAvailable |
795 // ---------------------------------------------------------------------------- | 764 // ---------------------------------------------------------------------------- |
796 | 765 |
797 int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) { | 766 int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) { |
798 LOG(INFO) << __FUNCTION__; | 767 LOG(INFO) << __FUNCTION__; |
799 CHECK_INITIALIZED(); | 768 CHECK_INITIALIZED(); |
800 | 769 |
801 bool isAvailable(0); | 770 bool isAvailable(0); |
802 | 771 |
803 if (_ptrAudioDevice->MicrophoneMuteIsAvailable(isAvailable) == -1) { | 772 if (_ptrAudioDevice->MicrophoneMuteIsAvailable(isAvailable) == -1) { |
804 return -1; | 773 return -1; |
805 } | 774 } |
806 | 775 |
807 *available = isAvailable; | 776 *available = isAvailable; |
808 | 777 LOG(INFO) << "output: " << isAvailable; |
809 if (isAvailable) { | |
810 LOG(INFO) << __FUNCTION__ << " output: available"; | |
811 } else { | |
812 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
813 } | |
814 return (0); | 778 return (0); |
815 } | 779 } |
816 | 780 |
817 // ---------------------------------------------------------------------------- | 781 // ---------------------------------------------------------------------------- |
818 // SetMicrophoneMute | 782 // SetMicrophoneMute |
819 // ---------------------------------------------------------------------------- | 783 // ---------------------------------------------------------------------------- |
820 | 784 |
821 int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable) { | 785 int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable) { |
822 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 786 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
823 CHECK_INITIALIZED(); | 787 CHECK_INITIALIZED(); |
824 return (_ptrAudioDevice->SetMicrophoneMute(enable)); | 788 return (_ptrAudioDevice->SetMicrophoneMute(enable)); |
825 } | 789 } |
826 | 790 |
827 // ---------------------------------------------------------------------------- | 791 // ---------------------------------------------------------------------------- |
828 // MicrophoneMute | 792 // MicrophoneMute |
829 // ---------------------------------------------------------------------------- | 793 // ---------------------------------------------------------------------------- |
830 | 794 |
831 int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const { | 795 int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const { |
832 LOG(INFO) << __FUNCTION__; | 796 LOG(INFO) << __FUNCTION__; |
833 CHECK_INITIALIZED(); | 797 CHECK_INITIALIZED(); |
834 | 798 |
835 bool muted(false); | 799 bool muted(false); |
836 | 800 |
837 if (_ptrAudioDevice->MicrophoneMute(muted) == -1) { | 801 if (_ptrAudioDevice->MicrophoneMute(muted) == -1) { |
838 return -1; | 802 return -1; |
839 } | 803 } |
840 | 804 |
841 *enabled = muted; | 805 *enabled = muted; |
842 | 806 LOG(INFO) << "output: " << muted; |
843 if (muted) { | |
844 LOG(INFO) << __FUNCTION__ << " output: muted"; | |
845 } else { | |
846 LOG(INFO) << __FUNCTION__ << " output: not muted"; | |
847 } | |
848 return (0); | 807 return (0); |
849 } | 808 } |
850 | 809 |
851 // ---------------------------------------------------------------------------- | 810 // ---------------------------------------------------------------------------- |
852 // MicrophoneBoostIsAvailable | 811 // MicrophoneBoostIsAvailable |
853 // ---------------------------------------------------------------------------- | 812 // ---------------------------------------------------------------------------- |
854 | 813 |
855 int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) { | 814 int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) { |
856 LOG(INFO) << __FUNCTION__; | 815 LOG(INFO) << __FUNCTION__; |
857 CHECK_INITIALIZED(); | 816 CHECK_INITIALIZED(); |
858 | 817 |
859 bool isAvailable(0); | 818 bool isAvailable(0); |
860 | 819 |
861 if (_ptrAudioDevice->MicrophoneBoostIsAvailable(isAvailable) == -1) { | 820 if (_ptrAudioDevice->MicrophoneBoostIsAvailable(isAvailable) == -1) { |
862 return -1; | 821 return -1; |
863 } | 822 } |
864 | 823 |
865 *available = isAvailable; | 824 *available = isAvailable; |
866 | 825 LOG(INFO) << "output: " << isAvailable; |
867 if (isAvailable) { | |
868 LOG(INFO) << __FUNCTION__ << " output: available"; | |
869 } else { | |
870 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
871 } | |
872 return (0); | 826 return (0); |
873 } | 827 } |
874 | 828 |
875 // ---------------------------------------------------------------------------- | 829 // ---------------------------------------------------------------------------- |
876 // SetMicrophoneBoost | 830 // SetMicrophoneBoost |
877 // ---------------------------------------------------------------------------- | 831 // ---------------------------------------------------------------------------- |
878 | 832 |
879 int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable) { | 833 int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable) { |
880 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 834 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
881 CHECK_INITIALIZED(); | 835 CHECK_INITIALIZED(); |
882 return (_ptrAudioDevice->SetMicrophoneBoost(enable)); | 836 return (_ptrAudioDevice->SetMicrophoneBoost(enable)); |
883 } | 837 } |
884 | 838 |
885 // ---------------------------------------------------------------------------- | 839 // ---------------------------------------------------------------------------- |
886 // MicrophoneBoost | 840 // MicrophoneBoost |
887 // ---------------------------------------------------------------------------- | 841 // ---------------------------------------------------------------------------- |
888 | 842 |
889 int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const { | 843 int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const { |
890 LOG(INFO) << __FUNCTION__; | 844 LOG(INFO) << __FUNCTION__; |
891 CHECK_INITIALIZED(); | 845 CHECK_INITIALIZED(); |
892 | 846 |
893 bool onOff(false); | 847 bool onOff(false); |
894 | 848 |
895 if (_ptrAudioDevice->MicrophoneBoost(onOff) == -1) { | 849 if (_ptrAudioDevice->MicrophoneBoost(onOff) == -1) { |
896 return -1; | 850 return -1; |
897 } | 851 } |
898 | 852 |
899 *enabled = onOff; | 853 *enabled = onOff; |
900 | 854 LOG(INFO) << "output: " << onOff; |
901 if (onOff) { | |
902 LOG(INFO) << __FUNCTION__ << " output: enabled"; | |
903 } else { | |
904 LOG(INFO) << __FUNCTION__ << " output: not enabled"; | |
905 } | |
906 return (0); | 855 return (0); |
907 } | 856 } |
908 | 857 |
909 // ---------------------------------------------------------------------------- | 858 // ---------------------------------------------------------------------------- |
910 // MicrophoneVolumeIsAvailable | 859 // MicrophoneVolumeIsAvailable |
911 // ---------------------------------------------------------------------------- | 860 // ---------------------------------------------------------------------------- |
912 | 861 |
913 int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) { | 862 int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) { |
914 LOG(INFO) << __FUNCTION__; | 863 LOG(INFO) << __FUNCTION__; |
915 CHECK_INITIALIZED(); | 864 CHECK_INITIALIZED(); |
916 | 865 |
917 bool isAvailable(0); | 866 bool isAvailable(0); |
918 | 867 |
919 if (_ptrAudioDevice->MicrophoneVolumeIsAvailable(isAvailable) == -1) { | 868 if (_ptrAudioDevice->MicrophoneVolumeIsAvailable(isAvailable) == -1) { |
920 return -1; | 869 return -1; |
921 } | 870 } |
922 | 871 |
923 *available = isAvailable; | 872 *available = isAvailable; |
924 | 873 LOG(INFO) << "output: " << isAvailable; |
925 if (isAvailable) { | |
926 LOG(INFO) << __FUNCTION__ << " output: available"; | |
927 } else { | |
928 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
929 } | |
930 return (0); | 874 return (0); |
931 } | 875 } |
932 | 876 |
933 // ---------------------------------------------------------------------------- | 877 // ---------------------------------------------------------------------------- |
934 // SetMicrophoneVolume | 878 // SetMicrophoneVolume |
935 // ---------------------------------------------------------------------------- | 879 // ---------------------------------------------------------------------------- |
936 | 880 |
937 int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume) { | 881 int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume) { |
938 LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; | 882 LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; |
939 CHECK_INITIALIZED(); | 883 CHECK_INITIALIZED(); |
940 return (_ptrAudioDevice->SetMicrophoneVolume(volume)); | 884 return (_ptrAudioDevice->SetMicrophoneVolume(volume)); |
941 } | 885 } |
942 | 886 |
943 // ---------------------------------------------------------------------------- | 887 // ---------------------------------------------------------------------------- |
944 // MicrophoneVolume | 888 // MicrophoneVolume |
945 // ---------------------------------------------------------------------------- | 889 // ---------------------------------------------------------------------------- |
946 | 890 |
947 int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const { | 891 int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const { |
948 LOG(INFO) << __FUNCTION__; | 892 LOG(INFO) << __FUNCTION__; |
949 CHECK_INITIALIZED(); | 893 CHECK_INITIALIZED(); |
950 | 894 |
951 uint32_t level(0); | 895 uint32_t level(0); |
952 | 896 |
953 if (_ptrAudioDevice->MicrophoneVolume(level) == -1) { | 897 if (_ptrAudioDevice->MicrophoneVolume(level) == -1) { |
954 return -1; | 898 return -1; |
955 } | 899 } |
956 | 900 |
957 *volume = level; | 901 *volume = level; |
958 | 902 LOG(INFO) << "output: " << *volume; |
959 LOG(INFO) << __FUNCTION__ << " output: volume = " << *volume; | |
960 return (0); | 903 return (0); |
961 } | 904 } |
962 | 905 |
963 // ---------------------------------------------------------------------------- | 906 // ---------------------------------------------------------------------------- |
964 // StereoRecordingIsAvailable | 907 // StereoRecordingIsAvailable |
965 // ---------------------------------------------------------------------------- | 908 // ---------------------------------------------------------------------------- |
966 | 909 |
967 int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable( | 910 int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable( |
968 bool* available) const { | 911 bool* available) const { |
969 LOG(INFO) << __FUNCTION__; | 912 LOG(INFO) << __FUNCTION__; |
970 CHECK_INITIALIZED(); | 913 CHECK_INITIALIZED(); |
971 | 914 |
972 bool isAvailable(0); | 915 bool isAvailable(0); |
973 | 916 |
974 if (_ptrAudioDevice->StereoRecordingIsAvailable(isAvailable) == -1) { | 917 if (_ptrAudioDevice->StereoRecordingIsAvailable(isAvailable) == -1) { |
975 return -1; | 918 return -1; |
976 } | 919 } |
977 | 920 |
978 *available = isAvailable; | 921 *available = isAvailable; |
979 | 922 LOG(INFO) << "output: " << isAvailable; |
980 if (isAvailable) { | |
981 LOG(INFO) << __FUNCTION__ << " output: available"; | |
982 } else { | |
983 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
984 } | |
985 return (0); | 923 return (0); |
986 } | 924 } |
987 | 925 |
988 // ---------------------------------------------------------------------------- | 926 // ---------------------------------------------------------------------------- |
989 // SetStereoRecording | 927 // SetStereoRecording |
990 // ---------------------------------------------------------------------------- | 928 // ---------------------------------------------------------------------------- |
991 | 929 |
992 int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) { | 930 int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) { |
993 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 931 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
994 CHECK_INITIALIZED(); | 932 CHECK_INITIALIZED(); |
995 | 933 |
996 if (_ptrAudioDevice->RecordingIsInitialized()) { | 934 if (_ptrAudioDevice->RecordingIsInitialized()) { |
997 LOG(WARNING) << "recording in stereo is not supported"; | 935 LOG(WARNING) << "recording in stereo is not supported"; |
998 return -1; | 936 return -1; |
999 } | 937 } |
1000 | 938 |
1001 if (_ptrAudioDevice->SetStereoRecording(enable) == -1) { | 939 if (_ptrAudioDevice->SetStereoRecording(enable) == -1) { |
1002 if (enable) { | 940 LOG(WARNING) << "failed to change stereo recording"; |
1003 LOG(WARNING) << "failed to enable stereo recording"; | |
1004 } else { | |
1005 LOG(WARNING) << "failed to disable stereo recording"; | |
1006 } | |
1007 return -1; | 941 return -1; |
1008 } | 942 } |
1009 | 943 |
1010 int8_t nChannels(1); | 944 int8_t nChannels(1); |
1011 if (enable) { | 945 if (enable) { |
1012 nChannels = 2; | 946 nChannels = 2; |
1013 } | 947 } |
1014 _audioDeviceBuffer.SetRecordingChannels(nChannels); | 948 _audioDeviceBuffer.SetRecordingChannels(nChannels); |
1015 | 949 |
1016 return 0; | 950 return 0; |
1017 } | 951 } |
1018 | 952 |
1019 // ---------------------------------------------------------------------------- | 953 // ---------------------------------------------------------------------------- |
1020 // StereoRecording | 954 // StereoRecording |
1021 // ---------------------------------------------------------------------------- | 955 // ---------------------------------------------------------------------------- |
1022 | 956 |
1023 int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const { | 957 int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const { |
1024 LOG(INFO) << __FUNCTION__; | 958 LOG(INFO) << __FUNCTION__; |
1025 CHECK_INITIALIZED(); | 959 CHECK_INITIALIZED(); |
1026 | 960 |
1027 bool stereo(false); | 961 bool stereo(false); |
1028 | 962 |
1029 if (_ptrAudioDevice->StereoRecording(stereo) == -1) { | 963 if (_ptrAudioDevice->StereoRecording(stereo) == -1) { |
1030 return -1; | 964 return -1; |
1031 } | 965 } |
1032 | 966 |
1033 *enabled = stereo; | 967 *enabled = stereo; |
1034 | 968 LOG(INFO) << "output: " << stereo; |
1035 if (stereo) { | |
1036 LOG(INFO) << __FUNCTION__ << " output: enabled"; | |
1037 } else { | |
1038 LOG(INFO) << __FUNCTION__ << " output: not enabled"; | |
1039 } | |
1040 return (0); | 969 return (0); |
1041 } | 970 } |
1042 | 971 |
1043 // ---------------------------------------------------------------------------- | 972 // ---------------------------------------------------------------------------- |
1044 // SetRecordingChannel | 973 // SetRecordingChannel |
1045 // ---------------------------------------------------------------------------- | 974 // ---------------------------------------------------------------------------- |
1046 | 975 |
1047 int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) { | 976 int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) { |
1048 if (channel == kChannelBoth) { | 977 if (channel == kChannelBoth) { |
1049 LOG(INFO) << __FUNCTION__ << "(both)"; | 978 LOG(INFO) << __FUNCTION__ << "(both)"; |
(...skipping 22 matching lines...) Expand all Loading... |
1072 LOG(INFO) << __FUNCTION__; | 1001 LOG(INFO) << __FUNCTION__; |
1073 CHECK_INITIALIZED(); | 1002 CHECK_INITIALIZED(); |
1074 | 1003 |
1075 ChannelType chType; | 1004 ChannelType chType; |
1076 | 1005 |
1077 if (_audioDeviceBuffer.RecordingChannel(chType) == -1) { | 1006 if (_audioDeviceBuffer.RecordingChannel(chType) == -1) { |
1078 return -1; | 1007 return -1; |
1079 } | 1008 } |
1080 | 1009 |
1081 *channel = chType; | 1010 *channel = chType; |
1082 | |
1083 if (*channel == kChannelBoth) { | 1011 if (*channel == kChannelBoth) { |
1084 LOG(INFO) << __FUNCTION__ << " output: both"; | 1012 LOG(INFO) << "output: both"; |
1085 } else if (*channel == kChannelLeft) { | 1013 } else if (*channel == kChannelLeft) { |
1086 LOG(INFO) << __FUNCTION__ << " output: left"; | 1014 LOG(INFO) << "output: left"; |
1087 } else { | 1015 } else { |
1088 LOG(INFO) << __FUNCTION__ << " output: right"; | 1016 LOG(INFO) << "output: right"; |
1089 } | 1017 } |
1090 | |
1091 return (0); | 1018 return (0); |
1092 } | 1019 } |
1093 | 1020 |
1094 // ---------------------------------------------------------------------------- | 1021 // ---------------------------------------------------------------------------- |
1095 // StereoPlayoutIsAvailable | 1022 // StereoPlayoutIsAvailable |
1096 // ---------------------------------------------------------------------------- | 1023 // ---------------------------------------------------------------------------- |
1097 | 1024 |
1098 int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const { | 1025 int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const { |
1099 LOG(INFO) << __FUNCTION__; | 1026 LOG(INFO) << __FUNCTION__; |
1100 CHECK_INITIALIZED(); | 1027 CHECK_INITIALIZED(); |
1101 | 1028 |
1102 bool isAvailable(0); | 1029 bool isAvailable(0); |
1103 | 1030 |
1104 if (_ptrAudioDevice->StereoPlayoutIsAvailable(isAvailable) == -1) { | 1031 if (_ptrAudioDevice->StereoPlayoutIsAvailable(isAvailable) == -1) { |
1105 return -1; | 1032 return -1; |
1106 } | 1033 } |
1107 | 1034 |
1108 *available = isAvailable; | 1035 *available = isAvailable; |
1109 | 1036 LOG(INFO) << "output: " << isAvailable; |
1110 if (isAvailable) { | |
1111 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1112 } else { | |
1113 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1114 } | |
1115 return (0); | 1037 return (0); |
1116 } | 1038 } |
1117 | 1039 |
1118 // ---------------------------------------------------------------------------- | 1040 // ---------------------------------------------------------------------------- |
1119 // SetStereoPlayout | 1041 // SetStereoPlayout |
1120 // ---------------------------------------------------------------------------- | 1042 // ---------------------------------------------------------------------------- |
1121 | 1043 |
1122 int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) { | 1044 int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) { |
1123 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 1045 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
1124 CHECK_INITIALIZED(); | 1046 CHECK_INITIALIZED(); |
(...skipping 26 matching lines...) Expand all Loading... |
1151 LOG(INFO) << __FUNCTION__; | 1073 LOG(INFO) << __FUNCTION__; |
1152 CHECK_INITIALIZED(); | 1074 CHECK_INITIALIZED(); |
1153 | 1075 |
1154 bool stereo(false); | 1076 bool stereo(false); |
1155 | 1077 |
1156 if (_ptrAudioDevice->StereoPlayout(stereo) == -1) { | 1078 if (_ptrAudioDevice->StereoPlayout(stereo) == -1) { |
1157 return -1; | 1079 return -1; |
1158 } | 1080 } |
1159 | 1081 |
1160 *enabled = stereo; | 1082 *enabled = stereo; |
1161 | 1083 LOG(INFO) << "output: " << stereo; |
1162 if (stereo) { | |
1163 LOG(INFO) << __FUNCTION__ << " output: enabled"; | |
1164 } else { | |
1165 LOG(INFO) << __FUNCTION__ << " output: not enabled"; | |
1166 } | |
1167 return (0); | 1084 return (0); |
1168 } | 1085 } |
1169 | 1086 |
1170 // ---------------------------------------------------------------------------- | 1087 // ---------------------------------------------------------------------------- |
1171 // SetAGC | 1088 // SetAGC |
1172 // ---------------------------------------------------------------------------- | 1089 // ---------------------------------------------------------------------------- |
1173 | 1090 |
1174 int32_t AudioDeviceModuleImpl::SetAGC(bool enable) { | 1091 int32_t AudioDeviceModuleImpl::SetAGC(bool enable) { |
1175 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 1092 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
1176 CHECK_INITIALIZED(); | 1093 CHECK_INITIALIZED(); |
(...skipping 18 matching lines...) Expand all Loading... |
1195 LOG(INFO) << __FUNCTION__; | 1112 LOG(INFO) << __FUNCTION__; |
1196 CHECK_INITIALIZED(); | 1113 CHECK_INITIALIZED(); |
1197 | 1114 |
1198 bool isAvailable(0); | 1115 bool isAvailable(0); |
1199 | 1116 |
1200 if (_ptrAudioDevice->PlayoutIsAvailable(isAvailable) == -1) { | 1117 if (_ptrAudioDevice->PlayoutIsAvailable(isAvailable) == -1) { |
1201 return -1; | 1118 return -1; |
1202 } | 1119 } |
1203 | 1120 |
1204 *available = isAvailable; | 1121 *available = isAvailable; |
1205 | 1122 LOG(INFO) << "output: " << isAvailable; |
1206 if (isAvailable) { | |
1207 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1208 } else { | |
1209 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1210 } | |
1211 return (0); | 1123 return (0); |
1212 } | 1124 } |
1213 | 1125 |
1214 // ---------------------------------------------------------------------------- | 1126 // ---------------------------------------------------------------------------- |
1215 // RecordingIsAvailable | 1127 // RecordingIsAvailable |
1216 // ---------------------------------------------------------------------------- | 1128 // ---------------------------------------------------------------------------- |
1217 | 1129 |
1218 int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) { | 1130 int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) { |
1219 LOG(INFO) << __FUNCTION__; | 1131 LOG(INFO) << __FUNCTION__; |
1220 CHECK_INITIALIZED(); | 1132 CHECK_INITIALIZED(); |
1221 | 1133 |
1222 bool isAvailable(0); | 1134 bool isAvailable(0); |
1223 | 1135 |
1224 if (_ptrAudioDevice->RecordingIsAvailable(isAvailable) == -1) { | 1136 if (_ptrAudioDevice->RecordingIsAvailable(isAvailable) == -1) { |
1225 return -1; | 1137 return -1; |
1226 } | 1138 } |
1227 | 1139 |
1228 *available = isAvailable; | 1140 *available = isAvailable; |
1229 | 1141 LOG(INFO) << "output: " << isAvailable; |
1230 if (isAvailable) { | |
1231 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1232 } else { | |
1233 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1234 } | |
1235 return (0); | 1142 return (0); |
1236 } | 1143 } |
1237 | 1144 |
1238 // ---------------------------------------------------------------------------- | 1145 // ---------------------------------------------------------------------------- |
1239 // MaxMicrophoneVolume | 1146 // MaxMicrophoneVolume |
1240 // ---------------------------------------------------------------------------- | 1147 // ---------------------------------------------------------------------------- |
1241 | 1148 |
1242 int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { | 1149 int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { |
1243 LOG(INFO) << __FUNCTION__; | 1150 LOG(INFO) << __FUNCTION__; |
1244 CHECK_INITIALIZED(); | 1151 CHECK_INITIALIZED(); |
1245 | 1152 |
1246 uint32_t maxVol(0); | 1153 uint32_t maxVol(0); |
1247 | 1154 |
1248 if (_ptrAudioDevice->MaxMicrophoneVolume(maxVol) == -1) { | 1155 if (_ptrAudioDevice->MaxMicrophoneVolume(maxVol) == -1) { |
1249 return -1; | 1156 return -1; |
1250 } | 1157 } |
1251 | 1158 |
1252 *maxVolume = maxVol; | 1159 *maxVolume = maxVol; |
1253 | 1160 LOG(INFO) << "output: " << *maxVolume; |
1254 LOG(INFO) << __FUNCTION__ << " output: = " << *maxVolume; | |
1255 return (0); | 1161 return (0); |
1256 } | 1162 } |
1257 | 1163 |
1258 // ---------------------------------------------------------------------------- | 1164 // ---------------------------------------------------------------------------- |
1259 // MinMicrophoneVolume | 1165 // MinMicrophoneVolume |
1260 // ---------------------------------------------------------------------------- | 1166 // ---------------------------------------------------------------------------- |
1261 | 1167 |
1262 int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { | 1168 int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { |
1263 LOG(INFO) << __FUNCTION__; | 1169 LOG(INFO) << __FUNCTION__; |
1264 CHECK_INITIALIZED(); | 1170 CHECK_INITIALIZED(); |
1265 | 1171 |
1266 uint32_t minVol(0); | 1172 uint32_t minVol(0); |
1267 | 1173 |
1268 if (_ptrAudioDevice->MinMicrophoneVolume(minVol) == -1) { | 1174 if (_ptrAudioDevice->MinMicrophoneVolume(minVol) == -1) { |
1269 return -1; | 1175 return -1; |
1270 } | 1176 } |
1271 | 1177 |
1272 *minVolume = minVol; | 1178 *minVolume = minVol; |
1273 | 1179 LOG(INFO) << "output: " << *minVolume; |
1274 LOG(INFO) << __FUNCTION__ << " output: = " << *minVolume; | |
1275 return (0); | 1180 return (0); |
1276 } | 1181 } |
1277 | 1182 |
1278 // ---------------------------------------------------------------------------- | 1183 // ---------------------------------------------------------------------------- |
1279 // MicrophoneVolumeStepSize | 1184 // MicrophoneVolumeStepSize |
1280 // ---------------------------------------------------------------------------- | 1185 // ---------------------------------------------------------------------------- |
1281 | 1186 |
1282 int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( | 1187 int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( |
1283 uint16_t* stepSize) const { | 1188 uint16_t* stepSize) const { |
1284 LOG(INFO) << __FUNCTION__; | 1189 LOG(INFO) << __FUNCTION__; |
1285 CHECK_INITIALIZED(); | 1190 CHECK_INITIALIZED(); |
1286 | 1191 |
1287 uint16_t delta(0); | 1192 uint16_t delta(0); |
1288 | 1193 |
1289 if (_ptrAudioDevice->MicrophoneVolumeStepSize(delta) == -1) { | 1194 if (_ptrAudioDevice->MicrophoneVolumeStepSize(delta) == -1) { |
1290 return -1; | 1195 return -1; |
1291 } | 1196 } |
1292 | 1197 |
1293 *stepSize = delta; | 1198 *stepSize = delta; |
1294 | 1199 LOG(INFO) << "output: " << *stepSize; |
1295 LOG(INFO) << __FUNCTION__ << " output: " << *stepSize; | |
1296 return (0); | 1200 return (0); |
1297 } | 1201 } |
1298 | 1202 |
1299 // ---------------------------------------------------------------------------- | 1203 // ---------------------------------------------------------------------------- |
1300 // PlayoutDevices | 1204 // PlayoutDevices |
1301 // ---------------------------------------------------------------------------- | 1205 // ---------------------------------------------------------------------------- |
1302 | 1206 |
1303 int16_t AudioDeviceModuleImpl::PlayoutDevices() { | 1207 int16_t AudioDeviceModuleImpl::PlayoutDevices() { |
1304 LOG(INFO) << __FUNCTION__; | 1208 LOG(INFO) << __FUNCTION__; |
1305 CHECK_INITIALIZED(); | 1209 CHECK_INITIALIZED(); |
1306 | 1210 |
1307 uint16_t nPlayoutDevices = _ptrAudioDevice->PlayoutDevices(); | 1211 uint16_t nPlayoutDevices = _ptrAudioDevice->PlayoutDevices(); |
1308 | 1212 LOG(INFO) << "output: " << nPlayoutDevices; |
1309 LOG(INFO) << __FUNCTION__ << " output: " << nPlayoutDevices; | |
1310 return ((int16_t)(nPlayoutDevices)); | 1213 return ((int16_t)(nPlayoutDevices)); |
1311 } | 1214 } |
1312 | 1215 |
1313 // ---------------------------------------------------------------------------- | 1216 // ---------------------------------------------------------------------------- |
1314 // SetPlayoutDevice I (II) | 1217 // SetPlayoutDevice I (II) |
1315 // ---------------------------------------------------------------------------- | 1218 // ---------------------------------------------------------------------------- |
1316 | 1219 |
1317 int32_t AudioDeviceModuleImpl::SetPlayoutDevice(uint16_t index) { | 1220 int32_t AudioDeviceModuleImpl::SetPlayoutDevice(uint16_t index) { |
1318 LOG(INFO) << __FUNCTION__ << "(" << index << ")"; | 1221 LOG(INFO) << __FUNCTION__ << "(" << index << ")"; |
1319 CHECK_INITIALIZED(); | 1222 CHECK_INITIALIZED(); |
1320 return (_ptrAudioDevice->SetPlayoutDevice(index)); | 1223 return (_ptrAudioDevice->SetPlayoutDevice(index)); |
1321 } | 1224 } |
1322 | 1225 |
1323 // ---------------------------------------------------------------------------- | 1226 // ---------------------------------------------------------------------------- |
1324 // SetPlayoutDevice II (II) | 1227 // SetPlayoutDevice II (II) |
1325 // ---------------------------------------------------------------------------- | 1228 // ---------------------------------------------------------------------------- |
1326 | 1229 |
1327 int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device) { | 1230 int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device) { |
1328 if (device == kDefaultDevice) { | |
1329 } else { | |
1330 } | |
1331 LOG(INFO) << __FUNCTION__; | 1231 LOG(INFO) << __FUNCTION__; |
1332 CHECK_INITIALIZED(); | 1232 CHECK_INITIALIZED(); |
1333 | 1233 |
1334 return (_ptrAudioDevice->SetPlayoutDevice(device)); | 1234 return (_ptrAudioDevice->SetPlayoutDevice(device)); |
1335 } | 1235 } |
1336 | 1236 |
1337 // ---------------------------------------------------------------------------- | 1237 // ---------------------------------------------------------------------------- |
1338 // PlayoutDeviceName | 1238 // PlayoutDeviceName |
1339 // ---------------------------------------------------------------------------- | 1239 // ---------------------------------------------------------------------------- |
1340 | 1240 |
1341 int32_t AudioDeviceModuleImpl::PlayoutDeviceName( | 1241 int32_t AudioDeviceModuleImpl::PlayoutDeviceName( |
1342 uint16_t index, | 1242 uint16_t index, |
1343 char name[kAdmMaxDeviceNameSize], | 1243 char name[kAdmMaxDeviceNameSize], |
1344 char guid[kAdmMaxGuidSize]) { | 1244 char guid[kAdmMaxGuidSize]) { |
1345 LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; | 1245 LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; |
1346 CHECK_INITIALIZED(); | 1246 CHECK_INITIALIZED(); |
1347 | 1247 |
1348 if (name == NULL) { | 1248 if (name == NULL) { |
1349 _lastError = kAdmErrArgument; | 1249 _lastError = kAdmErrArgument; |
1350 return -1; | 1250 return -1; |
1351 } | 1251 } |
1352 | 1252 |
1353 if (_ptrAudioDevice->PlayoutDeviceName(index, name, guid) == -1) { | 1253 if (_ptrAudioDevice->PlayoutDeviceName(index, name, guid) == -1) { |
1354 return -1; | 1254 return -1; |
1355 } | 1255 } |
1356 | 1256 |
1357 if (name != NULL) { | 1257 if (name != NULL) { |
1358 LOG(INFO) << __FUNCTION__ << " output: name = " << name; | 1258 LOG(INFO) << "output: name = " << name; |
1359 } | 1259 } |
1360 if (guid != NULL) { | 1260 if (guid != NULL) { |
1361 LOG(INFO) << __FUNCTION__ << " output: guid = " << guid; | 1261 LOG(INFO) << "output: guid = " << guid; |
1362 } | 1262 } |
1363 | 1263 |
1364 return (0); | 1264 return (0); |
1365 } | 1265 } |
1366 | 1266 |
1367 // ---------------------------------------------------------------------------- | 1267 // ---------------------------------------------------------------------------- |
1368 // RecordingDeviceName | 1268 // RecordingDeviceName |
1369 // ---------------------------------------------------------------------------- | 1269 // ---------------------------------------------------------------------------- |
1370 | 1270 |
1371 int32_t AudioDeviceModuleImpl::RecordingDeviceName( | 1271 int32_t AudioDeviceModuleImpl::RecordingDeviceName( |
1372 uint16_t index, | 1272 uint16_t index, |
1373 char name[kAdmMaxDeviceNameSize], | 1273 char name[kAdmMaxDeviceNameSize], |
1374 char guid[kAdmMaxGuidSize]) { | 1274 char guid[kAdmMaxGuidSize]) { |
1375 LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; | 1275 LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; |
1376 CHECK_INITIALIZED(); | 1276 CHECK_INITIALIZED(); |
1377 | 1277 |
1378 if (name == NULL) { | 1278 if (name == NULL) { |
1379 _lastError = kAdmErrArgument; | 1279 _lastError = kAdmErrArgument; |
1380 return -1; | 1280 return -1; |
1381 } | 1281 } |
1382 | 1282 |
1383 if (_ptrAudioDevice->RecordingDeviceName(index, name, guid) == -1) { | 1283 if (_ptrAudioDevice->RecordingDeviceName(index, name, guid) == -1) { |
1384 return -1; | 1284 return -1; |
1385 } | 1285 } |
1386 | 1286 |
1387 if (name != NULL) { | 1287 if (name != NULL) { |
1388 LOG(INFO) << __FUNCTION__ << " output: name = " << name; | 1288 LOG(INFO) << "output: name = " << name; |
1389 } | 1289 } |
1390 if (guid != NULL) { | 1290 if (guid != NULL) { |
1391 LOG(INFO) << __FUNCTION__ << " output: guid = " << guid; | 1291 LOG(INFO) << "output: guid = " << guid; |
1392 } | 1292 } |
1393 | 1293 |
1394 return (0); | 1294 return (0); |
1395 } | 1295 } |
1396 | 1296 |
1397 // ---------------------------------------------------------------------------- | 1297 // ---------------------------------------------------------------------------- |
1398 // RecordingDevices | 1298 // RecordingDevices |
1399 // ---------------------------------------------------------------------------- | 1299 // ---------------------------------------------------------------------------- |
1400 | 1300 |
1401 int16_t AudioDeviceModuleImpl::RecordingDevices() { | 1301 int16_t AudioDeviceModuleImpl::RecordingDevices() { |
1402 LOG(INFO) << __FUNCTION__; | 1302 LOG(INFO) << __FUNCTION__; |
1403 CHECK_INITIALIZED(); | 1303 CHECK_INITIALIZED(); |
1404 | 1304 |
1405 uint16_t nRecordingDevices = _ptrAudioDevice->RecordingDevices(); | 1305 uint16_t nRecordingDevices = _ptrAudioDevice->RecordingDevices(); |
1406 | 1306 |
1407 LOG(INFO) << __FUNCTION__ << " output: " << nRecordingDevices; | 1307 LOG(INFO) << "output: " << nRecordingDevices; |
1408 return ((int16_t)nRecordingDevices); | 1308 return ((int16_t)nRecordingDevices); |
1409 } | 1309 } |
1410 | 1310 |
1411 // ---------------------------------------------------------------------------- | 1311 // ---------------------------------------------------------------------------- |
1412 // SetRecordingDevice I (II) | 1312 // SetRecordingDevice I (II) |
1413 // ---------------------------------------------------------------------------- | 1313 // ---------------------------------------------------------------------------- |
1414 | 1314 |
1415 int32_t AudioDeviceModuleImpl::SetRecordingDevice(uint16_t index) { | 1315 int32_t AudioDeviceModuleImpl::SetRecordingDevice(uint16_t index) { |
1416 LOG(INFO) << __FUNCTION__ << "(" << index << ")"; | 1316 LOG(INFO) << __FUNCTION__ << "(" << index << ")"; |
1417 CHECK_INITIALIZED(); | 1317 CHECK_INITIALIZED(); |
1418 return (_ptrAudioDevice->SetRecordingDevice(index)); | 1318 return (_ptrAudioDevice->SetRecordingDevice(index)); |
1419 } | 1319 } |
1420 | 1320 |
1421 // ---------------------------------------------------------------------------- | 1321 // ---------------------------------------------------------------------------- |
1422 // SetRecordingDevice II (II) | 1322 // SetRecordingDevice II (II) |
1423 // ---------------------------------------------------------------------------- | 1323 // ---------------------------------------------------------------------------- |
1424 | 1324 |
1425 int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) { | 1325 int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) { |
1426 if (device == kDefaultDevice) { | |
1427 } else { | |
1428 } | |
1429 LOG(INFO) << __FUNCTION__; | 1326 LOG(INFO) << __FUNCTION__; |
1430 CHECK_INITIALIZED(); | 1327 CHECK_INITIALIZED(); |
1431 | 1328 |
1432 return (_ptrAudioDevice->SetRecordingDevice(device)); | 1329 return (_ptrAudioDevice->SetRecordingDevice(device)); |
1433 } | 1330 } |
1434 | 1331 |
1435 // ---------------------------------------------------------------------------- | 1332 // ---------------------------------------------------------------------------- |
1436 // InitPlayout | 1333 // InitPlayout |
1437 // ---------------------------------------------------------------------------- | 1334 // ---------------------------------------------------------------------------- |
1438 | 1335 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 return (_audioDeviceBuffer.StopOutputFileRecording()); | 1534 return (_audioDeviceBuffer.StopOutputFileRecording()); |
1638 } | 1535 } |
1639 | 1536 |
1640 // ---------------------------------------------------------------------------- | 1537 // ---------------------------------------------------------------------------- |
1641 // SetPlayoutBuffer | 1538 // SetPlayoutBuffer |
1642 // ---------------------------------------------------------------------------- | 1539 // ---------------------------------------------------------------------------- |
1643 | 1540 |
1644 int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, | 1541 int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, |
1645 uint16_t sizeMS) { | 1542 uint16_t sizeMS) { |
1646 if (type == kFixedBufferSize) { | 1543 if (type == kFixedBufferSize) { |
1647 LOG(INFO) << __FUNCTION__ << "(" | 1544 LOG(INFO) << __FUNCTION__ << "(fixed buffer, " << sizeMS << "ms)"; |
1648 << "fixed buffer, " << sizeMS << "ms" | |
1649 << ")"; | |
1650 } else if (type == kAdaptiveBufferSize) { | 1545 } else if (type == kAdaptiveBufferSize) { |
1651 LOG(INFO) << __FUNCTION__ << "(" | 1546 LOG(INFO) << __FUNCTION__ << "(adaptive buffer, " << sizeMS << "ms)"; |
1652 << "adaptive buffer, " << sizeMS << "ms" | |
1653 << ")"; | |
1654 } else { | 1547 } else { |
1655 LOG(INFO) << __FUNCTION__ << "(" | 1548 LOG(INFO) << __FUNCTION__ << "(?, " << sizeMS << "ms)"; |
1656 << "?, " << sizeMS << "ms" | |
1657 << ")"; | |
1658 } | 1549 } |
1659 CHECK_INITIALIZED(); | 1550 CHECK_INITIALIZED(); |
1660 | 1551 |
1661 if (_ptrAudioDevice->PlayoutIsInitialized()) { | 1552 if (_ptrAudioDevice->PlayoutIsInitialized()) { |
1662 LOG(LERROR) << "unable to modify the playout buffer while playing side is " | 1553 LOG(LERROR) << "unable to modify the playout buffer while playing side is " |
1663 "initialized"; | 1554 "initialized"; |
1664 return -1; | 1555 return -1; |
1665 } | 1556 } |
1666 | 1557 |
1667 int32_t ret(0); | 1558 int32_t ret(0); |
(...skipping 27 matching lines...) Expand all Loading... |
1695 uint16_t size(0); | 1586 uint16_t size(0); |
1696 | 1587 |
1697 if (_ptrAudioDevice->PlayoutBuffer(bufType, size) == -1) { | 1588 if (_ptrAudioDevice->PlayoutBuffer(bufType, size) == -1) { |
1698 LOG(LERROR) << "failed to retrieve the buffer type and size"; | 1589 LOG(LERROR) << "failed to retrieve the buffer type and size"; |
1699 return -1; | 1590 return -1; |
1700 } | 1591 } |
1701 | 1592 |
1702 *type = bufType; | 1593 *type = bufType; |
1703 *sizeMS = size; | 1594 *sizeMS = size; |
1704 | 1595 |
1705 LOG(INFO) << __FUNCTION__ << " output: type = " << *type | 1596 LOG(INFO) << "output: type = " << *type << ", sizeMS = " << *sizeMS; |
1706 << ", sizeMS = " << *sizeMS; | |
1707 return (0); | 1597 return (0); |
1708 } | 1598 } |
1709 | 1599 |
1710 // ---------------------------------------------------------------------------- | 1600 // ---------------------------------------------------------------------------- |
1711 // PlayoutDelay | 1601 // PlayoutDelay |
1712 // ---------------------------------------------------------------------------- | 1602 // ---------------------------------------------------------------------------- |
1713 | 1603 |
1714 int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { | 1604 int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { |
1715 LOG(LS_VERBOSE) << __FUNCTION__; | 1605 LOG(LS_VERBOSE) << __FUNCTION__; |
1716 CHECK_INITIALIZED(); | 1606 CHECK_INITIALIZED(); |
1717 | 1607 |
1718 uint16_t delay(0); | 1608 uint16_t delay(0); |
1719 | 1609 |
1720 if (_ptrAudioDevice->PlayoutDelay(delay) == -1) { | 1610 if (_ptrAudioDevice->PlayoutDelay(delay) == -1) { |
1721 LOG(LERROR) << "failed to retrieve the playout delay"; | 1611 LOG(LERROR) << "failed to retrieve the playout delay"; |
1722 return -1; | 1612 return -1; |
1723 } | 1613 } |
1724 | 1614 |
1725 *delayMS = delay; | 1615 *delayMS = delay; |
1726 | 1616 LOG(LS_VERBOSE) << "output: " << *delayMS; |
1727 LOG(LS_VERBOSE) << __FUNCTION__ << " output: delayMS = " << *delayMS; | |
1728 return (0); | 1617 return (0); |
1729 } | 1618 } |
1730 | 1619 |
1731 // ---------------------------------------------------------------------------- | 1620 // ---------------------------------------------------------------------------- |
1732 // RecordingDelay | 1621 // RecordingDelay |
1733 // ---------------------------------------------------------------------------- | 1622 // ---------------------------------------------------------------------------- |
1734 | 1623 |
1735 int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { | 1624 int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { |
1736 LOG(INFO) << __FUNCTION__; | 1625 LOG(INFO) << __FUNCTION__; |
1737 CHECK_INITIALIZED(); | 1626 CHECK_INITIALIZED(); |
1738 | 1627 |
1739 uint16_t delay(0); | 1628 uint16_t delay(0); |
1740 | 1629 |
1741 if (_ptrAudioDevice->RecordingDelay(delay) == -1) { | 1630 if (_ptrAudioDevice->RecordingDelay(delay) == -1) { |
1742 LOG(LERROR) << "failed to retrieve the recording delay"; | 1631 LOG(LERROR) << "failed to retrieve the recording delay"; |
1743 return -1; | 1632 return -1; |
1744 } | 1633 } |
1745 | 1634 |
1746 *delayMS = delay; | 1635 *delayMS = delay; |
1747 | 1636 LOG(INFO) << "output: " << *delayMS; |
1748 LOG(INFO) << __FUNCTION__ << " output: delayMS = " << *delayMS; | |
1749 return (0); | 1637 return (0); |
1750 } | 1638 } |
1751 | 1639 |
1752 // ---------------------------------------------------------------------------- | 1640 // ---------------------------------------------------------------------------- |
1753 // CPULoad | 1641 // CPULoad |
1754 // ---------------------------------------------------------------------------- | 1642 // ---------------------------------------------------------------------------- |
1755 | 1643 |
1756 int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const { | 1644 int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const { |
1757 LOG(INFO) << __FUNCTION__; | 1645 LOG(INFO) << __FUNCTION__; |
1758 CHECK_INITIALIZED(); | 1646 CHECK_INITIALIZED(); |
1759 | 1647 |
1760 uint16_t cpuLoad(0); | 1648 uint16_t cpuLoad(0); |
1761 | 1649 |
1762 if (_ptrAudioDevice->CPULoad(cpuLoad) == -1) { | 1650 if (_ptrAudioDevice->CPULoad(cpuLoad) == -1) { |
1763 LOG(LERROR) << "failed to retrieve the CPU load"; | 1651 LOG(LERROR) << "failed to retrieve the CPU load"; |
1764 return -1; | 1652 return -1; |
1765 } | 1653 } |
1766 | 1654 |
1767 *load = cpuLoad; | 1655 *load = cpuLoad; |
1768 | 1656 LOG(INFO) << "output: " << *load; |
1769 LOG(INFO) << __FUNCTION__ << " output: load = " << *load; | |
1770 return (0); | 1657 return (0); |
1771 } | 1658 } |
1772 | 1659 |
1773 // ---------------------------------------------------------------------------- | 1660 // ---------------------------------------------------------------------------- |
1774 // SetRecordingSampleRate | 1661 // SetRecordingSampleRate |
1775 // ---------------------------------------------------------------------------- | 1662 // ---------------------------------------------------------------------------- |
1776 | 1663 |
1777 int32_t AudioDeviceModuleImpl::SetRecordingSampleRate( | 1664 int32_t AudioDeviceModuleImpl::SetRecordingSampleRate( |
1778 const uint32_t samplesPerSec) { | 1665 const uint32_t samplesPerSec) { |
1779 LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; | 1666 LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; |
(...skipping 16 matching lines...) Expand all Loading... |
1796 CHECK_INITIALIZED(); | 1683 CHECK_INITIALIZED(); |
1797 | 1684 |
1798 int32_t sampleRate = _audioDeviceBuffer.RecordingSampleRate(); | 1685 int32_t sampleRate = _audioDeviceBuffer.RecordingSampleRate(); |
1799 | 1686 |
1800 if (sampleRate == -1) { | 1687 if (sampleRate == -1) { |
1801 LOG(LERROR) << "failed to retrieve the sample rate"; | 1688 LOG(LERROR) << "failed to retrieve the sample rate"; |
1802 return -1; | 1689 return -1; |
1803 } | 1690 } |
1804 | 1691 |
1805 *samplesPerSec = sampleRate; | 1692 *samplesPerSec = sampleRate; |
1806 | 1693 LOG(INFO) << "output: " << *samplesPerSec; |
1807 LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec; | |
1808 return (0); | 1694 return (0); |
1809 } | 1695 } |
1810 | 1696 |
1811 // ---------------------------------------------------------------------------- | 1697 // ---------------------------------------------------------------------------- |
1812 // SetPlayoutSampleRate | 1698 // SetPlayoutSampleRate |
1813 // ---------------------------------------------------------------------------- | 1699 // ---------------------------------------------------------------------------- |
1814 | 1700 |
1815 int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate( | 1701 int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate( |
1816 const uint32_t samplesPerSec) { | 1702 const uint32_t samplesPerSec) { |
1817 LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; | 1703 LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; |
(...skipping 16 matching lines...) Expand all Loading... |
1834 CHECK_INITIALIZED(); | 1720 CHECK_INITIALIZED(); |
1835 | 1721 |
1836 int32_t sampleRate = _audioDeviceBuffer.PlayoutSampleRate(); | 1722 int32_t sampleRate = _audioDeviceBuffer.PlayoutSampleRate(); |
1837 | 1723 |
1838 if (sampleRate == -1) { | 1724 if (sampleRate == -1) { |
1839 LOG(LERROR) << "failed to retrieve the sample rate"; | 1725 LOG(LERROR) << "failed to retrieve the sample rate"; |
1840 return -1; | 1726 return -1; |
1841 } | 1727 } |
1842 | 1728 |
1843 *samplesPerSec = sampleRate; | 1729 *samplesPerSec = sampleRate; |
1844 | 1730 LOG(INFO) << "output: " << *samplesPerSec; |
1845 LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec; | |
1846 return (0); | 1731 return (0); |
1847 } | 1732 } |
1848 | 1733 |
1849 // ---------------------------------------------------------------------------- | 1734 // ---------------------------------------------------------------------------- |
1850 // ResetAudioDevice | 1735 // ResetAudioDevice |
1851 // ---------------------------------------------------------------------------- | 1736 // ---------------------------------------------------------------------------- |
1852 | 1737 |
1853 int32_t AudioDeviceModuleImpl::ResetAudioDevice() { | 1738 int32_t AudioDeviceModuleImpl::ResetAudioDevice() { |
1854 LOG(INFO) << __FUNCTION__; | 1739 LOG(INFO) << __FUNCTION__; |
1855 CHECK_INITIALIZED(); | 1740 CHECK_INITIALIZED(); |
(...skipping 24 matching lines...) Expand all Loading... |
1880 // GetLoudspeakerStatus | 1765 // GetLoudspeakerStatus |
1881 // ---------------------------------------------------------------------------- | 1766 // ---------------------------------------------------------------------------- |
1882 | 1767 |
1883 int32_t AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const { | 1768 int32_t AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const { |
1884 LOG(INFO) << __FUNCTION__; | 1769 LOG(INFO) << __FUNCTION__; |
1885 CHECK_INITIALIZED(); | 1770 CHECK_INITIALIZED(); |
1886 int32_t ok = 0; | 1771 int32_t ok = 0; |
1887 if (_ptrAudioDevice->GetLoudspeakerStatus(*enabled) != 0) { | 1772 if (_ptrAudioDevice->GetLoudspeakerStatus(*enabled) != 0) { |
1888 ok = -1; | 1773 ok = -1; |
1889 } | 1774 } |
1890 LOG(INFO) << __FUNCTION__ << " output: " << ok; | 1775 LOG(INFO) << "output: " << ok; |
1891 return ok; | 1776 return ok; |
1892 } | 1777 } |
1893 | 1778 |
1894 bool AudioDeviceModuleImpl::BuiltInAECIsEnabled() const { | 1779 bool AudioDeviceModuleImpl::BuiltInAECIsEnabled() const { |
1895 LOG(INFO) << __FUNCTION__; | 1780 LOG(INFO) << __FUNCTION__; |
1896 CHECK_INITIALIZED_BOOL(); | 1781 CHECK_INITIALIZED_BOOL(); |
1897 bool isEnabled = _ptrAudioDevice->BuiltInAECIsEnabled(); | 1782 bool isEnabled = _ptrAudioDevice->BuiltInAECIsEnabled(); |
1898 if (isEnabled) { | 1783 LOG(INFO) << "output: " << isEnabled; |
1899 LOG(INFO) << __FUNCTION__ << " output: enabled"; | |
1900 } else { | |
1901 LOG(INFO) << __FUNCTION__ << " output: not enabled"; | |
1902 } | |
1903 return isEnabled; | 1784 return isEnabled; |
1904 } | 1785 } |
1905 | 1786 |
1906 bool AudioDeviceModuleImpl::BuiltInAECIsAvailable() const { | 1787 bool AudioDeviceModuleImpl::BuiltInAECIsAvailable() const { |
1907 LOG(INFO) << __FUNCTION__; | 1788 LOG(INFO) << __FUNCTION__; |
1908 CHECK_INITIALIZED_BOOL(); | 1789 CHECK_INITIALIZED_BOOL(); |
1909 bool isAvailable = _ptrAudioDevice->BuiltInAECIsAvailable(); | 1790 bool isAvailable = _ptrAudioDevice->BuiltInAECIsAvailable(); |
1910 if (isAvailable) { | 1791 LOG(INFO) << "output: " << isAvailable; |
1911 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1912 } else { | |
1913 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1914 } | |
1915 return isAvailable; | 1792 return isAvailable; |
1916 } | 1793 } |
1917 | 1794 |
1918 int32_t AudioDeviceModuleImpl::EnableBuiltInAEC(bool enable) { | 1795 int32_t AudioDeviceModuleImpl::EnableBuiltInAEC(bool enable) { |
1919 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 1796 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
1920 CHECK_INITIALIZED(); | 1797 CHECK_INITIALIZED(); |
1921 int32_t ok = _ptrAudioDevice->EnableBuiltInAEC(enable); | 1798 int32_t ok = _ptrAudioDevice->EnableBuiltInAEC(enable); |
1922 LOG(INFO) << __FUNCTION__ << " output: " << ok; | 1799 LOG(INFO) << "output: " << ok; |
1923 return ok; | 1800 return ok; |
1924 } | 1801 } |
1925 | 1802 |
1926 bool AudioDeviceModuleImpl::BuiltInAGCIsAvailable() const { | 1803 bool AudioDeviceModuleImpl::BuiltInAGCIsAvailable() const { |
1927 LOG(INFO) << __FUNCTION__; | 1804 LOG(INFO) << __FUNCTION__; |
1928 CHECK_INITIALIZED_BOOL(); | 1805 CHECK_INITIALIZED_BOOL(); |
1929 bool isAvailable = _ptrAudioDevice->BuiltInAGCIsAvailable(); | 1806 bool isAvailable = _ptrAudioDevice->BuiltInAGCIsAvailable(); |
1930 if (isAvailable) { | 1807 LOG(INFO) << "output: " << isAvailable; |
1931 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1932 } else { | |
1933 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1934 } | |
1935 return isAvailable; | 1808 return isAvailable; |
1936 } | 1809 } |
1937 | 1810 |
1938 int32_t AudioDeviceModuleImpl::EnableBuiltInAGC(bool enable) { | 1811 int32_t AudioDeviceModuleImpl::EnableBuiltInAGC(bool enable) { |
1939 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 1812 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
1940 CHECK_INITIALIZED(); | 1813 CHECK_INITIALIZED(); |
1941 int32_t ok = _ptrAudioDevice->EnableBuiltInAGC(enable); | 1814 int32_t ok = _ptrAudioDevice->EnableBuiltInAGC(enable); |
1942 LOG(INFO) << __FUNCTION__ << " output: " << ok; | 1815 LOG(INFO) << "output: " << ok; |
1943 return ok; | 1816 return ok; |
1944 } | 1817 } |
1945 | 1818 |
1946 bool AudioDeviceModuleImpl::BuiltInNSIsAvailable() const { | 1819 bool AudioDeviceModuleImpl::BuiltInNSIsAvailable() const { |
1947 LOG(INFO) << __FUNCTION__; | 1820 LOG(INFO) << __FUNCTION__; |
1948 CHECK_INITIALIZED_BOOL(); | 1821 CHECK_INITIALIZED_BOOL(); |
1949 bool isAvailable = _ptrAudioDevice->BuiltInNSIsAvailable(); | 1822 bool isAvailable = _ptrAudioDevice->BuiltInNSIsAvailable(); |
1950 if (isAvailable) { | 1823 LOG(INFO) << "output: " << isAvailable; |
1951 LOG(INFO) << __FUNCTION__ << " output: available"; | |
1952 } else { | |
1953 LOG(INFO) << __FUNCTION__ << " output: not available"; | |
1954 } | |
1955 return isAvailable; | 1824 return isAvailable; |
1956 } | 1825 } |
1957 | 1826 |
1958 int32_t AudioDeviceModuleImpl::EnableBuiltInNS(bool enable) { | 1827 int32_t AudioDeviceModuleImpl::EnableBuiltInNS(bool enable) { |
1959 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; | 1828 LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; |
1960 CHECK_INITIALIZED(); | 1829 CHECK_INITIALIZED(); |
1961 int32_t ok = _ptrAudioDevice->EnableBuiltInNS(enable); | 1830 int32_t ok = _ptrAudioDevice->EnableBuiltInNS(enable); |
1962 LOG(INFO) << __FUNCTION__ << " output: " << ok; | 1831 LOG(INFO) << "output: " << ok; |
1963 return ok; | 1832 return ok; |
1964 } | 1833 } |
1965 | 1834 |
1966 int AudioDeviceModuleImpl::GetPlayoutAudioParameters( | 1835 int AudioDeviceModuleImpl::GetPlayoutAudioParameters( |
1967 AudioParameters* params) const { | 1836 AudioParameters* params) const { |
1968 LOG(INFO) << __FUNCTION__; | 1837 LOG(INFO) << __FUNCTION__; |
1969 int r = _ptrAudioDevice->GetPlayoutAudioParameters(params); | 1838 int r = _ptrAudioDevice->GetPlayoutAudioParameters(params); |
1970 LOG(INFO) << __FUNCTION__ << " output: " << r; | 1839 LOG(INFO) << "output: " << r; |
1971 return r; | 1840 return r; |
1972 } | 1841 } |
1973 | 1842 |
1974 int AudioDeviceModuleImpl::GetRecordAudioParameters( | 1843 int AudioDeviceModuleImpl::GetRecordAudioParameters( |
1975 AudioParameters* params) const { | 1844 AudioParameters* params) const { |
1976 LOG(INFO) << __FUNCTION__; | 1845 LOG(INFO) << __FUNCTION__; |
1977 int r = _ptrAudioDevice->GetRecordAudioParameters(params); | 1846 int r = _ptrAudioDevice->GetRecordAudioParameters(params); |
1978 LOG(INFO) << __FUNCTION__ << " output: " << r; | 1847 LOG(INFO) << "output: " << r; |
1979 return r; | 1848 return r; |
1980 } | 1849 } |
1981 | 1850 |
1982 // ============================================================================ | 1851 // ============================================================================ |
1983 // Private Methods | 1852 // Private Methods |
1984 // ============================================================================ | 1853 // ============================================================================ |
1985 | 1854 |
1986 // ---------------------------------------------------------------------------- | 1855 // ---------------------------------------------------------------------------- |
1987 // Platform | 1856 // Platform |
1988 // ---------------------------------------------------------------------------- | 1857 // ---------------------------------------------------------------------------- |
1989 | 1858 |
1990 AudioDeviceModuleImpl::PlatformType AudioDeviceModuleImpl::Platform() const { | 1859 AudioDeviceModuleImpl::PlatformType AudioDeviceModuleImpl::Platform() const { |
1991 LOG(INFO) << __FUNCTION__; | 1860 LOG(INFO) << __FUNCTION__; |
1992 return _platformType; | 1861 return _platformType; |
1993 } | 1862 } |
1994 | 1863 |
1995 // ---------------------------------------------------------------------------- | 1864 // ---------------------------------------------------------------------------- |
1996 // PlatformAudioLayer | 1865 // PlatformAudioLayer |
1997 // ---------------------------------------------------------------------------- | 1866 // ---------------------------------------------------------------------------- |
1998 | 1867 |
1999 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() | 1868 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() |
2000 const { | 1869 const { |
2001 LOG(INFO) << __FUNCTION__; | 1870 LOG(INFO) << __FUNCTION__; |
2002 return _platformAudioLayer; | 1871 return _platformAudioLayer; |
2003 } | 1872 } |
2004 | 1873 |
2005 } // namespace webrtc | 1874 } // namespace webrtc |
OLD | NEW |