| 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 "content/common/gpu/media/vaapi_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/vaapi_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 memset(¤t_pic_, 0, sizeof(current_pic_)); | 284 memset(¤t_pic_, 0, sizeof(current_pic_)); |
| 285 | 285 |
| 286 current_pic_.frame_num = frame_num_++; | 286 current_pic_.frame_num = frame_num_++; |
| 287 frame_num_ %= idr_period_; | 287 frame_num_ %= idr_period_; |
| 288 | 288 |
| 289 if (current_pic_.frame_num % i_period_ == 0 || force_keyframe) | 289 if (current_pic_.frame_num % i_period_ == 0 || force_keyframe) |
| 290 current_pic_.type = media::H264SliceHeader::kISlice; | 290 current_pic_.type = media::H264SliceHeader::kISlice; |
| 291 else | 291 else |
| 292 current_pic_.type = media::H264SliceHeader::kPSlice; | 292 current_pic_.type = media::H264SliceHeader::kPSlice; |
| 293 | 293 |
| 294 if (current_pic_.frame_num % idr_period_ == 0) { | 294 if (current_pic_.frame_num % idr_period_ == 0 || force_keyframe) { |
| 295 current_pic_.idr = true; | 295 current_pic_.idr = true; |
| 296 last_idr_frame_num_ = current_pic_.frame_num; | 296 last_idr_frame_num_ = current_pic_.frame_num; |
| 297 ref_pic_list0_.clear(); | 297 ref_pic_list0_.clear(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (current_pic_.type != media::H264SliceHeader::kBSlice) | 300 if (current_pic_.type != media::H264SliceHeader::kBSlice) |
| 301 current_pic_.ref = true; | 301 current_pic_.ref = true; |
| 302 | 302 |
| 303 current_pic_.pic_order_cnt = current_pic_.frame_num * 2; | 303 current_pic_.pic_order_cnt = current_pic_.frame_num * 2; |
| 304 current_pic_.top_field_order_cnt = current_pic_.pic_order_cnt; | 304 current_pic_.top_field_order_cnt = current_pic_.pic_order_cnt; |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1061 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
| 1062 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1062 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1065 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 } // namespace content | 1068 } // namespace content |
| OLD | NEW |