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

Side by Side Diff: webrtc/modules/audio_coding/main/test/Channel.cc

Issue 1371043003: Unify FrameType and VideoFrameType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 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
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 24 matching lines...) Expand all
35 _seqNo++ : static_cast<uint16_t>(external_sequence_number_); 35 _seqNo++ : static_cast<uint16_t>(external_sequence_number_);
36 rtpInfo.header.payloadType = payloadType; 36 rtpInfo.header.payloadType = payloadType;
37 rtpInfo.header.timestamp = (external_send_timestamp_ < 0) ? timeStamp : 37 rtpInfo.header.timestamp = (external_send_timestamp_ < 0) ? timeStamp :
38 static_cast<uint32_t>(external_send_timestamp_); 38 static_cast<uint32_t>(external_send_timestamp_);
39 39
40 if (frameType == kAudioFrameCN) { 40 if (frameType == kAudioFrameCN) {
41 rtpInfo.type.Audio.isCNG = true; 41 rtpInfo.type.Audio.isCNG = true;
42 } else { 42 } else {
43 rtpInfo.type.Audio.isCNG = false; 43 rtpInfo.type.Audio.isCNG = false;
44 } 44 }
45 if (frameType == kFrameEmpty) { 45 if (frameType == kEmptyFrame) {
46 // When frame is empty, we should not transmit it. The frame size of the 46 // When frame is empty, we should not transmit it. The frame size of the
47 // next non-empty frame will be based on the previous frame size. 47 // next non-empty frame will be based on the previous frame size.
48 _useLastFrameSize = _lastFrameSizeSample > 0; 48 _useLastFrameSize = _lastFrameSizeSample > 0;
49 return 0; 49 return 0;
50 } 50 }
51 51
52 rtpInfo.type.Audio.channel = 1; 52 rtpInfo.type.Audio.channel = 1;
53 // Treat fragmentation separately 53 // Treat fragmentation separately
54 if (fragmentation != NULL) { 54 if (fragmentation != NULL) {
55 // If silence for too long, send only new data. 55 // If silence for too long, send only new data.
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 double Channel::BitRate() { 415 double Channel::BitRate() {
416 double rate; 416 double rate;
417 uint64_t currTime = TickTime::MillisecondTimestamp(); 417 uint64_t currTime = TickTime::MillisecondTimestamp();
418 _channelCritSect->Enter(); 418 _channelCritSect->Enter();
419 rate = ((double) _totalBytes * 8.0) / (double) (currTime - _beginTime); 419 rate = ((double) _totalBytes * 8.0) / (double) (currTime - _beginTime);
420 _channelCritSect->Leave(); 420 _channelCritSect->Leave();
421 return rate; 421 return rate;
422 } 422 }
423 423
424 } // namespace webrtc 424 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698