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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const int kNumBlackFramesOnMute = 30; | 52 const int kNumBlackFramesOnMute = 30; |
53 | 53 |
54 // MessageHandler constants. | 54 // MessageHandler constants. |
55 enum { | 55 enum { |
56 MSG_DO_PAUSE = 0, | 56 MSG_DO_PAUSE = 0, |
57 MSG_DO_UNPAUSE, | 57 MSG_DO_UNPAUSE, |
58 MSG_STATE_CHANGE | 58 MSG_STATE_CHANGE |
59 }; | 59 }; |
60 | 60 |
61 static const int64_t kMaxDistance = ~(static_cast<int64_t>(1) << 63); | 61 static const int64_t kMaxDistance = ~(static_cast<int64_t>(1) << 63); |
62 #ifdef LINUX | 62 #ifdef WEBRTC_LINUX |
63 static const int kYU12Penalty = 16; // Needs to be higher than MJPG index. | 63 static const int kYU12Penalty = 16; // Needs to be higher than MJPG index. |
64 #endif | 64 #endif |
65 static const int kDefaultScreencastFps = 5; | 65 static const int kDefaultScreencastFps = 5; |
66 typedef rtc::TypedMessageData<CaptureState> StateChangeParams; | 66 typedef rtc::TypedMessageData<CaptureState> StateChangeParams; |
67 | 67 |
68 // Limit stats data collections to ~20 seconds of 30fps data before dropping | 68 // Limit stats data collections to ~20 seconds of 30fps data before dropping |
69 // old data in case stats aren't reset for long periods of time. | 69 // old data in case stats aren't reset for long periods of time. |
70 static const size_t kMaxAccumulatorSize = 600; | 70 static const size_t kMaxAccumulatorSize = 600; |
71 | 71 |
72 } // namespace | 72 } // namespace |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 if (FOURCC_ANY == desired.fourcc) { | 587 if (FOURCC_ANY == desired.fourcc) { |
588 // Any fourcc is OK for the desired. Use preference to find best fourcc. | 588 // Any fourcc is OK for the desired. Use preference to find best fourcc. |
589 std::vector<uint32_t> preferred_fourccs; | 589 std::vector<uint32_t> preferred_fourccs; |
590 if (!GetPreferredFourccs(&preferred_fourccs)) { | 590 if (!GetPreferredFourccs(&preferred_fourccs)) { |
591 return distance; | 591 return distance; |
592 } | 592 } |
593 | 593 |
594 for (size_t i = 0; i < preferred_fourccs.size(); ++i) { | 594 for (size_t i = 0; i < preferred_fourccs.size(); ++i) { |
595 if (supported_fourcc == CanonicalFourCC(preferred_fourccs[i])) { | 595 if (supported_fourcc == CanonicalFourCC(preferred_fourccs[i])) { |
596 delta_fourcc = i; | 596 delta_fourcc = i; |
597 #ifdef LINUX | 597 #ifdef WEBRTC_LINUX |
598 // For HD avoid YU12 which is a software conversion and has 2 bugs | 598 // For HD avoid YU12 which is a software conversion and has 2 bugs |
599 // b/7326348 b/6960899. Reenable when fixed. | 599 // b/7326348 b/6960899. Reenable when fixed. |
600 if (supported.height >= 720 && (supported_fourcc == FOURCC_YU12 || | 600 if (supported.height >= 720 && (supported_fourcc == FOURCC_YU12 || |
601 supported_fourcc == FOURCC_YV12)) { | 601 supported_fourcc == FOURCC_YV12)) { |
602 delta_fourcc += kYU12Penalty; | 602 delta_fourcc += kYU12Penalty; |
603 } | 603 } |
604 #endif | 604 #endif |
605 break; | 605 break; |
606 } | 606 } |
607 } | 607 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 void VideoCapturer::GetVariableSnapshot( | 719 void VideoCapturer::GetVariableSnapshot( |
720 const rtc::RollingAccumulator<T>& data, | 720 const rtc::RollingAccumulator<T>& data, |
721 VariableInfo<T>* stats) { | 721 VariableInfo<T>* stats) { |
722 stats->max_val = data.ComputeMax(); | 722 stats->max_val = data.ComputeMax(); |
723 stats->mean = data.ComputeMean(); | 723 stats->mean = data.ComputeMean(); |
724 stats->min_val = data.ComputeMin(); | 724 stats->min_val = data.ComputeMin(); |
725 stats->variance = data.ComputeVariance(); | 725 stats->variance = data.ComputeVariance(); |
726 } | 726 } |
727 | 727 |
728 } // namespace cricket | 728 } // namespace cricket |
OLD | NEW |