| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 codec_config_ = new CodecConfig(); | 281 codec_config_ = new CodecConfig(); |
| 282 codec_config_->codec = VideoCodecProfileToVideoCodec(config.profile); | 282 codec_config_->codec = VideoCodecProfileToVideoCodec(config.profile); |
| 283 codec_config_->initial_expected_coded_size = | 283 codec_config_->initial_expected_coded_size = |
| 284 config.initial_expected_coded_size; | 284 config.initial_expected_coded_size; |
| 285 | 285 |
| 286 if (codec_config_->codec != kCodecVP8 && codec_config_->codec != kCodecVP9 && | 286 if (codec_config_->codec != kCodecVP8 && codec_config_->codec != kCodecVP9 && |
| 287 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 287 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 288 codec_config_->codec != kCodecHEVC && | 288 codec_config_->codec != kCodecHEVC && |
| 289 #endif | 289 #endif |
| 290 codec_config_->codec != kCodecH264) { | 290 codec_config_->codec != kCodecH264) { |
| 291 DLOG(ERROR) << "Unsupported profile: " << config.profile; | 291 DLOG(ERROR) << "Unsupported profile: " << GetProfileName(config.profile); |
| 292 return false; | 292 return false; |
| 293 } | 293 } |
| 294 | 294 |
| 295 if (codec_config_->codec == kCodecH264) { | 295 if (codec_config_->codec == kCodecH264) { |
| 296 codec_config_->csd0 = config.sps; | 296 codec_config_->csd0 = config.sps; |
| 297 codec_config_->csd1 = config.pps; | 297 codec_config_->csd1 = config.pps; |
| 298 } | 298 } |
| 299 | 299 |
| 300 // Only use MediaCodec for VP8/9 if it's likely backed by hardware | 300 // Only use MediaCodec for VP8/9 if it's likely backed by hardware |
| 301 // or if the stream is encrypted. | 301 // or if the stream is encrypted. |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); | 1494 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); |
| 1495 } | 1495 } |
| 1496 | 1496 |
| 1497 // Regardless of whether we succeeded, we no longer own the previous surface. | 1497 // Regardless of whether we succeeded, we no longer own the previous surface. |
| 1498 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); | 1498 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); |
| 1499 | 1499 |
| 1500 return success; | 1500 return success; |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 } // namespace media | 1503 } // namespace media |
| OLD | NEW |