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

Side by Side Diff: media/video/capture/file_video_capture_device.h

Issue 897483002: Refactored pixel format resize operations in media/video/capture into a function called VideoCaptu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added checks for unsupported pixel formats. 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 #ifndef MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_ 5 #ifndef MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_
6 #define MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_ 6 #define MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // VideoCaptureDevice implementation, class methods. 37 // VideoCaptureDevice implementation, class methods.
38 ~FileVideoCaptureDevice() override; 38 ~FileVideoCaptureDevice() override;
39 void AllocateAndStart(const VideoCaptureParams& params, 39 void AllocateAndStart(const VideoCaptureParams& params,
40 scoped_ptr<VideoCaptureDevice::Client> client) override; 40 scoped_ptr<VideoCaptureDevice::Client> client) override;
41 void StopAndDeAllocate() override; 41 void StopAndDeAllocate() override;
42 42
43 private: 43 private:
44 // Returns size in bytes of an I420 frame, not including possible paddings, 44 // Returns size in bytes of an I420 frame, not including possible paddings,
45 // defined by |capture_format_|. 45 // defined by |capture_format_|.
46 int CalculateFrameSize(); 46 int CalculateFrameSize() const;
47 47
48 // Called on the |capture_thread_|. 48 // Called on the |capture_thread_|.
49 void OnAllocateAndStart(const VideoCaptureParams& params, 49 void OnAllocateAndStart(const VideoCaptureParams& params,
50 scoped_ptr<Client> client); 50 scoped_ptr<Client> client);
51 void OnStopAndDeAllocate(); 51 void OnStopAndDeAllocate();
52 void OnCaptureTask(); 52 void OnCaptureTask();
53 53
54 // |thread_checker_| is used to check that destructor, AllocateAndStart() and 54 // |thread_checker_| is used to check that destructor, AllocateAndStart() and
55 // StopAndDeAllocate() are called in the correct thread that owns the object. 55 // StopAndDeAllocate() are called in the correct thread that owns the object.
56 base::ThreadChecker thread_checker_; 56 base::ThreadChecker thread_checker_;
(...skipping 10 matching lines...) Expand all
67 int frame_size_; 67 int frame_size_;
68 int64 current_byte_index_; 68 int64 current_byte_index_;
69 int64 first_frame_byte_index_; 69 int64 first_frame_byte_index_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(FileVideoCaptureDevice); 71 DISALLOW_COPY_AND_ASSIGN(FileVideoCaptureDevice);
72 }; 72 };
73 73
74 } // namespace media 74 } // namespace media
75 75
76 #endif // MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_ 76 #endif // MEDIA_VIDEO_CAPTURE_FILE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/video_capture_controller.cc ('k') | media/video/capture/file_video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698