OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 int frames_in_; // Number of input frames. | 85 int frames_in_; // Number of input frames. |
86 int frames_out_; // Number of output frames. | 86 int frames_out_; // Number of output frames. |
87 int frames_scaled_; // Number of frames scaled. | 87 int frames_scaled_; // Number of frames scaled. |
88 int adaption_changes_; // Number of changes in scale factor. | 88 int adaption_changes_; // Number of changes in scale factor. |
89 size_t previous_width_; // Previous adapter output width. | 89 size_t previous_width_; // Previous adapter output width. |
90 size_t previous_height_; // Previous adapter output height. | 90 size_t previous_height_; // Previous adapter output height. |
91 int64 interval_next_frame_; | 91 int64 interval_next_frame_; |
92 // The critical section to protect the above variables. | 92 // The critical section to protect the above variables. |
93 rtc::CriticalSection critical_section_; | 93 rtc::CriticalSection critical_section_; |
94 | 94 |
95 DISALLOW_COPY_AND_ASSIGN(VideoAdapter); | 95 RTC_DISALLOW_COPY_AND_ASSIGN(VideoAdapter); |
96 }; | 96 }; |
97 | 97 |
98 // CoordinatedVideoAdapter adapts the video input to the encoder by coordinating | 98 // CoordinatedVideoAdapter adapts the video input to the encoder by coordinating |
99 // the format request from the server, the resolution request from the encoder, | 99 // the format request from the server, the resolution request from the encoder, |
100 // and the CPU load. | 100 // and the CPU load. |
101 class CoordinatedVideoAdapter | 101 class CoordinatedVideoAdapter |
102 : public VideoAdapter, public sigslot::has_slots<> { | 102 : public VideoAdapter, public sigslot::has_slots<> { |
103 public: | 103 public: |
104 enum AdaptRequest { UPGRADE, KEEP, DOWNGRADE }; | 104 enum AdaptRequest { UPGRADE, KEEP, DOWNGRADE }; |
105 enum AdaptReasonEnum { | 105 enum AdaptReasonEnum { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 int encoder_desired_num_pixels_; | 194 int encoder_desired_num_pixels_; |
195 int cpu_desired_num_pixels_; | 195 int cpu_desired_num_pixels_; |
196 CoordinatedVideoAdapter::AdaptReason adapt_reason_; | 196 CoordinatedVideoAdapter::AdaptReason adapt_reason_; |
197 // The critical section to protect handling requests. | 197 // The critical section to protect handling requests. |
198 rtc::CriticalSection request_critical_section_; | 198 rtc::CriticalSection request_critical_section_; |
199 | 199 |
200 // The weighted average of cpu load over time. It's always updated (if cpu | 200 // The weighted average of cpu load over time. It's always updated (if cpu |
201 // adaptation is on), but only used if cpu_smoothing_ is set. | 201 // adaptation is on), but only used if cpu_smoothing_ is set. |
202 float system_load_average_; | 202 float system_load_average_; |
203 | 203 |
204 DISALLOW_COPY_AND_ASSIGN(CoordinatedVideoAdapter); | 204 RTC_DISALLOW_COPY_AND_ASSIGN(CoordinatedVideoAdapter); |
205 }; | 205 }; |
206 | 206 |
207 } // namespace cricket | 207 } // namespace cricket |
208 | 208 |
209 #endif // TALK_MEDIA_BASE_VIDEOADAPTER_H_ // NOLINT | 209 #endif // TALK_MEDIA_BASE_VIDEOADAPTER_H_ // NOLINT |
OLD | NEW |