OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004--2014 Google Inc. | 3 * Copyright 2004--2014 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 // Check if Run() is finished. | 80 // Check if Run() is finished. |
81 bool Finished() const { | 81 bool Finished() const { |
82 rtc::CritScope cs(&crit_); | 82 rtc::CritScope cs(&crit_); |
83 return finished_; | 83 return finished_; |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 YuvFramesCapturer* capturer_; | 87 YuvFramesCapturer* capturer_; |
88 mutable rtc::CriticalSection crit_; | 88 rtc::CriticalSection crit_; |
89 bool finished_; | 89 bool finished_; |
90 | 90 |
91 RTC_DISALLOW_COPY_AND_ASSIGN(YuvFramesThread); | 91 RTC_DISALLOW_COPY_AND_ASSIGN(YuvFramesThread); |
92 }; | 92 }; |
93 | 93 |
94 ///////////////////////////////////////////////////////////////////// | 94 ///////////////////////////////////////////////////////////////////// |
95 // Implementation of class YuvFramesCapturer. | 95 // Implementation of class YuvFramesCapturer. |
96 ///////////////////////////////////////////////////////////////////// | 96 ///////////////////////////////////////////////////////////////////// |
97 | 97 |
98 const char* YuvFramesCapturer::kYuvFrameDeviceName = "YuvFramesGenerator"; | 98 const char* YuvFramesCapturer::kYuvFrameDeviceName = "YuvFramesGenerator"; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int32_t YuvFramesCapturer::GetBarcodeValue() { | 190 int32_t YuvFramesCapturer::GetBarcodeValue() { |
191 if (barcode_reference_timestamp_millis_ == -1 || | 191 if (barcode_reference_timestamp_millis_ == -1 || |
192 frame_index_ % barcode_interval_ != 0) { | 192 frame_index_ % barcode_interval_ != 0) { |
193 return -1; | 193 return -1; |
194 } | 194 } |
195 int64_t now_millis = static_cast<int64_t>(rtc::Time()) * 1000; | 195 int64_t now_millis = static_cast<int64_t>(rtc::Time()) * 1000; |
196 return static_cast<int32_t>(now_millis - barcode_reference_timestamp_millis_); | 196 return static_cast<int32_t>(now_millis - barcode_reference_timestamp_millis_); |
197 } | 197 } |
198 | 198 |
199 } // namespace cricket | 199 } // namespace cricket |
OLD | NEW |