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

Side by Side Diff: webrtc/modules/utility/source/coder.cc

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 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 | « webrtc/modules/audio_processing/ns/nsx_core_mips.c ('k') | webrtc/voice_engine/channel.cc » ('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 * 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 int32_t AudioCoder::Encode(const AudioFrame& audio, 79 int32_t AudioCoder::Encode(const AudioFrame& audio,
80 int8_t* encodedData, 80 int8_t* encodedData,
81 size_t& encodedLengthInBytes) 81 size_t& encodedLengthInBytes)
82 { 82 {
83 // Fake a timestamp in case audio doesn't contain a correct timestamp. 83 // Fake a timestamp in case audio doesn't contain a correct timestamp.
84 // Make a local copy of the audio frame since audio is const 84 // Make a local copy of the audio frame since audio is const
85 AudioFrame audioFrame; 85 AudioFrame audioFrame;
86 audioFrame.CopyFrom(audio); 86 audioFrame.CopyFrom(audio);
87 audioFrame.timestamp_ = _encodeTimestamp; 87 audioFrame.timestamp_ = _encodeTimestamp;
88 _encodeTimestamp += audioFrame.samples_per_channel_; 88 _encodeTimestamp += static_cast<uint32_t>(audioFrame.samples_per_channel_);
89 89
90 // For any codec with a frame size that is longer than 10 ms the encoded 90 // For any codec with a frame size that is longer than 10 ms the encoded
91 // length in bytes should be zero until a a full frame has been encoded. 91 // length in bytes should be zero until a a full frame has been encoded.
92 _encodedLengthInBytes = 0; 92 _encodedLengthInBytes = 0;
93 if(_acm->Add10MsData((AudioFrame&)audioFrame) == -1) 93 if(_acm->Add10MsData((AudioFrame&)audioFrame) == -1)
94 { 94 {
95 return -1; 95 return -1;
96 } 96 }
97 _encodedData = encodedData; 97 _encodedData = encodedData;
98 encodedLengthInBytes = _encodedLengthInBytes; 98 encodedLengthInBytes = _encodedLengthInBytes;
99 return 0; 99 return 0;
100 } 100 }
101 101
102 int32_t AudioCoder::SendData( 102 int32_t AudioCoder::SendData(
103 FrameType /* frameType */, 103 FrameType /* frameType */,
104 uint8_t /* payloadType */, 104 uint8_t /* payloadType */,
105 uint32_t /* timeStamp */, 105 uint32_t /* timeStamp */,
106 const uint8_t* payloadData, 106 const uint8_t* payloadData,
107 size_t payloadSize, 107 size_t payloadSize,
108 const RTPFragmentationHeader* /* fragmentation*/) 108 const RTPFragmentationHeader* /* fragmentation*/)
109 { 109 {
110 memcpy(_encodedData,payloadData,sizeof(uint8_t) * payloadSize); 110 memcpy(_encodedData,payloadData,sizeof(uint8_t) * payloadSize);
111 _encodedLengthInBytes = payloadSize; 111 _encodedLengthInBytes = payloadSize;
112 return 0; 112 return 0;
113 } 113 }
114 } // namespace webrtc 114 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/ns/nsx_core_mips.c ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698