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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 mutable rtc::CriticalSection crit_; |
89 bool finished_; | 89 bool finished_; |
90 | 90 |
91 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"; |
99 | 99 |
100 // TODO(shaowei): allow width_ and height_ to be configurable. | 100 // TODO(shaowei): allow width_ and height_ to be configurable. |
101 YuvFramesCapturer::YuvFramesCapturer() | 101 YuvFramesCapturer::YuvFramesCapturer() |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 int32 YuvFramesCapturer::GetBarcodeValue() { | 191 int32 YuvFramesCapturer::GetBarcodeValue() { |
192 if (barcode_reference_timestamp_millis_ == -1 || | 192 if (barcode_reference_timestamp_millis_ == -1 || |
193 frame_index_ % barcode_interval_ != 0) { | 193 frame_index_ % barcode_interval_ != 0) { |
194 return -1; | 194 return -1; |
195 } | 195 } |
196 int64 now_millis = static_cast<int64>(rtc::Time()) * 1000; | 196 int64 now_millis = static_cast<int64>(rtc::Time()) * 1000; |
197 return static_cast<int32>(now_millis - barcode_reference_timestamp_millis_); | 197 return static_cast<int32>(now_millis - barcode_reference_timestamp_millis_); |
198 } | 198 } |
199 | 199 |
200 } // namespace cricket | 200 } // namespace cricket |
OLD | NEW |