OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 test_->decoded_frame_event_.Set(); | 47 test_->decoded_frame_event_.Set(); |
48 } | 48 } |
49 | 49 |
50 void VideoCodecTest::SetUp() { | 50 void VideoCodecTest::SetUp() { |
51 // Using a QCIF image. Processing only one frame. | 51 // Using a QCIF image. Processing only one frame. |
52 FILE* source_file_ = | 52 FILE* source_file_ = |
53 fopen(test::ResourcePath("paris_qcif", "yuv").c_str(), "rb"); | 53 fopen(test::ResourcePath("paris_qcif", "yuv").c_str(), "rb"); |
54 ASSERT_TRUE(source_file_ != NULL); | 54 ASSERT_TRUE(source_file_ != NULL); |
55 rtc::scoped_refptr<VideoFrameBuffer> video_frame_buffer( | 55 rtc::scoped_refptr<VideoFrameBuffer> video_frame_buffer( |
56 test::ReadI420Buffer(kWidth, kHeight, source_file_)); | 56 test::ReadI420Buffer(kWidth, kHeight, source_file_)); |
57 input_frame_.reset(new VideoFrame(video_frame_buffer, kVideoRotation_0, 0)); | 57 input_frame_.reset(new VideoFrame(video_frame_buffer, kVideoRotation_0, |
| 58 VideoContentType::kDefault, 0)); |
58 fclose(source_file_); | 59 fclose(source_file_); |
59 | 60 |
60 encoder_.reset(CreateEncoder()); | 61 encoder_.reset(CreateEncoder()); |
61 decoder_.reset(CreateDecoder()); | 62 decoder_.reset(CreateDecoder()); |
62 encoder_->RegisterEncodeCompleteCallback(&encode_complete_callback_); | 63 encoder_->RegisterEncodeCompleteCallback(&encode_complete_callback_); |
63 decoder_->RegisterDecodeCompleteCallback(&decode_complete_callback_); | 64 decoder_->RegisterDecodeCompleteCallback(&decode_complete_callback_); |
64 | 65 |
65 InitCodecs(); | 66 InitCodecs(); |
66 } | 67 } |
67 | 68 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 codec_inst.width = kWidth; | 107 codec_inst.width = kWidth; |
107 codec_inst.height = kHeight; | 108 codec_inst.height = kHeight; |
108 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 109 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
109 encoder_->InitEncode(&codec_inst, 1 /* number of cores */, | 110 encoder_->InitEncode(&codec_inst, 1 /* number of cores */, |
110 0 /* max payload size (unused) */)); | 111 0 /* max payload size (unused) */)); |
111 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 112 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
112 decoder_->InitDecode(&codec_inst, 1 /* number of cores */)); | 113 decoder_->InitDecode(&codec_inst, 1 /* number of cores */)); |
113 } | 114 } |
114 | 115 |
115 } // namespace webrtc | 116 } // namespace webrtc |
OLD | NEW |