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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // the texture. | 359 // the texture. |
360 copier_->DoCopyTexture(gl_decoder_.get(), GL_TEXTURE_EXTERNAL_OES, | 360 copier_->DoCopyTexture(gl_decoder_.get(), GL_TEXTURE_EXTERNAL_OES, |
361 GL_TEXTURE_2D, surface_texture_id_, | 361 GL_TEXTURE_2D, surface_texture_id_, |
362 picture_buffer_texture_id, 0, size_.width(), | 362 picture_buffer_texture_id, 0, size_.width(), |
363 size_.height(), false, false, false); | 363 size_.height(), false, false, false); |
364 | 364 |
365 base::MessageLoop::current()->PostTask( | 365 base::MessageLoop::current()->PostTask( |
366 FROM_HERE, | 366 FROM_HERE, |
367 base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, | 367 base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, |
368 weak_this_factory_.GetWeakPtr(), | 368 weak_this_factory_.GetWeakPtr(), |
369 media::Picture(picture_buffer_id, bitstream_id))); | 369 media::Picture(picture_buffer_id, bitstream_id, size_))); |
370 } | 370 } |
371 | 371 |
372 void AndroidVideoDecodeAccelerator::Decode( | 372 void AndroidVideoDecodeAccelerator::Decode( |
373 const media::BitstreamBuffer& bitstream_buffer) { | 373 const media::BitstreamBuffer& bitstream_buffer) { |
374 DCHECK(thread_checker_.CalledOnValidThread()); | 374 DCHECK(thread_checker_.CalledOnValidThread()); |
375 if (bitstream_buffer.id() != -1 && bitstream_buffer.size() == 0) { | 375 if (bitstream_buffer.id() != -1 && bitstream_buffer.size() == 0) { |
376 base::MessageLoop::current()->PostTask( | 376 base::MessageLoop::current()->PostTask( |
377 FROM_HERE, | 377 FROM_HERE, |
378 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, | 378 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, |
379 weak_this_factory_.GetWeakPtr(), | 379 weak_this_factory_.GetWeakPtr(), |
(...skipping 159 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 |