| 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_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ | 6 #define MEDIA_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // testing the video capture pipeline when no real hardware is available. The | 25 // testing the video capture pipeline when no real hardware is available. The |
| 26 // supported file formats are YUV4MPEG2 (a.k.a. Y4M) and MJPEG/JPEG. YUV4MPEG2 | 26 // supported file formats are YUV4MPEG2 (a.k.a. Y4M) and MJPEG/JPEG. YUV4MPEG2 |
| 27 // is a minimal container with a series of uncompressed video only frames, see | 27 // is a minimal container with a series of uncompressed video only frames, see |
| 28 // the link http://wiki.multimedia.cx/index.php?title=YUV4MPEG2 for more | 28 // the link http://wiki.multimedia.cx/index.php?title=YUV4MPEG2 for more |
| 29 // information on the file format. Several restrictions and notes apply, see the | 29 // information on the file format. Several restrictions and notes apply, see the |
| 30 // implementation file. | 30 // implementation file. |
| 31 // Example Y4M videos can be found in http://media.xiph.org/video/derf. | 31 // Example Y4M videos can be found in http://media.xiph.org/video/derf. |
| 32 // Example MJPEG videos can be found in media/data/test/bear.mjpeg. | 32 // Example MJPEG videos can be found in media/data/test/bear.mjpeg. |
| 33 // Restrictions: Y4M videos should have .y4m file extension and MJPEG videos | 33 // Restrictions: Y4M videos should have .y4m file extension and MJPEG videos |
| 34 // should have .mjpeg file extension. | 34 // should have .mjpeg file extension. |
| 35 class CAPTURE_EXPORT FileVideoCaptureDevice : public VideoCaptureDevice { | 35 class MEDIA_EXPORT FileVideoCaptureDevice : public VideoCaptureDevice { |
| 36 public: | 36 public: |
| 37 // Reads and parses the header of a |file_path|, returning the collected | 37 // Reads and parses the header of a |file_path|, returning the collected |
| 38 // pixel format in |video_format|. Returns true on file parsed successfully, | 38 // pixel format in |video_format|. Returns true on file parsed successfully, |
| 39 // or false. | 39 // or false. |
| 40 // Restrictions: Only trivial Y4M per-frame headers and MJPEG are supported. | 40 // Restrictions: Only trivial Y4M per-frame headers and MJPEG are supported. |
| 41 static bool GetVideoCaptureFormat(const base::FilePath& file_path, | 41 static bool GetVideoCaptureFormat(const base::FilePath& file_path, |
| 42 media::VideoCaptureFormat* video_format); | 42 media::VideoCaptureFormat* video_format); |
| 43 | 43 |
| 44 // Constructor of the class, with a fully qualified file path as input, which | 44 // Constructor of the class, with a fully qualified file path as input, which |
| 45 // represents the Y4M or MJPEG file to stream repeatedly. | 45 // represents the Y4M or MJPEG file to stream repeatedly. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 base::TimeTicks next_frame_time_; | 83 base::TimeTicks next_frame_time_; |
| 84 // The system time when we receive the first frame. | 84 // The system time when we receive the first frame. |
| 85 base::TimeTicks first_ref_time_; | 85 base::TimeTicks first_ref_time_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(FileVideoCaptureDevice); | 87 DISALLOW_COPY_AND_ASSIGN(FileVideoCaptureDevice); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace media | 90 } // namespace media |
| 91 | 91 |
| 92 #endif // MEDIA_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ | 92 #endif // MEDIA_CAPTURE_VIDEO_FILE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |