OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 #include "webrtc/base/checks.h" | 22 #include "webrtc/base/checks.h" |
23 #include "webrtc/base/trace_event.h" | 23 #include "webrtc/base/trace_event.h" |
24 #include "webrtc/common_types.h" | 24 #include "webrtc/common_types.h" |
25 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 25 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
26 #include "webrtc/modules/include/module_common_types.h" | 26 #include "webrtc/modules/include/module_common_types.h" |
27 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 27 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
28 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" | 28 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" |
29 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" | 29 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" |
30 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" | 30 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" |
| 31 #include "webrtc/system_wrappers/include/clock.h" |
31 #include "webrtc/system_wrappers/include/tick_util.h" | 32 #include "webrtc/system_wrappers/include/tick_util.h" |
32 | 33 |
33 namespace webrtc { | 34 namespace webrtc { |
34 namespace { | 35 namespace { |
35 | 36 |
36 enum { kVp8ErrorPropagationTh = 30 }; | 37 enum { kVp8ErrorPropagationTh = 30 }; |
37 enum { kVp832ByteAlign = 32 }; | 38 enum { kVp832ByteAlign = 32 }; |
38 | 39 |
39 // VP8 denoiser states. | 40 // VP8 denoiser states. |
40 enum denoiserState { | 41 enum denoiserState { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 void VP8EncoderImpl::SetupTemporalLayers(int num_streams, | 322 void VP8EncoderImpl::SetupTemporalLayers(int num_streams, |
322 int num_temporal_layers, | 323 int num_temporal_layers, |
323 const VideoCodec& codec) { | 324 const VideoCodec& codec) { |
324 TemporalLayersFactory default_factory; | 325 TemporalLayersFactory default_factory; |
325 const TemporalLayersFactory* tl_factory = codec.codecSpecific.VP8.tl_factory; | 326 const TemporalLayersFactory* tl_factory = codec.codecSpecific.VP8.tl_factory; |
326 if (!tl_factory) | 327 if (!tl_factory) |
327 tl_factory = &default_factory; | 328 tl_factory = &default_factory; |
328 if (num_streams == 1) { | 329 if (num_streams == 1) { |
329 if (codec.mode == kScreensharing) { | 330 if (codec.mode == kScreensharing) { |
330 // Special mode when screensharing on a single stream. | 331 // Special mode when screensharing on a single stream. |
331 temporal_layers_.push_back( | 332 temporal_layers_.push_back(new ScreenshareLayers( |
332 new ScreenshareLayers(num_temporal_layers, rand())); | 333 num_temporal_layers, rand(), webrtc::Clock::GetRealTimeClock())); |
333 } else { | 334 } else { |
334 temporal_layers_.push_back( | 335 temporal_layers_.push_back( |
335 tl_factory->Create(num_temporal_layers, rand())); | 336 tl_factory->Create(num_temporal_layers, rand())); |
336 } | 337 } |
337 } else { | 338 } else { |
338 for (int i = 0; i < num_streams; ++i) { | 339 for (int i = 0; i < num_streams; ++i) { |
339 // TODO(andresp): crash if layers is invalid. | 340 // TODO(andresp): crash if layers is invalid. |
340 int layers = codec.simulcastStream[i].numberOfTemporalLayers; | 341 int layers = codec.simulcastStream[i].numberOfTemporalLayers; |
341 if (layers < 1) | 342 if (layers < 1) |
342 layers = 1; | 343 layers = 1; |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 return -1; | 1403 return -1; |
1403 } | 1404 } |
1404 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1405 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
1405 VPX_CODEC_OK) { | 1406 VPX_CODEC_OK) { |
1406 return -1; | 1407 return -1; |
1407 } | 1408 } |
1408 return 0; | 1409 return 0; |
1409 } | 1410 } |
1410 | 1411 |
1411 } // namespace webrtc | 1412 } // namespace webrtc |
OLD | NEW |