| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 ///////////////////////////////////////////////////////////////////// | 74 ///////////////////////////////////////////////////////////////////// |
| 75 // Implementation of struct CapturedFrame | 75 // Implementation of struct CapturedFrame |
| 76 ///////////////////////////////////////////////////////////////////// | 76 ///////////////////////////////////////////////////////////////////// |
| 77 CapturedFrame::CapturedFrame() | 77 CapturedFrame::CapturedFrame() |
| 78 : width(0), | 78 : width(0), |
| 79 height(0), | 79 height(0), |
| 80 fourcc(0), | 80 fourcc(0), |
| 81 pixel_width(0), | 81 pixel_width(0), |
| 82 pixel_height(0), | 82 pixel_height(0), |
| 83 elapsed_time(0), | |
| 84 time_stamp(0), | 83 time_stamp(0), |
| 85 data_size(0), | 84 data_size(0), |
| 86 rotation(0), | 85 rotation(0), |
| 87 data(NULL) {} | 86 data(NULL) {} |
| 88 | 87 |
| 89 // TODO(fbarchard): Remove this function once lmimediaengine stops using it. | 88 // TODO(fbarchard): Remove this function once lmimediaengine stops using it. |
| 90 bool CapturedFrame::GetDataSize(uint32* size) const { | 89 bool CapturedFrame::GetDataSize(uint32* size) const { |
| 91 if (!size || data_size == CapturedFrame::kUnknownDataSize) { | 90 if (!size || data_size == CapturedFrame::kUnknownDataSize) { |
| 92 return false; | 91 return false; |
| 93 } | 92 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 for (std::string::const_iterator i = fourcc_name.begin(); | 315 for (std::string::const_iterator i = fourcc_name.begin(); |
| 317 i < fourcc_name.end(); ++i) { | 316 i < fourcc_name.end(); ++i) { |
| 318 // Test character is printable; Avoid isprint() which asserts on negatives. | 317 // Test character is printable; Avoid isprint() which asserts on negatives. |
| 319 if (*i < 32 || *i >= 127) { | 318 if (*i < 32 || *i >= 127) { |
| 320 fourcc_name = ""; | 319 fourcc_name = ""; |
| 321 break; | 320 break; |
| 322 } | 321 } |
| 323 } | 322 } |
| 324 | 323 |
| 325 std::ostringstream ss; | 324 std::ostringstream ss; |
| 326 ss << fourcc_name << captured_frame->width << "x" << captured_frame->height | 325 ss << fourcc_name << captured_frame->width << "x" << captured_frame->height; |
| 327 << "x" << VideoFormat::IntervalToFpsFloat(captured_frame->elapsed_time); | |
| 328 return ss.str(); | 326 return ss.str(); |
| 329 } | 327 } |
| 330 | 328 |
| 331 void VideoCapturer::set_frame_factory(VideoFrameFactory* frame_factory) { | 329 void VideoCapturer::set_frame_factory(VideoFrameFactory* frame_factory) { |
| 332 frame_factory_.reset(frame_factory); | 330 frame_factory_.reset(frame_factory); |
| 333 if (frame_factory) { | 331 if (frame_factory) { |
| 334 frame_factory->SetApplyRotation(apply_rotation_); | 332 frame_factory->SetApplyRotation(apply_rotation_); |
| 335 } | 333 } |
| 336 } | 334 } |
| 337 | 335 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 void VideoCapturer::GetVariableSnapshot( | 731 void VideoCapturer::GetVariableSnapshot( |
| 734 const rtc::RollingAccumulator<T>& data, | 732 const rtc::RollingAccumulator<T>& data, |
| 735 VariableInfo<T>* stats) { | 733 VariableInfo<T>* stats) { |
| 736 stats->max_val = data.ComputeMax(); | 734 stats->max_val = data.ComputeMax(); |
| 737 stats->mean = data.ComputeMean(); | 735 stats->mean = data.ComputeMean(); |
| 738 stats->min_val = data.ComputeMin(); | 736 stats->min_val = data.ComputeMin(); |
| 739 stats->variance = data.ComputeVariance(); | 737 stats->variance = data.ComputeVariance(); |
| 740 } | 738 } |
| 741 | 739 |
| 742 } // namespace cricket | 740 } // namespace cricket |
| OLD | NEW |