| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 119 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 120 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 120 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
| 121 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, | 121 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, |
| 122 GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 122 GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 123 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, | 123 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, |
| 124 GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 124 GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 125 gl_decoder_->RestoreTextureUnitBindings(0); | 125 gl_decoder_->RestoreTextureUnitBindings(0); |
| 126 gl_decoder_->RestoreActiveTexture(); | 126 gl_decoder_->RestoreActiveTexture(); |
| 127 | 127 |
| 128 surface_texture_ = new gfx::SurfaceTexture(surface_texture_id_); | 128 surface_texture_ = new gfx::SurfaceTexture(surface_texture_id_, false); |
| 129 | 129 |
| 130 if (!ConfigureMediaCodec()) { | 130 if (!ConfigureMediaCodec()) { |
| 131 LOG(ERROR) << "Failed to create MediaCodec instance."; | 131 LOG(ERROR) << "Failed to create MediaCodec instance."; |
| 132 return false; | 132 return false; |
| 133 } | 133 } |
| 134 | 134 |
| 135 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 135 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |
| 136 &AndroidVideoDecodeAccelerator::NotifyInitializeDone, | 136 &AndroidVideoDecodeAccelerator::NotifyInitializeDone, |
| 137 base::AsWeakPtr(this))); | 137 base::AsWeakPtr(this))); |
| 138 return true; | 138 return true; |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 525 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
| 526 client_->NotifyResetDone(); | 526 client_->NotifyResetDone(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 void AndroidVideoDecodeAccelerator::NotifyError( | 529 void AndroidVideoDecodeAccelerator::NotifyError( |
| 530 media::VideoDecodeAccelerator::Error error) { | 530 media::VideoDecodeAccelerator::Error error) { |
| 531 client_->NotifyError(error); | 531 client_->NotifyError(error); |
| 532 } | 532 } |
| 533 | 533 |
| 534 } // namespace content | 534 } // namespace content |
| OLD | NEW |