| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void Stop(); | 64 void Stop(); |
| 65 // Record a video frame to the file. Return true if the frame is written to | 65 // Record a video frame to the file. Return true if the frame is written to |
| 66 // the file successfully. This method needs to be called after Start() and | 66 // the file successfully. This method needs to be called after Start() and |
| 67 // before Stop(). | 67 // before Stop(). |
| 68 bool RecordFrame(const CapturedFrame& frame); | 68 bool RecordFrame(const CapturedFrame& frame); |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 rtc::FileStream video_file_; | 71 rtc::FileStream video_file_; |
| 72 bool write_header_; | 72 bool write_header_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(VideoRecorder); | 74 RTC_DISALLOW_COPY_AND_ASSIGN(VideoRecorder); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // Simulated video capturer that periodically reads frames from a file. | 77 // Simulated video capturer that periodically reads frames from a file. |
| 78 class FileVideoCapturer : public VideoCapturer { | 78 class FileVideoCapturer : public VideoCapturer { |
| 79 public: | 79 public: |
| 80 static const int kForever = -1; | 80 static const int kForever = -1; |
| 81 | 81 |
| 82 FileVideoCapturer(); | 82 FileVideoCapturer(); |
| 83 virtual ~FileVideoCapturer(); | 83 virtual ~FileVideoCapturer(); |
| 84 | 84 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 rtc::FileStream video_file_; | 146 rtc::FileStream video_file_; |
| 147 CapturedFrame captured_frame_; | 147 CapturedFrame captured_frame_; |
| 148 // The number of bytes allocated buffer for captured_frame_.data. | 148 // The number of bytes allocated buffer for captured_frame_.data. |
| 149 uint32 frame_buffer_size_; | 149 uint32 frame_buffer_size_; |
| 150 FileReadThread* file_read_thread_; | 150 FileReadThread* file_read_thread_; |
| 151 int repeat_; // How many times to repeat the file. | 151 int repeat_; // How many times to repeat the file. |
| 152 int64 start_time_ns_; // Time when the file video capturer starts. | 152 int64 start_time_ns_; // Time when the file video capturer starts. |
| 153 int64 last_frame_timestamp_ns_; // Timestamp of last read frame. | 153 int64 last_frame_timestamp_ns_; // Timestamp of last read frame. |
| 154 bool ignore_framerate_; | 154 bool ignore_framerate_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(FileVideoCapturer); | 156 RTC_DISALLOW_COPY_AND_ASSIGN(FileVideoCapturer); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 } // namespace cricket | 159 } // namespace cricket |
| 160 | 160 |
| 161 #endif // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ | 161 #endif // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ |
| OLD | NEW |