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 "content/common/gpu/gpu_channel.h" | 10 #include "content/common/gpu/gpu_channel.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 392 } |
393 | 393 |
394 void AndroidVideoDecodeAccelerator::Flush() { | 394 void AndroidVideoDecodeAccelerator::Flush() { |
395 DCHECK(thread_checker_.CalledOnValidThread()); | 395 DCHECK(thread_checker_.CalledOnValidThread()); |
396 | 396 |
397 Decode(media::BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); | 397 Decode(media::BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); |
398 } | 398 } |
399 | 399 |
400 bool AndroidVideoDecodeAccelerator::ConfigureMediaCodec() { | 400 bool AndroidVideoDecodeAccelerator::ConfigureMediaCodec() { |
401 DCHECK(surface_texture_.get()); | 401 DCHECK(surface_texture_.get()); |
402 media_codec_.reset(media::VideoCodecBridge::Create(codec_)); | 402 media_codec_.reset(media::VideoCodecBridge::Create(codec_, false)); |
403 | 403 |
404 if (!media_codec_) | 404 if (!media_codec_) |
405 return false; | 405 return false; |
406 | 406 |
407 gfx::ScopedJavaSurface surface(surface_texture_.get()); | 407 gfx::ScopedJavaSurface surface(surface_texture_.get()); |
408 // VDA does not pass the container indicated resolution in the initialization | 408 // VDA does not pass the container indicated resolution in the initialization |
409 // phase. Here, we set 720p by default. | 409 // phase. Here, we set 720p by default. |
410 // TODO(dwkang): find out a way to remove the following hard-coded value. | 410 // TODO(dwkang): find out a way to remove the following hard-coded value. |
411 media_codec_->Start( | 411 media_codec_->Start( |
412 codec_, gfx::Size(1280, 720), surface.j_surface().obj(), NULL); | 412 codec_, gfx::Size(1280, 720), surface.j_surface().obj(), NULL); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 483 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
484 client_->NotifyResetDone(); | 484 client_->NotifyResetDone(); |
485 } | 485 } |
486 | 486 |
487 void AndroidVideoDecodeAccelerator::NotifyError( | 487 void AndroidVideoDecodeAccelerator::NotifyError( |
488 media::VideoDecodeAccelerator::Error error) { | 488 media::VideoDecodeAccelerator::Error error) { |
489 client_->NotifyError(error); | 489 client_->NotifyError(error); |
490 } | 490 } |
491 | 491 |
492 } // namespace content | 492 } // namespace content |
OLD | NEW |