Chromium Code Reviews| 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/gpu/vaapi_video_encode_accelerator.h" | 5 #include "media/gpu/vaapi_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 target_data, buffer->shm->size(), &data_size)) { | 548 target_data, buffer->shm->size(), &data_size)) { |
| 549 NOTIFY_ERROR(kPlatformFailureError, "Failed downloading coded buffer"); | 549 NOTIFY_ERROR(kPlatformFailureError, "Failed downloading coded buffer"); |
| 550 return; | 550 return; |
| 551 } | 551 } |
| 552 | 552 |
| 553 DVLOGF(3) << "Returning bitstream buffer " | 553 DVLOGF(3) << "Returning bitstream buffer " |
| 554 << (encode_job->keyframe ? "(keyframe)" : "") | 554 << (encode_job->keyframe ? "(keyframe)" : "") |
| 555 << " id: " << buffer->id << " size: " << data_size; | 555 << " id: " << buffer->id << " size: " << data_size; |
| 556 | 556 |
| 557 child_task_runner_->PostTask( | 557 child_task_runner_->PostTask( |
| 558 FROM_HERE, base::Bind(&Client::BitstreamBufferReady, client_, buffer->id, | 558 FROM_HERE, |
| 559 data_size, encode_job->keyframe)); | 559 base::Bind(&Client::BitstreamBufferReady, client_, buffer->id, data_size, |
| 560 encode_job->keyframe, base::TimeDelta())); | |
|
Pawel Osciak
2016/05/23 07:15:53
Could you implement this by adding timestamp to En
shenghao
2016/05/24 10:50:19
Done.
| |
| 560 } | 561 } |
| 561 | 562 |
| 562 void VaapiVideoEncodeAccelerator::Encode( | 563 void VaapiVideoEncodeAccelerator::Encode( |
| 563 const scoped_refptr<media::VideoFrame>& frame, | 564 const scoped_refptr<media::VideoFrame>& frame, |
| 564 bool force_keyframe) { | 565 bool force_keyframe) { |
| 565 DVLOGF(3) << "Frame timestamp: " << frame->timestamp().InMilliseconds() | 566 DVLOGF(3) << "Frame timestamp: " << frame->timestamp().InMilliseconds() |
| 566 << " force_keyframe: " << force_keyframe; | 567 << " force_keyframe: " << force_keyframe; |
| 567 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 568 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 568 | 569 |
| 569 encoder_thread_task_runner_->PostTask( | 570 encoder_thread_task_runner_->PostTask( |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1052 client_ptr_factory_.reset(); | 1053 client_ptr_factory_.reset(); |
| 1053 } | 1054 } |
| 1054 } | 1055 } |
| 1055 | 1056 |
| 1056 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1057 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
| 1057 : coded_buffer(VA_INVALID_ID), keyframe(false) {} | 1058 : coded_buffer(VA_INVALID_ID), keyframe(false) {} |
| 1058 | 1059 |
| 1059 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() {} | 1060 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() {} |
| 1060 | 1061 |
| 1061 } // namespace media | 1062 } // namespace media |
| OLD | NEW |