Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 191933002: This is initial API support required for enabling SurfaceTexture backed zero-copy for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build issues Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/android_video_decode_accelerator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_ = gfx::SurfaceTexture::Create(surface_texture_id_);
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
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
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/android_video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698