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.h" | 9 #include "base/message_loop.h" |
10 #include "content/common/android/scoped_java_surface.h" | 10 #include "content/common/android/scoped_java_surface.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // TODO(dwkang): enable H264 once b/8125974 is fixed. | 78 // TODO(dwkang): enable H264 once b/8125974 is fixed. |
79 LOG(ERROR) << "Unsupported profile: " << profile; | 79 LOG(ERROR) << "Unsupported profile: " << profile; |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 if (!make_context_current_.Run()) { | 83 if (!make_context_current_.Run()) { |
84 LOG(ERROR) << "Failed to make this decoder's GL context current."; | 84 LOG(ERROR) << "Failed to make this decoder's GL context current."; |
85 return false; | 85 return false; |
86 } | 86 } |
87 | 87 |
88 if (!gl_decoder_.get()) { | 88 if (!gl_decoder_) { |
89 LOG(ERROR) << "Failed to get gles2 decoder instance."; | 89 LOG(ERROR) << "Failed to get gles2 decoder instance."; |
90 return false; | 90 return false; |
91 } | 91 } |
92 glGenTextures(1, &surface_texture_id_); | 92 glGenTextures(1, &surface_texture_id_); |
93 glActiveTexture(GL_TEXTURE0); | 93 glActiveTexture(GL_TEXTURE0); |
94 glBindTexture(GL_TEXTURE_EXTERNAL_OES, surface_texture_id_); | 94 glBindTexture(GL_TEXTURE_EXTERNAL_OES, surface_texture_id_); |
95 | 95 |
96 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 96 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
97 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 97 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
98 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, | 98 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 459 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
460 client_->NotifyResetDone(); | 460 client_->NotifyResetDone(); |
461 } | 461 } |
462 | 462 |
463 void AndroidVideoDecodeAccelerator::NotifyError( | 463 void AndroidVideoDecodeAccelerator::NotifyError( |
464 media::VideoDecodeAccelerator::Error error) { | 464 media::VideoDecodeAccelerator::Error error) { |
465 client_->NotifyError(error); | 465 client_->NotifyError(error); |
466 } | 466 } |
467 | 467 |
468 } // namespace content | 468 } // namespace content |
OLD | NEW |