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

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

Issue 2378003002: Delete webrtc::VideoFrame::CreateEmptyFrame. (Closed)
Patch Set: Created 4 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 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::CreateEmptyFrame(int width,
55 int height,
56 int stride_y,
57 int stride_u,
58 int stride_v) {
59 const int half_width = (width + 1) / 2;
60 RTC_DCHECK_GT(width, 0);
61 RTC_DCHECK_GT(height, 0);
62 RTC_DCHECK_GE(stride_y, width);
63 RTC_DCHECK_GE(stride_u, half_width);
64 RTC_DCHECK_GE(stride_v, half_width);
65
66 // Creating empty frame - reset all values.
67 timestamp_rtp_ = 0;
68 ntp_time_ms_ = 0;
69 timestamp_us_ = 0;
70 rotation_ = kVideoRotation_0;
71
72 // Allocate a new buffer.
73 video_frame_buffer_ = I420Buffer::Create(
74 width, height, stride_y, stride_u, stride_v);
75 }
76
77 void VideoFrame::CreateFrame(const uint8_t* buffer_y, 54 void VideoFrame::CreateFrame(const uint8_t* buffer_y,
78 const uint8_t* buffer_u, 55 const uint8_t* buffer_u,
79 const uint8_t* buffer_v, 56 const uint8_t* buffer_v,
80 int width, 57 int width,
81 int height, 58 int height,
82 int stride_y, 59 int stride_y,
83 int stride_u, 60 int stride_u,
84 int stride_v, 61 int stride_v,
85 VideoRotation rotation) { 62 VideoRotation rotation) {
86 const int half_height = (height + 1) / 2; 63 const int half_height = (height + 1) / 2;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 case kVideoCodecULPFEC: 139 case kVideoCodecULPFEC:
163 case kVideoCodecGeneric: 140 case kVideoCodecGeneric:
164 case kVideoCodecUnknown: 141 case kVideoCodecUnknown:
165 return 0; 142 return 0;
166 } 143 }
167 RTC_NOTREACHED(); 144 RTC_NOTREACHED();
168 return 0; 145 return 0;
169 } 146 }
170 147
171 } // namespace webrtc 148 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698