| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/gpu/android_video_encode_accelerator.h" | 5 #include "media/gpu/android_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 << ", output_profile: " << GetProfileName(output_profile) | 149 << ", output_profile: " << GetProfileName(output_profile) |
| 150 << ", initial_bitrate: " << initial_bitrate; | 150 << ", initial_bitrate: " << initial_bitrate; |
| 151 DCHECK(!media_codec_); | 151 DCHECK(!media_codec_); |
| 152 DCHECK(thread_checker_.CalledOnValidThread()); | 152 DCHECK(thread_checker_.CalledOnValidThread()); |
| 153 DCHECK(client); | 153 DCHECK(client); |
| 154 | 154 |
| 155 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); | 155 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); |
| 156 | 156 |
| 157 if (!(MediaCodecUtil::SupportsSetParameters() && | 157 if (!(MediaCodecUtil::SupportsSetParameters() && |
| 158 format == PIXEL_FORMAT_I420)) { | 158 format == PIXEL_FORMAT_I420)) { |
| 159 DLOG(ERROR) << "Unexpected combo: " << format << ", " << output_profile; | 159 DLOG(ERROR) << "Unexpected combo: " << format << ", " |
| 160 << GetProfileName(output_profile); |
| 160 return false; | 161 return false; |
| 161 } | 162 } |
| 162 | 163 |
| 163 std::string mime_type; | 164 std::string mime_type; |
| 164 VideoCodec codec; | 165 VideoCodec codec; |
| 165 // The client should be prepared to feed at least this many frames into the | 166 // The client should be prepared to feed at least this many frames into the |
| 166 // encoder before being returned any output frames, since the encoder may | 167 // encoder before being returned any output frames, since the encoder may |
| 167 // need to hold onto some subset of inputs as reference pictures. | 168 // need to hold onto some subset of inputs as reference pictures. |
| 168 uint32_t frame_input_count; | 169 uint32_t frame_input_count; |
| 169 uint32_t i_frame_interval; | 170 uint32_t i_frame_interval; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 --num_buffers_at_codec_; | 424 --num_buffers_at_codec_; |
| 424 | 425 |
| 425 base::ThreadTaskRunnerHandle::Get()->PostTask( | 426 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 426 FROM_HERE, | 427 FROM_HERE, |
| 427 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady, | 428 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady, |
| 428 client_ptr_factory_->GetWeakPtr(), bitstream_buffer.id(), size, | 429 client_ptr_factory_->GetWeakPtr(), bitstream_buffer.id(), size, |
| 429 key_frame, base::Time::Now() - base::Time())); | 430 key_frame, base::Time::Now() - base::Time())); |
| 430 } | 431 } |
| 431 | 432 |
| 432 } // namespace media | 433 } // namespace media |
| OLD | NEW |