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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 picture_buffer_texture_id, | 366 picture_buffer_texture_id, |
367 0, | 367 0, |
368 size_.width(), | 368 size_.width(), |
369 size_.height(), | 369 size_.height(), |
370 false, | 370 false, |
371 false, | 371 false, |
372 false, | 372 false, |
373 default_matrix); | 373 default_matrix); |
374 | 374 |
375 base::MessageLoop::current()->PostTask( | 375 base::MessageLoop::current()->PostTask( |
376 FROM_HERE, | 376 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, |
377 base::Bind( | 377 weak_this_factory_.GetWeakPtr(), |
378 &AndroidVideoDecodeAccelerator::NotifyPictureReady, | 378 media::Picture(picture_buffer_id, bitstream_id, |
379 weak_this_factory_.GetWeakPtr(), | 379 gfx::Rect(size_), false))); |
380 media::Picture(picture_buffer_id, bitstream_id, gfx::Rect(size_)))); | |
381 } | 380 } |
382 | 381 |
383 void AndroidVideoDecodeAccelerator::Decode( | 382 void AndroidVideoDecodeAccelerator::Decode( |
384 const media::BitstreamBuffer& bitstream_buffer) { | 383 const media::BitstreamBuffer& bitstream_buffer) { |
385 DCHECK(thread_checker_.CalledOnValidThread()); | 384 DCHECK(thread_checker_.CalledOnValidThread()); |
386 if (bitstream_buffer.id() != -1 && bitstream_buffer.size() == 0) { | 385 if (bitstream_buffer.id() != -1 && bitstream_buffer.size() == 0) { |
387 base::MessageLoop::current()->PostTask( | 386 base::MessageLoop::current()->PostTask( |
388 FROM_HERE, | 387 FROM_HERE, |
389 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, | 388 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, |
390 weak_this_factory_.GetWeakPtr(), | 389 weak_this_factory_.GetWeakPtr(), |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 549 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
551 client_->NotifyResetDone(); | 550 client_->NotifyResetDone(); |
552 } | 551 } |
553 | 552 |
554 void AndroidVideoDecodeAccelerator::NotifyError( | 553 void AndroidVideoDecodeAccelerator::NotifyError( |
555 media::VideoDecodeAccelerator::Error error) { | 554 media::VideoDecodeAccelerator::Error error) { |
556 client_->NotifyError(error); | 555 client_->NotifyError(error); |
557 } | 556 } |
558 | 557 |
559 } // namespace content | 558 } // namespace content |
OLD | NEW |