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

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

Issue 2076113002: Revert of Delete unused and almost unused frame-related methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh, 60 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh,
61 bool apply_rotation) { 61 bool apply_rotation) {
62 return Reset(frame->fourcc, frame->width, frame->height, dw, dh, 62 return Reset(frame->fourcc, frame->width, frame->height, dw, dh,
63 static_cast<uint8_t*>(frame->data), frame->data_size, 63 static_cast<uint8_t*>(frame->data), frame->data_size,
64 frame->time_stamp / rtc::kNumNanosecsPerMicrosec, 64 frame->time_stamp / rtc::kNumNanosecsPerMicrosec,
65 frame->rotation, apply_rotation); 65 frame->rotation, apply_rotation);
66 } 66 }
67 67
68 // TODO(nisse): Deprecated, delete as soon as Chrome is updated.
69 bool WebRtcVideoFrame::InitToBlack(int w, int h,
70 int64_t time_stamp_ns) {
71 rtc::scoped_refptr<webrtc::I420Buffer> buffer(
72 new rtc::RefCountedObject<webrtc::I420Buffer>(w, h));
73 buffer->SetToBlack();
74
75 video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
76 SetTimeStamp(time_stamp_ns);
77 rotation_ = webrtc::kVideoRotation_0;
78
79 return true;
80 }
81
68 int WebRtcVideoFrame::width() const { 82 int WebRtcVideoFrame::width() const {
69 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; 83 return video_frame_buffer_ ? video_frame_buffer_->width() : 0;
70 } 84 }
71 85
72 int WebRtcVideoFrame::height() const { 86 int WebRtcVideoFrame::height() const {
73 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; 87 return video_frame_buffer_ ? video_frame_buffer_->height() : 0;
74 } 88 }
75 89
76 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& 90 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
77 WebRtcVideoFrame::video_frame_buffer() const { 91 WebRtcVideoFrame::video_frame_buffer() const {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 rotated_frame_->video_frame_buffer()->StrideV(), 227 rotated_frame_->video_frame_buffer()->StrideV(),
214 orig_width, orig_height, 228 orig_width, orig_height,
215 static_cast<libyuv::RotationMode>(rotation())); 229 static_cast<libyuv::RotationMode>(rotation()));
216 if (ret == 0) { 230 if (ret == 0) {
217 return rotated_frame_.get(); 231 return rotated_frame_.get();
218 } 232 }
219 return nullptr; 233 return nullptr;
220 } 234 }
221 235
222 } // namespace cricket 236 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698