OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::unique_ptr<VideoFrame> frame_; | 86 std::unique_ptr<VideoFrame> frame_; |
87 }; | 87 }; |
88 | 88 |
89 class EncodedImageCallbackImpl : public EncodedImageCallback { | 89 class EncodedImageCallbackImpl : public EncodedImageCallback { |
90 public: | 90 public: |
91 explicit EncodedImageCallbackImpl(Clock* clock) | 91 explicit EncodedImageCallbackImpl(Clock* clock) |
92 : clock_(clock), start_time_ms_(clock_->TimeInMilliseconds()) {} | 92 : clock_(clock), start_time_ms_(clock_->TimeInMilliseconds()) {} |
93 | 93 |
94 virtual ~EncodedImageCallbackImpl() {} | 94 virtual ~EncodedImageCallbackImpl() {} |
95 | 95 |
96 Result OnEncodedImage(const EncodedImage& encoded_image, | 96 int32_t Encoded(const EncodedImage& encoded_image, |
97 const CodecSpecificInfo* codec_specific_info, | 97 const CodecSpecificInfo* codec_specific_info, |
98 const RTPFragmentationHeader* fragmentation) override { | 98 const RTPFragmentationHeader* fragmentation) override { |
99 assert(codec_specific_info); | 99 assert(codec_specific_info); |
100 frame_data_.push_back( | 100 frame_data_.push_back( |
101 FrameData(encoded_image._length, *codec_specific_info)); | 101 FrameData(encoded_image._length, *codec_specific_info)); |
102 return Result(Result::OK, encoded_image._timeStamp); | 102 return 0; |
103 } | 103 } |
104 | 104 |
105 void Reset() { | 105 void Reset() { |
106 frame_data_.clear(); | 106 frame_data_.clear(); |
107 start_time_ms_ = clock_->TimeInMilliseconds(); | 107 start_time_ms_ = clock_->TimeInMilliseconds(); |
108 } | 108 } |
109 | 109 |
110 float FramerateFpsWithinTemporalLayer(int temporal_layer) { | 110 float FramerateFpsWithinTemporalLayer(int temporal_layer) { |
111 return CountFramesWithinTemporalLayer(temporal_layer) * | 111 return CountFramesWithinTemporalLayer(temporal_layer) * |
112 (1000.0 / interval_ms()); | 112 (1000.0 / interval_ms()); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 { | 507 { |
508 // TODO(andresp): Find out why this fails with framerate = 7.5 | 508 // TODO(andresp): Find out why this fails with framerate = 7.5 |
509 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | 509 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; |
510 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | 510 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); |
511 } | 511 } |
512 } | 512 } |
513 } // namespace | 513 } // namespace |
514 } // namespace vcm | 514 } // namespace vcm |
515 } // namespace webrtc | 515 } // namespace webrtc |
OLD | NEW |