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

Side by Side Diff: webrtc/media/engine/webrtcvideoframe.cc

Issue 2370993003: Reland of Delete VideoFrameFactory, CapturedFrame, and related code. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Resolve conflict in webrtc/media/BUILD.gn. 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) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 int dh, 59 int dh,
60 uint8_t* sample, 60 uint8_t* sample,
61 size_t sample_size, 61 size_t sample_size,
62 int64_t time_stamp_ns, 62 int64_t time_stamp_ns,
63 webrtc::VideoRotation rotation) { 63 webrtc::VideoRotation rotation) {
64 return Reset(format, w, h, dw, dh, sample, sample_size, 64 return Reset(format, w, h, dw, dh, sample, sample_size,
65 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation, 65 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation,
66 true /*apply_rotation*/); 66 true /*apply_rotation*/);
67 } 67 }
68 68
69 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh,
70 bool apply_rotation) {
71 return Reset(frame->fourcc, frame->width, frame->height, dw, dh,
72 static_cast<uint8_t*>(frame->data), frame->data_size,
73 frame->time_stamp / rtc::kNumNanosecsPerMicrosec,
74 frame->rotation, apply_rotation);
75 }
76
77 int WebRtcVideoFrame::width() const { 69 int WebRtcVideoFrame::width() const {
78 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; 70 return video_frame_buffer_ ? video_frame_buffer_->width() : 0;
79 } 71 }
80 72
81 int WebRtcVideoFrame::height() const { 73 int WebRtcVideoFrame::height() const {
82 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; 74 return video_frame_buffer_ ? video_frame_buffer_->height() : 0;
83 } 75 }
84 76
85 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& 77 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
86 WebRtcVideoFrame::video_frame_buffer() const { 78 WebRtcVideoFrame::video_frame_buffer() const {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 timestamp_us_ = timestamp_us; 149 timestamp_us_ = timestamp_us;
158 return true; 150 return true;
159 } 151 }
160 152
161 void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) { 153 void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) {
162 video_frame_buffer_ = webrtc::I420Buffer::Create(w, h); 154 video_frame_buffer_ = webrtc::I420Buffer::Create(w, h);
163 rotation_ = webrtc::kVideoRotation_0; 155 rotation_ = webrtc::kVideoRotation_0;
164 } 156 }
165 157
166 } // namespace cricket 158 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | webrtc/media/engine/webrtcvideoframe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698