| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 if (size == 0u) { | 108 if (size == 0u) { |
| 109 return false; // Width and/or Height were zero. | 109 return false; // Width and/or Height were zero. |
| 110 } | 110 } |
| 111 | 111 |
| 112 cricket::CapturedFrame frame; | 112 cricket::CapturedFrame frame; |
| 113 frame.width = width; | 113 frame.width = width; |
| 114 frame.height = height; | 114 frame.height = height; |
| 115 frame.fourcc = fourcc; | 115 frame.fourcc = fourcc; |
| 116 frame.data_size = size; | 116 frame.data_size = size; |
| 117 frame.elapsed_time = next_timestamp_; | |
| 118 frame.time_stamp = initial_unix_timestamp_ + next_timestamp_; | 117 frame.time_stamp = initial_unix_timestamp_ + next_timestamp_; |
| 119 next_timestamp_ += timestamp_interval; | 118 next_timestamp_ += timestamp_interval; |
| 120 | 119 |
| 121 rtc::scoped_ptr<char[]> data(new char[size]); | 120 rtc::scoped_ptr<char[]> data(new char[size]); |
| 122 frame.data = data.get(); | 121 frame.data = data.get(); |
| 123 // Copy something non-zero into the buffer so Validate wont complain that | 122 // Copy something non-zero into the buffer so Validate wont complain that |
| 124 // the frame is all duplicate. | 123 // the frame is all duplicate. |
| 125 memset(frame.data, 1, size / 2); | 124 memset(frame.data, 1, size / 2); |
| 126 memset(reinterpret_cast<uint8*>(frame.data) + (size / 2), 2, | 125 memset(reinterpret_cast<uint8*>(frame.data) + (size / 2), 2, |
| 127 size - (size / 2)); | 126 size - (size / 2)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 bool running_; | 173 bool running_; |
| 175 int64 initial_unix_timestamp_; | 174 int64 initial_unix_timestamp_; |
| 176 int64 next_timestamp_; | 175 int64 next_timestamp_; |
| 177 bool is_screencast_; | 176 bool is_screencast_; |
| 178 webrtc::VideoRotation rotation_; | 177 webrtc::VideoRotation rotation_; |
| 179 }; | 178 }; |
| 180 | 179 |
| 181 } // namespace cricket | 180 } // namespace cricket |
| 182 | 181 |
| 183 #endif // TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ | 182 #endif // TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ |
| OLD | NEW |