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

Side by Side Diff: content/common/gpu/media/v4l2_image_processor.cc

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: halliwell@ comments. Created 4 years, 11 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 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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <linux/videodev2.h> 7 #include <linux/videodev2.h>
8 #include <poll.h> 8 #include <poll.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/eventfd.h> 10 #include <sys/eventfd.h>
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 running_jobs_.pop(); 554 running_jobs_.pop();
555 555
556 scoped_refptr<media::VideoFrame> output_frame = 556 scoped_refptr<media::VideoFrame> output_frame =
557 media::VideoFrame::WrapExternalDmabufs( 557 media::VideoFrame::WrapExternalDmabufs(
558 output_format_, 558 output_format_,
559 output_allocated_size_, 559 output_allocated_size_,
560 gfx::Rect(output_visible_size_), 560 gfx::Rect(output_visible_size_),
561 output_visible_size_, 561 output_visible_size_,
562 output_record.fds, 562 output_record.fds,
563 job_record->frame->timestamp()); 563 job_record->frame->timestamp());
564 if (!output_frame) {
565 NOTIFY_ERROR();
566 return;
567 }
564 output_frame->AddDestructionObserver(media::BindToCurrentLoop( 568 output_frame->AddDestructionObserver(media::BindToCurrentLoop(
565 base::Bind(&V4L2ImageProcessor::ReuseOutputBuffer, 569 base::Bind(&V4L2ImageProcessor::ReuseOutputBuffer,
566 device_weak_factory_.GetWeakPtr(), 570 device_weak_factory_.GetWeakPtr(),
567 dqbuf.index))); 571 dqbuf.index)));
568 572
569 DVLOG(3) << "Processing finished, returning frame, ts=" 573 DVLOG(3) << "Processing finished, returning frame, ts="
570 << output_frame->timestamp().InMilliseconds(); 574 << output_frame->timestamp().InMilliseconds();
571 575
572 child_task_runner_->PostTask( 576 child_task_runner_->PostTask(
573 FROM_HERE, base::Bind(job_record->ready_cb, output_frame)); 577 FROM_HERE, base::Bind(job_record->ready_cb, output_frame));
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 output_record.at_device = false; 722 output_record.at_device = false;
719 if (!output_record.at_client) 723 if (!output_record.at_client)
720 free_output_buffers_.push_back(i); 724 free_output_buffers_.push_back(i);
721 } 725 }
722 output_buffer_queued_count_ = 0; 726 output_buffer_queued_count_ = 0;
723 727
724 return true; 728 return true;
725 } 729 }
726 730
727 } // namespace content 731 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698