OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |