OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/cast/test/fake_video_encode_accelerator.h" | 5 #include "media/cast/test/fake_video_encode_accelerator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 namespace cast { | 10 namespace cast { |
11 namespace test { | 11 namespace test { |
12 | 12 |
13 static const unsigned int kMinimumInputCount = 1; | 13 static const unsigned int kMinimumInputCount = 1; |
14 static const size_t kMinimumOutputBufferSize = 123456; | 14 static const size_t kMinimumOutputBufferSize = 123456; |
15 | 15 |
16 FakeVideoEncodeAccelerator::FakeVideoEncodeAccelerator( | 16 FakeVideoEncodeAccelerator::FakeVideoEncodeAccelerator() : first_(true) {} |
17 VideoEncodeAccelerator::Client* client) | |
18 : client_(client), first_(true) { | |
19 DCHECK(client); | |
20 } | |
21 | 17 |
22 FakeVideoEncodeAccelerator::~FakeVideoEncodeAccelerator() {} | 18 FakeVideoEncodeAccelerator::~FakeVideoEncodeAccelerator() {} |
23 | 19 |
24 void FakeVideoEncodeAccelerator::Initialize( | 20 void FakeVideoEncodeAccelerator::Initialize( |
| 21 Client* client, |
25 media::VideoFrame::Format input_format, | 22 media::VideoFrame::Format input_format, |
26 const gfx::Size& input_visible_size, | 23 const gfx::Size& input_visible_size, |
27 VideoCodecProfile output_profile, | 24 VideoCodecProfile output_profile, |
28 uint32 initial_bitrate) { | 25 uint32 initial_bitrate) { |
29 DCHECK(client_); | 26 client_ = client; |
30 | |
31 if (output_profile != media::VP8PROFILE_MAIN && | 27 if (output_profile != media::VP8PROFILE_MAIN && |
32 output_profile != media::H264PROFILE_MAIN) { | 28 output_profile != media::H264PROFILE_MAIN) { |
33 client_->NotifyError(kInvalidArgumentError); | 29 client_->NotifyError(kInvalidArgumentError); |
34 return; | 30 return; |
35 } | 31 } |
36 client_->NotifyInitializeDone(); | 32 client_->NotifyInitializeDone(); |
37 client_->RequireBitstreamBuffers( | 33 client_->RequireBitstreamBuffers( |
38 kMinimumInputCount, input_visible_size, kMinimumOutputBufferSize); | 34 kMinimumInputCount, input_visible_size, kMinimumOutputBufferSize); |
39 } | 35 } |
40 | 36 |
(...skipping 24 matching lines...) Expand all Loading... |
65 uint32 bitrate, | 61 uint32 bitrate, |
66 uint32 framerate) { | 62 uint32 framerate) { |
67 // No-op. | 63 // No-op. |
68 } | 64 } |
69 | 65 |
70 void FakeVideoEncodeAccelerator::Destroy() { delete this; } | 66 void FakeVideoEncodeAccelerator::Destroy() { delete this; } |
71 | 67 |
72 } // namespace test | 68 } // namespace test |
73 } // namespace cast | 69 } // namespace cast |
74 } // namespace media | 70 } // namespace media |
OLD | NEW |