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

Side by Side Diff: content/renderer/media/rtc_video_encoder.cc

Issue 877353002: media: VideoFrame: add offset for shared memory buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify shm pointer computation Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/media/rtc_video_encoder.h" 5 #include "content/renderer/media/rtc_video_encoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 base::SharedMemory* input_buffer = input_buffers_[index]; 495 base::SharedMemory* input_buffer = input_buffers_[index];
496 scoped_refptr<media::VideoFrame> frame = 496 scoped_refptr<media::VideoFrame> frame =
497 media::VideoFrame::WrapExternalPackedMemory( 497 media::VideoFrame::WrapExternalPackedMemory(
498 media::VideoFrame::I420, 498 media::VideoFrame::I420,
499 input_frame_coded_size_, 499 input_frame_coded_size_,
500 gfx::Rect(input_visible_size_), 500 gfx::Rect(input_visible_size_),
501 input_visible_size_, 501 input_visible_size_,
502 reinterpret_cast<uint8*>(input_buffer->memory()), 502 reinterpret_cast<uint8*>(input_buffer->memory()),
503 input_buffer->mapped_size(), 503 input_buffer->mapped_size(),
504 input_buffer->handle(), 504 input_buffer->handle(),
505 0,
505 base::TimeDelta(), 506 base::TimeDelta(),
506 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index)); 507 base::Bind(&RTCVideoEncoder::Impl::EncodeFrameFinished, this, index));
507 if (!frame.get()) { 508 if (!frame.get()) {
508 DLOG(ERROR) << "Impl::EncodeOneFrame(): failed to create frame"; 509 DLOG(ERROR) << "Impl::EncodeOneFrame(): failed to create frame";
509 NOTIFY_ERROR(media::VideoEncodeAccelerator::kPlatformFailureError); 510 NOTIFY_ERROR(media::VideoEncodeAccelerator::kPlatformFailureError);
510 return; 511 return;
511 } 512 }
512 513
513 // Do a strided copy of the input frame to match the input requirements for 514 // Do a strided copy of the input frame to match the input requirements for
514 // the encoder. 515 // the encoder.
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", 773 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess",
773 init_retval == WEBRTC_VIDEO_CODEC_OK); 774 init_retval == WEBRTC_VIDEO_CODEC_OK);
774 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { 775 if (init_retval == WEBRTC_VIDEO_CODEC_OK) {
775 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", 776 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile",
776 profile, 777 profile,
777 media::VIDEO_CODEC_PROFILE_MAX + 1); 778 media::VIDEO_CODEC_PROFILE_MAX + 1);
778 } 779 }
779 } 780 }
780 781
781 } // namespace content 782 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698