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/gpu/gpu_channel.h" | 10 #include "content/common/gpu/gpu_channel.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 if (!io_task_is_posted_) | 369 if (!io_task_is_posted_) |
370 DoIOTask(); | 370 DoIOTask(); |
371 } | 371 } |
372 | 372 |
373 void AndroidVideoDecodeAccelerator::Flush() { | 373 void AndroidVideoDecodeAccelerator::Flush() { |
374 DCHECK(thread_checker_.CalledOnValidThread()); | 374 DCHECK(thread_checker_.CalledOnValidThread()); |
375 | 375 |
376 Decode(media::BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); | 376 Decode(media::BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); |
377 } | 377 } |
378 | 378 |
379 void AndroidVideoDecodeAccelerator::ConfigureMediaCodec() { | 379 void AndroidVideoDecodeAccelerator::ConfigureMediaCodec() { |
dwkang1
2013/05/16 01:53:54
Could you make this return bool and make Initializ
qinmin
2013/05/16 04:07:43
Done.
| |
380 DCHECK(surface_texture_.get()); | 380 DCHECK(surface_texture_.get()); |
381 | 381 |
382 media_codec_.reset(new media::VideoCodecBridge(codec_)); | 382 media_codec_.reset(media::VideoCodecBridge::Create(codec_)); |
383 | 383 |
384 gfx::ScopedJavaSurface surface(surface_texture_.get()); | 384 gfx::ScopedJavaSurface surface(surface_texture_.get()); |
385 // VDA does not pass the container indicated resolution in the initialization | 385 // VDA does not pass the container indicated resolution in the initialization |
386 // phase. Here, we set 720p by default. | 386 // phase. Here, we set 720p by default. |
387 // TODO(dwkang): find out a way to remove the following hard-coded value. | 387 // TODO(dwkang): find out a way to remove the following hard-coded value. |
388 media_codec_->Start( | 388 media_codec_->Start( |
389 codec_, gfx::Size(1280, 720), surface.j_surface().obj()); | 389 codec_, gfx::Size(1280, 720), surface.j_surface().obj()); |
390 media_codec_->GetOutputBuffers(); | 390 media_codec_->GetOutputBuffers(); |
391 } | 391 } |
392 | 392 |
(...skipping 66 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 |