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

Side by Side Diff: webrtc/common_video/video_frame.cc

Issue 2443123002: Delete ShallowCopy, in favor of copy construction and assignment. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 | « no previous file | webrtc/media/engine/fakewebrtccall.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 int64_t render_time_ms, 44 int64_t render_time_ms,
45 VideoRotation rotation) 45 VideoRotation rotation)
46 : video_frame_buffer_(buffer), 46 : video_frame_buffer_(buffer),
47 timestamp_rtp_(timestamp), 47 timestamp_rtp_(timestamp),
48 ntp_time_ms_(0), 48 ntp_time_ms_(0),
49 timestamp_us_(render_time_ms * rtc::kNumMicrosecsPerMillisec), 49 timestamp_us_(render_time_ms * rtc::kNumMicrosecsPerMillisec),
50 rotation_(rotation) { 50 rotation_(rotation) {
51 RTC_DCHECK(buffer); 51 RTC_DCHECK(buffer);
52 } 52 }
53 53
54 void VideoFrame::ShallowCopy(const VideoFrame& videoFrame) {
55 video_frame_buffer_ = videoFrame.video_frame_buffer();
56 timestamp_rtp_ = videoFrame.timestamp_rtp_;
57 ntp_time_ms_ = videoFrame.ntp_time_ms_;
58 timestamp_us_ = videoFrame.timestamp_us_;
59 rotation_ = videoFrame.rotation_;
60 }
61
62 int VideoFrame::width() const { 54 int VideoFrame::width() const {
63 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; 55 return video_frame_buffer_ ? video_frame_buffer_->width() : 0;
64 } 56 }
65 57
66 int VideoFrame::height() const { 58 int VideoFrame::height() const {
67 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; 59 return video_frame_buffer_ ? video_frame_buffer_->height() : 0;
68 } 60 }
69 61
70 bool VideoFrame::IsZeroSize() const { 62 bool VideoFrame::IsZeroSize() const {
71 return !video_frame_buffer_; 63 return !video_frame_buffer_;
(...skipping 16 matching lines...) Expand all
88 case kVideoCodecULPFEC: 80 case kVideoCodecULPFEC:
89 case kVideoCodecGeneric: 81 case kVideoCodecGeneric:
90 case kVideoCodecUnknown: 82 case kVideoCodecUnknown:
91 return 0; 83 return 0;
92 } 84 }
93 RTC_NOTREACHED(); 85 RTC_NOTREACHED();
94 return 0; 86 return 0;
95 } 87 }
96 88
97 } // namespace webrtc 89 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/fakewebrtccall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698