Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: webrtc/test/fake_decoder.cc

Issue 2378003002: Delete webrtc::VideoFrame::CreateEmptyFrame. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "webrtc/test/fake_decoder.h" 11 #include "webrtc/test/fake_decoder.h"
12 12
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace webrtc { 15 namespace webrtc {
16 namespace test { 16 namespace test {
17 17
18 FakeDecoder::FakeDecoder() : callback_(NULL) {} 18 FakeDecoder::FakeDecoder() : callback_(NULL) {}
19 19
20 int32_t FakeDecoder::InitDecode(const VideoCodec* config, 20 int32_t FakeDecoder::InitDecode(const VideoCodec* config,
21 int32_t number_of_cores) { 21 int32_t number_of_cores) {
22 config_ = *config; 22 config_ = *config;
23 size_t width = config->width;
24 size_t height = config->height;
25 frame_.CreateEmptyFrame(static_cast<int>(width),
26 static_cast<int>(height),
27 static_cast<int>(width),
28 static_cast<int>((width + 1) / 2),
29 static_cast<int>((width + 1) / 2));
30 return WEBRTC_VIDEO_CODEC_OK; 23 return WEBRTC_VIDEO_CODEC_OK;
31 } 24 }
32 25
33 int32_t FakeDecoder::Decode(const EncodedImage& input, 26 int32_t FakeDecoder::Decode(const EncodedImage& input,
34 bool missing_frames, 27 bool missing_frames,
35 const RTPFragmentationHeader* fragmentation, 28 const RTPFragmentationHeader* fragmentation,
36 const CodecSpecificInfo* codec_specific_info, 29 const CodecSpecificInfo* codec_specific_info,
37 int64_t render_time_ms) { 30 int64_t render_time_ms) {
38 frame_.set_timestamp(input._timeStamp); 31 VideoFrame frame(I420Buffer::Create(config_.width, config_.height),
39 frame_.set_ntp_time_ms(input.ntp_time_ms_); 32 webrtc::kVideoRotation_0,
40 frame_.set_render_time_ms(render_time_ms); 33 render_time_ms * rtc::kNumMicrosecsPerMillisec);
34 frame.set_timestamp(input._timeStamp);
35 frame.set_ntp_time_ms(input.ntp_time_ms_);
41 36
42 callback_->Decoded(frame_); 37 callback_->Decoded(frame);
43 38
44 return WEBRTC_VIDEO_CODEC_OK; 39 return WEBRTC_VIDEO_CODEC_OK;
45 } 40 }
46 41
47 int32_t FakeDecoder::RegisterDecodeCompleteCallback( 42 int32_t FakeDecoder::RegisterDecodeCompleteCallback(
48 DecodedImageCallback* callback) { 43 DecodedImageCallback* callback) {
49 callback_ = callback; 44 callback_ = callback;
50 return WEBRTC_VIDEO_CODEC_OK; 45 return WEBRTC_VIDEO_CODEC_OK;
51 } 46 }
52 47
(...skipping 27 matching lines...) Expand all
80 } 75 }
81 return FakeDecoder::Decode(input, 76 return FakeDecoder::Decode(input,
82 missing_frames, 77 missing_frames,
83 fragmentation, 78 fragmentation,
84 codec_specific_info, 79 codec_specific_info,
85 render_time_ms); 80 render_time_ms);
86 } 81 }
87 82
88 } // namespace test 83 } // namespace test
89 } // namespace webrtc 84 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698