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() |
17 VideoEncodeAccelerator::Client* client) | 17 : client_(NULL), first_(true) {} |
18 : client_(client), first_(true) { | |
19 DCHECK(client); | |
20 } | |
21 | 18 |
22 FakeVideoEncodeAccelerator::~FakeVideoEncodeAccelerator() {} | 19 FakeVideoEncodeAccelerator::~FakeVideoEncodeAccelerator() {} |
23 | 20 |
24 void FakeVideoEncodeAccelerator::Initialize( | 21 void FakeVideoEncodeAccelerator::Initialize( |
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 | 27 client_ = client; |
31 if (output_profile != media::VP8PROFILE_MAIN && | 28 if (output_profile != media::VP8PROFILE_MAIN && |
32 output_profile != media::H264PROFILE_MAIN) { | 29 output_profile != media::H264PROFILE_MAIN) { |
33 client_->NotifyError(kInvalidArgumentError); | 30 client_->NotifyError(kInvalidArgumentError); |
34 return; | 31 return; |
35 } | 32 } |
36 client_->NotifyInitializeDone(); | 33 client_->NotifyInitializeDone(); |
37 client_->RequireBitstreamBuffers( | 34 client_->RequireBitstreamBuffers( |
38 kMinimumInputCount, input_visible_size, kMinimumOutputBufferSize); | 35 kMinimumInputCount, input_visible_size, kMinimumOutputBufferSize); |
39 } | 36 } |
40 | 37 |
(...skipping 24 matching lines...) Expand all Loading... |
65 uint32 bitrate, | 62 uint32 bitrate, |
66 uint32 framerate) { | 63 uint32 framerate) { |
67 // No-op. | 64 // No-op. |
68 } | 65 } |
69 | 66 |
70 void FakeVideoEncodeAccelerator::Destroy() { delete this; } | 67 void FakeVideoEncodeAccelerator::Destroy() { delete this; } |
71 | 68 |
72 } // namespace test | 69 } // namespace test |
73 } // namespace cast | 70 } // namespace cast |
74 } // namespace media | 71 } // namespace media |
OLD | NEW |