OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // TODO (pwestin): add a link to the design document describing the generic | 5 // TODO (pwestin): add a link to the design document describing the generic |
6 // protocol and the VP8 specific details. | 6 // protocol and the VP8 specific details. |
7 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h" | 7 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
13 #include "media/cast/cast_defines.h" | 13 #include "media/cast/cast_defines.h" |
14 #include "media/cast/rtp_common/rtp_defines.h" | |
15 #include "third_party/libvpx/source/libvpx/vpx/vp8cx.h" | 14 #include "third_party/libvpx/source/libvpx/vpx/vp8cx.h" |
16 | 15 |
17 namespace media { | 16 namespace media { |
18 namespace cast { | 17 namespace cast { |
19 | 18 |
20 static const uint32 kMinIntra = 300; | 19 static const uint32 kMinIntra = 300; |
21 | 20 |
22 Vp8Encoder::Vp8Encoder(const VideoSenderConfig& video_config, | 21 Vp8Encoder::Vp8Encoder(const VideoSenderConfig& video_config, |
23 uint8 max_unacked_frames) | 22 uint8 max_unacked_frames) |
24 : cast_config_(video_config), | 23 : cast_config_(video_config), |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 float scale_parameter = 0.5; | 363 float scale_parameter = 0.5; |
365 uint32 target_pct = optimal_buffer_size_ms * scale_parameter * | 364 uint32 target_pct = optimal_buffer_size_ms * scale_parameter * |
366 cast_config_.max_frame_rate / 10; | 365 cast_config_.max_frame_rate / 10; |
367 | 366 |
368 // Don't go below 3 times the per frame bandwidth. | 367 // Don't go below 3 times the per frame bandwidth. |
369 return std::max(target_pct, kMinIntra); | 368 return std::max(target_pct, kMinIntra); |
370 } | 369 } |
371 | 370 |
372 } // namespace cast | 371 } // namespace cast |
373 } // namespace media | 372 } // namespace media |
OLD | NEW |