| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Handle frame resizing | 53 // Handle frame resizing |
| 54 if (cfg_.g_w != img->d_w || cfg_.g_h != img->d_h) { | 54 if (cfg_.g_w != img->d_w || cfg_.g_h != img->d_h) { |
| 55 cfg_.g_w = img->d_w; | 55 cfg_.g_w = img->d_w; |
| 56 cfg_.g_h = img->d_h; | 56 cfg_.g_h = img->d_h; |
| 57 res = vpx_codec_enc_config_set(&encoder_, &cfg_); | 57 res = vpx_codec_enc_config_set(&encoder_, &cfg_); |
| 58 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 58 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Encode the frame | 61 // Encode the frame |
| 62 REGISTER_STATE_CHECK( | 62 API_REGISTER_STATE_CHECK( |
| 63 res = vpx_codec_encode(&encoder_, | 63 res = vpx_codec_encode(&encoder_, |
| 64 video.img(), video.pts(), video.duration(), | 64 video.img(), video.pts(), video.duration(), |
| 65 frame_flags, deadline_)); | 65 frame_flags, deadline_)); |
| 66 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 66 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void Encoder::Flush() { | 69 void Encoder::Flush() { |
| 70 const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0, | 70 const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0, |
| 71 deadline_); | 71 deadline_); |
| 72 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 72 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 if (decoder) | 216 if (decoder) |
| 217 delete decoder; | 217 delete decoder; |
| 218 delete encoder; | 218 delete encoder; |
| 219 | 219 |
| 220 if (!Continue()) | 220 if (!Continue()) |
| 221 break; | 221 break; |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace libvpx_test | 225 } // namespace libvpx_test |
| OLD | NEW |