OLD | NEW |
---|---|
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 const int stride_y = width; | 86 const int stride_y = width; |
87 const int stride_uv = (width + 1) / 2; | 87 const int stride_uv = (width + 1) / 2; |
88 | 88 |
89 const uint8_t* buffer_y = buffer; | 89 const uint8_t* buffer_y = buffer; |
90 const uint8_t* buffer_u = buffer_y + stride_y * height; | 90 const uint8_t* buffer_u = buffer_y + stride_y * height; |
91 const uint8_t* buffer_v = buffer_u + stride_uv * ((height + 1) / 2); | 91 const uint8_t* buffer_v = buffer_u + stride_uv * ((height + 1) / 2); |
92 CreateFrame(buffer_y, buffer_u, buffer_v, width, height, stride_y, | 92 CreateFrame(buffer_y, buffer_u, buffer_v, width, height, stride_y, |
93 stride_uv, stride_uv, rotation); | 93 stride_uv, stride_uv, rotation); |
94 } | 94 } |
95 | 95 |
96 void VideoFrame::ShallowCopy(const VideoFrame& videoFrame) { | 96 void VideoFrame::ShallowCopy(const VideoFrame& videoFrame) { |
tommi
2016/10/24 10:52:17
change variable name to video_frame? (or even just
nisse-chromium (ooo August 14)
2016/10/24 11:01:20
Done.
| |
97 video_frame_buffer_ = videoFrame.video_frame_buffer(); | 97 *this = videoFrame; |
98 timestamp_rtp_ = videoFrame.timestamp_rtp_; | |
99 ntp_time_ms_ = videoFrame.ntp_time_ms_; | |
100 timestamp_us_ = videoFrame.timestamp_us_; | |
101 rotation_ = videoFrame.rotation_; | |
102 } | 98 } |
103 | 99 |
104 int VideoFrame::width() const { | 100 int VideoFrame::width() const { |
105 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 101 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
106 } | 102 } |
107 | 103 |
108 int VideoFrame::height() const { | 104 int VideoFrame::height() const { |
109 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 105 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
110 } | 106 } |
111 | 107 |
(...skipping 18 matching lines...) Expand all Loading... | |
130 case kVideoCodecULPFEC: | 126 case kVideoCodecULPFEC: |
131 case kVideoCodecGeneric: | 127 case kVideoCodecGeneric: |
132 case kVideoCodecUnknown: | 128 case kVideoCodecUnknown: |
133 return 0; | 129 return 0; |
134 } | 130 } |
135 RTC_NOTREACHED(); | 131 RTC_NOTREACHED(); |
136 return 0; | 132 return 0; |
137 } | 133 } |
138 | 134 |
139 } // namespace webrtc | 135 } // namespace webrtc |
OLD | NEW |