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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #ifdef WIN32 | 57 #ifdef WIN32 |
58 #include <objbase.h> // NOLINT | 58 #include <objbase.h> // NOLINT |
59 #endif | 59 #endif |
60 | 60 |
61 namespace cricket { | 61 namespace cricket { |
62 | 62 |
63 static const int kMaxNumPacketSize = 6; | 63 static const int kMaxNumPacketSize = 6; |
64 struct CodecPref { | 64 struct CodecPref { |
65 const char* name; | 65 const char* name; |
66 int clockrate; | 66 int clockrate; |
67 int channels; | 67 size_t channels; |
68 int payload_type; | 68 int payload_type; |
69 bool is_multi_rate; | 69 bool is_multi_rate; |
70 int packet_sizes_ms[kMaxNumPacketSize]; | 70 int packet_sizes_ms[kMaxNumPacketSize]; |
71 }; | 71 }; |
72 // Note: keep the supported packet sizes in ascending order. | 72 // Note: keep the supported packet sizes in ascending order. |
73 static const CodecPref kCodecPrefs[] = { | 73 static const CodecPref kCodecPrefs[] = { |
74 { kOpusCodecName, 48000, 2, 111, true, { 10, 20, 40, 60 } }, | 74 { kOpusCodecName, 48000, 2, 111, true, { 10, 20, 40, 60 } }, |
75 { kIsacCodecName, 16000, 1, 103, true, { 30, 60 } }, | 75 { kIsacCodecName, 16000, 1, 103, true, { 30, 60 } }, |
76 { kIsacCodecName, 32000, 1, 104, true, { 30 } }, | 76 { kIsacCodecName, 32000, 1, 104, true, { 30 } }, |
77 // G722 should be advertised as 8000 Hz because of the RFC "bug". | 77 // G722 should be advertised as 8000 Hz because of the RFC "bug". |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 renderer_->RemoveChannel(channel_); | 1657 renderer_->RemoveChannel(channel_); |
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 size_t number_of_channels, |
1668 size_t 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 |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3667 | 3667 |
3668 int WebRtcSoundclipStream::Rewind() { | 3668 int WebRtcSoundclipStream::Rewind() { |
3669 mem_.Rewind(); | 3669 mem_.Rewind(); |
3670 // Return -1 to keep VoiceEngine from looping. | 3670 // Return -1 to keep VoiceEngine from looping. |
3671 return (loop_) ? 0 : -1; | 3671 return (loop_) ? 0 : -1; |
3672 } | 3672 } |
3673 | 3673 |
3674 } // namespace cricket | 3674 } // namespace cricket |
3675 | 3675 |
3676 #endif // HAVE_WEBRTC_VOICE | 3676 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |