Chromium Code Reviews| 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 "content/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 DCHECK(thread_checker_.CalledOnValidThread()); | 82 DCHECK(thread_checker_.CalledOnValidThread()); |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool AndroidVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, | 85 bool AndroidVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, |
| 86 Client* client) { | 86 Client* client) { |
| 87 DCHECK(!media_codec_); | 87 DCHECK(!media_codec_); |
| 88 DCHECK(thread_checker_.CalledOnValidThread()); | 88 DCHECK(thread_checker_.CalledOnValidThread()); |
| 89 | 89 |
| 90 client_ = client; | 90 client_ = client; |
| 91 | 91 |
| 92 if (profile == media::VP8PROFILE_MAIN) { | 92 if (profile == media::VP8PROFILE_UNSPECIFIED) { |
|
xhwang
2014/07/31 17:12:44
I think here you mean for "vp8", "profile" is "uns
amogh.bihani
2014/08/01 05:16:24
Na has a wiki page! :o
| |
| 93 codec_ = media::kCodecVP8; | 93 codec_ = media::kCodecVP8; |
| 94 } else { | 94 } else { |
| 95 // TODO(dwkang): enable H264 once b/8125974 is fixed. | 95 // TODO(dwkang): enable H264 once b/8125974 is fixed. |
| 96 LOG(ERROR) << "Unsupported profile: " << profile; | 96 LOG(ERROR) << "Unsupported profile: " << profile; |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Only consider using MediaCodec if it's likely backed by hardware. | 100 // Only consider using MediaCodec if it's likely backed by hardware. |
| 101 if (media::VideoCodecBridge::IsKnownUnaccelerated( | 101 if (media::VideoCodecBridge::IsKnownUnaccelerated( |
| 102 codec_, media::MEDIA_CODEC_DECODER)) { | 102 codec_, media::MEDIA_CODEC_DECODER)) { |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 539 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 539 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
| 540 client_->NotifyResetDone(); | 540 client_->NotifyResetDone(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 void AndroidVideoDecodeAccelerator::NotifyError( | 543 void AndroidVideoDecodeAccelerator::NotifyError( |
| 544 media::VideoDecodeAccelerator::Error error) { | 544 media::VideoDecodeAccelerator::Error error) { |
| 545 client_->NotifyError(error); | 545 client_->NotifyError(error); |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace content | 548 } // namespace content |
| OLD | NEW |