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

Side by Side Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | webrtc/common_audio/audio_converter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 renderer_->SetSink(NULL); 1658 renderer_->SetSink(NULL);
1659 renderer_ = NULL; 1659 renderer_ = NULL;
1660 } 1660 }
1661 1661
1662 // AudioRenderer::Sink implementation. 1662 // AudioRenderer::Sink implementation.
1663 // This method is called on the audio thread. 1663 // This method is called on the audio thread.
1664 void OnData(const void* audio_data, 1664 void OnData(const void* audio_data,
1665 int bits_per_sample, 1665 int bits_per_sample,
1666 int sample_rate, 1666 int sample_rate,
1667 int number_of_channels, 1667 int number_of_channels,
1668 int number_of_frames) override { 1668 size_t number_of_frames) override {
1669 voe_audio_transport_->OnData(channel_, 1669 voe_audio_transport_->OnData(channel_,
1670 audio_data, 1670 audio_data,
1671 bits_per_sample, 1671 bits_per_sample,
1672 sample_rate, 1672 sample_rate,
1673 number_of_channels, 1673 number_of_channels,
1674 number_of_frames); 1674 number_of_frames);
1675 } 1675 }
1676 1676
1677 // Callback from the |renderer_| when it is going away. In case Start() has 1677 // Callback from the |renderer_| when it is going away. In case Start() has
1678 // never been called, this callback won't be triggered. 1678 // never been called, this callback won't be triggered.
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after
3685 3685
3686 int WebRtcSoundclipStream::Rewind() { 3686 int WebRtcSoundclipStream::Rewind() {
3687 mem_.Rewind(); 3687 mem_.Rewind();
3688 // Return -1 to keep VoiceEngine from looping. 3688 // Return -1 to keep VoiceEngine from looping.
3689 return (loop_) ? 0 : -1; 3689 return (loop_) ? 0 : -1;
3690 } 3690 }
3691 3691
3692 } // namespace cricket 3692 } // namespace cricket
3693 3693
3694 #endif // HAVE_WEBRTC_VOICE 3694 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.h ('k') | webrtc/common_audio/audio_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698