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

Side by Side Diff: media/cast/video_sender/external_video_encoder.cc

Issue 178133005: Audit/fix use of media::VideoFrame::coded_size() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 5c04e7a7 DCHECK fix. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/video_sender/external_video_encoder.h" 5 #include "media/cast/video_sender/external_video_encoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 index)); 149 index));
150 150
151 if (!frame) { 151 if (!frame) {
152 VLOG(1) << "EncodeVideoFrame(): failed to create frame"; 152 VLOG(1) << "EncodeVideoFrame(): failed to create frame";
153 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); 153 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError);
154 return; 154 return;
155 } 155 }
156 // Do a stride copy of the input frame to match the input requirements. 156 // Do a stride copy of the input frame to match the input requirements.
157 media::CopyYPlane(video_frame->data(VideoFrame::kYPlane), 157 media::CopyYPlane(video_frame->data(VideoFrame::kYPlane),
158 video_frame->stride(VideoFrame::kYPlane), 158 video_frame->stride(VideoFrame::kYPlane),
159 video_frame->natural_size().height(), 159 video_frame->coded_size().height(),
160 frame.get()); 160 frame.get());
161 media::CopyUPlane(video_frame->data(VideoFrame::kUPlane), 161 media::CopyUPlane(video_frame->data(VideoFrame::kUPlane),
162 video_frame->stride(VideoFrame::kUPlane), 162 video_frame->stride(VideoFrame::kUPlane),
163 video_frame->natural_size().height(), 163 video_frame->coded_size().height(),
164 frame.get()); 164 frame.get());
165 media::CopyVPlane(video_frame->data(VideoFrame::kVPlane), 165 media::CopyVPlane(video_frame->data(VideoFrame::kVPlane),
166 video_frame->stride(VideoFrame::kVPlane), 166 video_frame->stride(VideoFrame::kVPlane),
167 video_frame->natural_size().height(), 167 video_frame->coded_size().height(),
168 frame.get()); 168 frame.get());
169 169
170 encoded_frame_data_storage_.push_back( 170 encoded_frame_data_storage_.push_back(
171 EncodedFrameReturnData(capture_time, frame_encoded_callback)); 171 EncodedFrameReturnData(capture_time, frame_encoded_callback));
172 172
173 // BitstreamBufferReady will be called once the encoder is done. 173 // BitstreamBufferReady will be called once the encoder is done.
174 video_encode_accelerator_->Encode(frame, key_frame_requested); 174 video_encode_accelerator_->Encode(frame, key_frame_requested);
175 } 175 }
176 176
177 protected: 177 protected:
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // Do nothing not supported. 448 // Do nothing not supported.
449 } 449 }
450 450
451 int ExternalVideoEncoder::NumberOfSkippedFrames() const { 451 int ExternalVideoEncoder::NumberOfSkippedFrames() const {
452 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 452 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
453 return skip_count_; 453 return skip_count_;
454 } 454 }
455 455
456 } // namespace cast 456 } // namespace cast
457 } // namespace media 457 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698