OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 success = false; | 1562 success = false; |
1563 } | 1563 } |
1564 return success; | 1564 return success; |
1565 } | 1565 } |
1566 | 1566 |
1567 // Implementing method from WebRtc VoEMediaProcess interface | 1567 // Implementing method from WebRtc VoEMediaProcess interface |
1568 // Do not lock mux_channel_cs_ in this callback. | 1568 // Do not lock mux_channel_cs_ in this callback. |
1569 void WebRtcVoiceEngine::Process(int channel, | 1569 void WebRtcVoiceEngine::Process(int channel, |
1570 webrtc::ProcessingTypes type, | 1570 webrtc::ProcessingTypes type, |
1571 int16_t audio10ms[], | 1571 int16_t audio10ms[], |
1572 int length, | 1572 size_t length, |
1573 int sampling_freq, | 1573 int sampling_freq, |
1574 bool is_stereo) { | 1574 bool is_stereo) { |
1575 rtc::CritScope cs(&signal_media_critical_); | 1575 rtc::CritScope cs(&signal_media_critical_); |
1576 AudioFrame frame(audio10ms, length, sampling_freq, is_stereo); | 1576 AudioFrame frame(audio10ms, length, sampling_freq, is_stereo); |
1577 if (type == webrtc::kPlaybackAllChannelsMixed) { | 1577 if (type == webrtc::kPlaybackAllChannelsMixed) { |
1578 SignalRxMediaFrame(rx_processor_ssrc_, MPD_RX, &frame); | 1578 SignalRxMediaFrame(rx_processor_ssrc_, MPD_RX, &frame); |
1579 } else if (type == webrtc::kRecordingPerChannel) { | 1579 } else if (type == webrtc::kRecordingPerChannel) { |
1580 SignalTxMediaFrame(tx_processor_ssrc_, MPD_TX, &frame); | 1580 SignalTxMediaFrame(tx_processor_ssrc_, MPD_TX, &frame); |
1581 } else { | 1581 } else { |
1582 LOG(LS_WARNING) << "Media Processing invoked unexpectedly." | 1582 LOG(LS_WARNING) << "Media Processing invoked unexpectedly." |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 renderer_->SetSink(NULL); | 1659 renderer_->SetSink(NULL); |
1660 renderer_ = NULL; | 1660 renderer_ = NULL; |
1661 } | 1661 } |
1662 | 1662 |
1663 // AudioRenderer::Sink implementation. | 1663 // AudioRenderer::Sink implementation. |
1664 // This method is called on the audio thread. | 1664 // This method is called on the audio thread. |
1665 void OnData(const void* audio_data, | 1665 void OnData(const void* audio_data, |
1666 int bits_per_sample, | 1666 int bits_per_sample, |
1667 int sample_rate, | 1667 int sample_rate, |
1668 int number_of_channels, | 1668 int number_of_channels, |
1669 int number_of_frames) override { | 1669 size_t number_of_frames) override { |
1670 voe_audio_transport_->OnData(channel_, | 1670 voe_audio_transport_->OnData(channel_, |
1671 audio_data, | 1671 audio_data, |
1672 bits_per_sample, | 1672 bits_per_sample, |
1673 sample_rate, | 1673 sample_rate, |
1674 number_of_channels, | 1674 number_of_channels, |
1675 number_of_frames); | 1675 number_of_frames); |
1676 } | 1676 } |
1677 | 1677 |
1678 // Callback from the |renderer_| when it is going away. In case Start() has | 1678 // Callback from the |renderer_| when it is going away. In case Start() has |
1679 // never been called, this callback won't be triggered. | 1679 // never been called, this callback won't be triggered. |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 | 3655 |
3656 int WebRtcSoundclipStream::Rewind() { | 3656 int WebRtcSoundclipStream::Rewind() { |
3657 mem_.Rewind(); | 3657 mem_.Rewind(); |
3658 // Return -1 to keep VoiceEngine from looping. | 3658 // Return -1 to keep VoiceEngine from looping. |
3659 return (loop_) ? 0 : -1; | 3659 return (loop_) ? 0 : -1; |
3660 } | 3660 } |
3661 | 3661 |
3662 } // namespace cricket | 3662 } // namespace cricket |
3663 | 3663 |
3664 #endif // HAVE_WEBRTC_VOICE | 3664 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |