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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 weak_this_factory_.InvalidateWeakPtrs(); | 27 weak_this_factory_.InvalidateWeakPtrs(); |
28 } | 28 } |
29 | 29 |
30 bool FakeVideoEncodeAccelerator::Initialize( | 30 bool FakeVideoEncodeAccelerator::Initialize( |
31 media::VideoFrame::Format input_format, | 31 media::VideoFrame::Format input_format, |
32 const gfx::Size& input_visible_size, | 32 const gfx::Size& input_visible_size, |
33 VideoCodecProfile output_profile, | 33 VideoCodecProfile output_profile, |
34 uint32 initial_bitrate, | 34 uint32 initial_bitrate, |
35 Client* client) { | 35 Client* client) { |
36 client_ = client; | 36 client_ = client; |
37 if (output_profile != media::VP8PROFILE_MAIN && | 37 if (output_profile != media::VP8PROFILE_NOT_NEEDED && |
38 output_profile != media::H264PROFILE_MAIN) { | 38 output_profile != media::H264PROFILE_MAIN) { |
39 return false; | 39 return false; |
40 } | 40 } |
41 task_runner_->PostTask( | 41 task_runner_->PostTask( |
42 FROM_HERE, | 42 FROM_HERE, |
43 base::Bind(&FakeVideoEncodeAccelerator::DoRequireBitstreamBuffers, | 43 base::Bind(&FakeVideoEncodeAccelerator::DoRequireBitstreamBuffers, |
44 weak_this_factory_.GetWeakPtr(), | 44 weak_this_factory_.GetWeakPtr(), |
45 kMinimumInputCount, | 45 kMinimumInputCount, |
46 input_visible_size, | 46 input_visible_size, |
47 kMinimumOutputBufferSize)); | 47 kMinimumOutputBufferSize)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void FakeVideoEncodeAccelerator::DoBitstreamBufferReady( | 100 void FakeVideoEncodeAccelerator::DoBitstreamBufferReady( |
101 int32 bitstream_buffer_id, | 101 int32 bitstream_buffer_id, |
102 size_t payload_size, | 102 size_t payload_size, |
103 bool key_frame) const { | 103 bool key_frame) const { |
104 client_->BitstreamBufferReady(bitstream_buffer_id, payload_size, key_frame); | 104 client_->BitstreamBufferReady(bitstream_buffer_id, payload_size, key_frame); |
105 } | 105 } |
106 | 106 |
107 } // namespace test | 107 } // namespace test |
108 } // namespace cast | 108 } // namespace cast |
109 } // namespace media | 109 } // namespace media |
OLD | NEW |