| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool Init(const Device& device); | 115 bool Init(const Device& device); |
| 116 | 116 |
| 117 // Override virtual methods of parent class VideoCapturer. | 117 // Override virtual methods of parent class VideoCapturer. |
| 118 virtual CaptureState Start(const VideoFormat& capture_format); | 118 virtual CaptureState Start(const VideoFormat& capture_format); |
| 119 virtual void Stop(); | 119 virtual void Stop(); |
| 120 virtual bool IsRunning(); | 120 virtual bool IsRunning(); |
| 121 virtual bool IsScreencast() const { return false; } | 121 virtual bool IsScreencast() const { return false; } |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 // Override virtual methods of parent class VideoCapturer. | 124 // Override virtual methods of parent class VideoCapturer. |
| 125 virtual bool GetPreferredFourccs(std::vector<uint32>* fourccs); | 125 virtual bool GetPreferredFourccs(std::vector<uint32_t>* fourccs); |
| 126 | 126 |
| 127 // Read the frame header from the file stream, video_file_. | 127 // Read the frame header from the file stream, video_file_. |
| 128 rtc::StreamResult ReadFrameHeader(CapturedFrame* frame); | 128 rtc::StreamResult ReadFrameHeader(CapturedFrame* frame); |
| 129 | 129 |
| 130 // Read a frame and determine how long to wait for the next frame. If the | 130 // Read a frame and determine how long to wait for the next frame. If the |
| 131 // frame is read successfully, Set the output parameter, wait_time_ms and | 131 // frame is read successfully, Set the output parameter, wait_time_ms and |
| 132 // return true. Otherwise, do not change wait_time_ms and return false. | 132 // return true. Otherwise, do not change wait_time_ms and return false. |
| 133 bool ReadFrame(bool first_frame, int* wait_time_ms); | 133 bool ReadFrame(bool first_frame, int* wait_time_ms); |
| 134 | 134 |
| 135 // Return the CapturedFrame - useful for extracting contents after reading | 135 // Return the CapturedFrame - useful for extracting contents after reading |
| 136 // a frame. Should be used only while still reading a file (i.e. only while | 136 // a frame. Should be used only while still reading a file (i.e. only while |
| 137 // the CapturedFrame object still exists). | 137 // the CapturedFrame object still exists). |
| 138 const CapturedFrame* frame() const { | 138 const CapturedFrame* frame() const { |
| 139 return &captured_frame_; | 139 return &captured_frame_; |
| 140 } | 140 } |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 class FileReadThread; // Forward declaration, defined in .cc. | 143 class FileReadThread; // Forward declaration, defined in .cc. |
| 144 | 144 |
| 145 static const char* kVideoFileDevicePrefix; | 145 static const char* kVideoFileDevicePrefix; |
| 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_t 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 last_frame_timestamp_ns_; // Timestamp of last read frame. | 152 int64_t last_frame_timestamp_ns_; // Timestamp of last read frame. |
| 153 bool ignore_framerate_; | 153 bool ignore_framerate_; |
| 154 | 154 |
| 155 RTC_DISALLOW_COPY_AND_ASSIGN(FileVideoCapturer); | 155 RTC_DISALLOW_COPY_AND_ASSIGN(FileVideoCapturer); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace cricket | 158 } // namespace cricket |
| 159 | 159 |
| 160 #endif // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ | 160 #endif // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ |
| OLD | NEW |