| 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 20 matching lines...) Expand all Loading... |
| 31 weak_this_factory_.InvalidateWeakPtrs(); | 31 weak_this_factory_.InvalidateWeakPtrs(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool FakeVideoEncodeAccelerator::Initialize( | 34 bool FakeVideoEncodeAccelerator::Initialize( |
| 35 media::VideoFrame::Format input_format, | 35 media::VideoFrame::Format input_format, |
| 36 const gfx::Size& input_visible_size, | 36 const gfx::Size& input_visible_size, |
| 37 VideoCodecProfile output_profile, | 37 VideoCodecProfile output_profile, |
| 38 uint32 initial_bitrate, | 38 uint32 initial_bitrate, |
| 39 Client* client) { | 39 Client* client) { |
| 40 client_ = client; | 40 client_ = client; |
| 41 if (output_profile != media::VP8PROFILE_MAIN && | 41 if (output_profile != media::VP8PROFILE_ANY && |
| 42 output_profile != media::H264PROFILE_MAIN) { | 42 output_profile != media::H264PROFILE_MAIN) { |
| 43 return false; | 43 return false; |
| 44 } | 44 } |
| 45 task_runner_->PostTask( | 45 task_runner_->PostTask( |
| 46 FROM_HERE, | 46 FROM_HERE, |
| 47 base::Bind(&FakeVideoEncodeAccelerator::DoRequireBitstreamBuffers, | 47 base::Bind(&FakeVideoEncodeAccelerator::DoRequireBitstreamBuffers, |
| 48 weak_this_factory_.GetWeakPtr(), | 48 weak_this_factory_.GetWeakPtr(), |
| 49 kMinimumInputCount, | 49 kMinimumInputCount, |
| 50 input_visible_size, | 50 input_visible_size, |
| 51 kMinimumOutputBufferSize)); | 51 kMinimumOutputBufferSize)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void FakeVideoEncodeAccelerator::DoBitstreamBufferReady( | 104 void FakeVideoEncodeAccelerator::DoBitstreamBufferReady( |
| 105 int32 bitstream_buffer_id, | 105 int32 bitstream_buffer_id, |
| 106 size_t payload_size, | 106 size_t payload_size, |
| 107 bool key_frame) const { | 107 bool key_frame) const { |
| 108 client_->BitstreamBufferReady(bitstream_buffer_id, payload_size, key_frame); | 108 client_->BitstreamBufferReady(bitstream_buffer_id, payload_size, key_frame); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace test | 111 } // namespace test |
| 112 } // namespace cast | 112 } // namespace cast |
| 113 } // namespace media | 113 } // namespace media |
| OLD | NEW |