OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/vaapi_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/vaapi_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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 }; | 199 }; |
200 | 200 |
201 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { | 201 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { |
202 } | 202 } |
203 | 203 |
204 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { | 204 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { |
205 } | 205 } |
206 | 206 |
207 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { | 207 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { |
208 if (message_loop_ != base::MessageLoop::current()) { | 208 if (message_loop_ != base::MessageLoop::current()) { |
209 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 209 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
210 message_loop_->PostTask(FROM_HERE, base::Bind( | 210 message_loop_->PostTask(FROM_HERE, base::Bind( |
211 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); | 211 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); |
212 return; | 212 return; |
213 } | 213 } |
214 | 214 |
215 // Post Cleanup() as a task so we don't recursively acquire lock_. | 215 // Post Cleanup() as a task so we don't recursively acquire lock_. |
216 message_loop_->PostTask(FROM_HERE, base::Bind( | 216 message_loop_->PostTask(FROM_HERE, base::Bind( |
217 &VaapiVideoDecodeAccelerator::Cleanup, weak_this_)); | 217 &VaapiVideoDecodeAccelerator::Cleanup, weak_this_)); |
218 | 218 |
219 LOG(ERROR) << "Notifying of error " << error; | 219 LOG(ERROR) << "Notifying of error " << error; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } else if (profile >= media::VP8PROFILE_MIN && | 300 } else if (profile >= media::VP8PROFILE_MIN && |
301 profile <= media::VP8PROFILE_MAX) { | 301 profile <= media::VP8PROFILE_MAX) { |
302 vp8_accelerator_.reset(new VaapiVP8Accelerator(this, vaapi_wrapper_.get())); | 302 vp8_accelerator_.reset(new VaapiVP8Accelerator(this, vaapi_wrapper_.get())); |
303 decoder_.reset(new VP8Decoder(vp8_accelerator_.get())); | 303 decoder_.reset(new VP8Decoder(vp8_accelerator_.get())); |
304 } else { | 304 } else { |
305 DLOG(ERROR) << "Unsupported profile " << profile; | 305 DLOG(ERROR) << "Unsupported profile " << profile; |
306 return false; | 306 return false; |
307 } | 307 } |
308 | 308 |
309 CHECK(decoder_thread_.Start()); | 309 CHECK(decoder_thread_.Start()); |
310 decoder_thread_task_runner_ = decoder_thread_.task_runner(); | 310 decoder_thread_proxy_ = decoder_thread_.message_loop_proxy(); |
311 | 311 |
312 state_ = kIdle; | 312 state_ = kIdle; |
313 return true; | 313 return true; |
314 } | 314 } |
315 | 315 |
316 void VaapiVideoDecodeAccelerator::OutputPicture( | 316 void VaapiVideoDecodeAccelerator::OutputPicture( |
317 const scoped_refptr<VASurface>& va_surface, | 317 const scoped_refptr<VASurface>& va_surface, |
318 int32 input_id, | 318 int32 input_id, |
319 VaapiPicture* picture) { | 319 VaapiPicture* picture) { |
320 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 320 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 ++num_stream_bufs_at_decoder_; | 393 ++num_stream_bufs_at_decoder_; |
394 TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", | 394 TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", |
395 num_stream_bufs_at_decoder_); | 395 num_stream_bufs_at_decoder_); |
396 | 396 |
397 input_buffers_.push(input_buffer); | 397 input_buffers_.push(input_buffer); |
398 input_ready_.Signal(); | 398 input_ready_.Signal(); |
399 } | 399 } |
400 | 400 |
401 bool VaapiVideoDecodeAccelerator::GetInputBuffer_Locked() { | 401 bool VaapiVideoDecodeAccelerator::GetInputBuffer_Locked() { |
402 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 402 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
403 lock_.AssertAcquired(); | 403 lock_.AssertAcquired(); |
404 | 404 |
405 if (curr_input_buffer_.get()) | 405 if (curr_input_buffer_.get()) |
406 return true; | 406 return true; |
407 | 407 |
408 // Will only wait if it is expected that in current state new buffers will | 408 // Will only wait if it is expected that in current state new buffers will |
409 // be queued from the client via Decode(). The state can change during wait. | 409 // be queued from the client via Decode(). The state can change during wait. |
410 while (input_buffers_.empty() && (state_ == kDecoding || state_ == kIdle)) { | 410 while (input_buffers_.empty() && (state_ == kDecoding || state_ == kIdle)) { |
411 input_ready_.Wait(); | 411 input_ready_.Wait(); |
412 } | 412 } |
(...skipping 25 matching lines...) Expand all Loading... |
438 | 438 |
439 default: | 439 default: |
440 // We got woken up due to being destroyed/reset, ignore any already | 440 // We got woken up due to being destroyed/reset, ignore any already |
441 // queued inputs. | 441 // queued inputs. |
442 return false; | 442 return false; |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 void VaapiVideoDecodeAccelerator::ReturnCurrInputBuffer_Locked() { | 446 void VaapiVideoDecodeAccelerator::ReturnCurrInputBuffer_Locked() { |
447 lock_.AssertAcquired(); | 447 lock_.AssertAcquired(); |
448 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 448 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
449 DCHECK(curr_input_buffer_.get()); | 449 DCHECK(curr_input_buffer_.get()); |
450 | 450 |
451 int32 id = curr_input_buffer_->id; | 451 int32 id = curr_input_buffer_->id; |
452 curr_input_buffer_.reset(); | 452 curr_input_buffer_.reset(); |
453 DVLOG(4) << "End of input buffer " << id; | 453 DVLOG(4) << "End of input buffer " << id; |
454 message_loop_->PostTask(FROM_HERE, base::Bind( | 454 message_loop_->PostTask(FROM_HERE, base::Bind( |
455 &Client::NotifyEndOfBitstreamBuffer, client_, id)); | 455 &Client::NotifyEndOfBitstreamBuffer, client_, id)); |
456 | 456 |
457 --num_stream_bufs_at_decoder_; | 457 --num_stream_bufs_at_decoder_; |
458 TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", | 458 TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", |
459 num_stream_bufs_at_decoder_); | 459 num_stream_bufs_at_decoder_); |
460 } | 460 } |
461 | 461 |
462 // TODO(posciak): refactor the whole class to remove sleeping in wait for | 462 // TODO(posciak): refactor the whole class to remove sleeping in wait for |
463 // surfaces, and reschedule DecodeTask instead. | 463 // surfaces, and reschedule DecodeTask instead. |
464 bool VaapiVideoDecodeAccelerator::WaitForSurfaces_Locked() { | 464 bool VaapiVideoDecodeAccelerator::WaitForSurfaces_Locked() { |
465 lock_.AssertAcquired(); | 465 lock_.AssertAcquired(); |
466 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 466 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
467 | 467 |
468 while (available_va_surfaces_.empty() && | 468 while (available_va_surfaces_.empty() && |
469 (state_ == kDecoding || state_ == kFlushing || state_ == kIdle)) { | 469 (state_ == kDecoding || state_ == kFlushing || state_ == kIdle)) { |
470 surfaces_available_.Wait(); | 470 surfaces_available_.Wait(); |
471 } | 471 } |
472 | 472 |
473 if (state_ != kDecoding && state_ != kFlushing && state_ != kIdle) | 473 if (state_ != kDecoding && state_ != kFlushing && state_ != kIdle) |
474 return false; | 474 return false; |
475 | 475 |
476 return true; | 476 return true; |
477 } | 477 } |
478 | 478 |
479 void VaapiVideoDecodeAccelerator::DecodeTask() { | 479 void VaapiVideoDecodeAccelerator::DecodeTask() { |
480 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 480 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
481 TRACE_EVENT0("Video Decoder", "VAVDA::DecodeTask"); | 481 TRACE_EVENT0("Video Decoder", "VAVDA::DecodeTask"); |
482 base::AutoLock auto_lock(lock_); | 482 base::AutoLock auto_lock(lock_); |
483 | 483 |
484 if (state_ != kDecoding) | 484 if (state_ != kDecoding) |
485 return; | 485 return; |
486 | 486 |
487 // Main decode task. | 487 // Main decode task. |
488 DVLOG(4) << "Decode task"; | 488 DVLOG(4) << "Decode task"; |
489 | 489 |
490 // Try to decode what stream data is (still) in the decoder until we run out | 490 // Try to decode what stream data is (still) in the decoder until we run out |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 TRACE_EVENT1("Video Decoder", "VAVDA::Decode", "Buffer id", | 603 TRACE_EVENT1("Video Decoder", "VAVDA::Decode", "Buffer id", |
604 bitstream_buffer.id()); | 604 bitstream_buffer.id()); |
605 | 605 |
606 // We got a new input buffer from the client, map it and queue for later use. | 606 // We got a new input buffer from the client, map it and queue for later use. |
607 MapAndQueueNewInputBuffer(bitstream_buffer); | 607 MapAndQueueNewInputBuffer(bitstream_buffer); |
608 | 608 |
609 base::AutoLock auto_lock(lock_); | 609 base::AutoLock auto_lock(lock_); |
610 switch (state_) { | 610 switch (state_) { |
611 case kIdle: | 611 case kIdle: |
612 state_ = kDecoding; | 612 state_ = kDecoding; |
613 decoder_thread_task_runner_->PostTask( | 613 decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( |
614 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, | 614 &VaapiVideoDecodeAccelerator::DecodeTask, |
615 base::Unretained(this))); | 615 base::Unretained(this))); |
616 break; | 616 break; |
617 | 617 |
618 case kDecoding: | 618 case kDecoding: |
619 // Decoder already running, fallthrough. | 619 // Decoder already running, fallthrough. |
620 case kResetting: | 620 case kResetting: |
621 // When resetting, allow accumulating bitstream buffers, so that | 621 // When resetting, allow accumulating bitstream buffers, so that |
622 // the client can queue after-seek-buffers while we are finishing with | 622 // the client can queue after-seek-buffers while we are finishing with |
623 // the before-seek one. | 623 // the before-seek one. |
624 break; | 624 break; |
625 | 625 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 bool inserted = | 686 bool inserted = |
687 pictures_.insert(std::make_pair(buffers[i].id(), picture)).second; | 687 pictures_.insert(std::make_pair(buffers[i].id(), picture)).second; |
688 DCHECK(inserted); | 688 DCHECK(inserted); |
689 | 689 |
690 output_buffers_.push(buffers[i].id()); | 690 output_buffers_.push(buffers[i].id()); |
691 available_va_surfaces_.push_back(va_surface_ids[i]); | 691 available_va_surfaces_.push_back(va_surface_ids[i]); |
692 surfaces_available_.Signal(); | 692 surfaces_available_.Signal(); |
693 } | 693 } |
694 | 694 |
695 state_ = kDecoding; | 695 state_ = kDecoding; |
696 decoder_thread_task_runner_->PostTask( | 696 decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( |
697 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, | 697 &VaapiVideoDecodeAccelerator::DecodeTask, base::Unretained(this))); |
698 base::Unretained(this))); | |
699 } | 698 } |
700 | 699 |
701 void VaapiVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { | 700 void VaapiVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { |
702 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 701 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
703 TRACE_EVENT1("Video Decoder", "VAVDA::ReusePictureBuffer", "Picture id", | 702 TRACE_EVENT1("Video Decoder", "VAVDA::ReusePictureBuffer", "Picture id", |
704 picture_buffer_id); | 703 picture_buffer_id); |
705 | 704 |
706 --num_frames_at_client_; | 705 --num_frames_at_client_; |
707 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); | 706 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); |
708 | 707 |
709 output_buffers_.push(picture_buffer_id); | 708 output_buffers_.push(picture_buffer_id); |
710 TryOutputSurface(); | 709 TryOutputSurface(); |
711 } | 710 } |
712 | 711 |
713 void VaapiVideoDecodeAccelerator::FlushTask() { | 712 void VaapiVideoDecodeAccelerator::FlushTask() { |
714 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 713 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
715 DVLOG(1) << "Flush task"; | 714 DVLOG(1) << "Flush task"; |
716 | 715 |
717 // First flush all the pictures that haven't been outputted, notifying the | 716 // First flush all the pictures that haven't been outputted, notifying the |
718 // client to output them. | 717 // client to output them. |
719 bool res = decoder_->Flush(); | 718 bool res = decoder_->Flush(); |
720 RETURN_AND_NOTIFY_ON_FAILURE(res, "Failed flushing the decoder.", | 719 RETURN_AND_NOTIFY_ON_FAILURE(res, "Failed flushing the decoder.", |
721 PLATFORM_FAILURE, ); | 720 PLATFORM_FAILURE, ); |
722 | 721 |
723 // Put the decoder in idle state, ready to resume. | 722 // Put the decoder in idle state, ready to resume. |
724 decoder_->Reset(); | 723 decoder_->Reset(); |
725 | 724 |
726 message_loop_->PostTask(FROM_HERE, base::Bind( | 725 message_loop_->PostTask(FROM_HERE, base::Bind( |
727 &VaapiVideoDecodeAccelerator::FinishFlush, weak_this_)); | 726 &VaapiVideoDecodeAccelerator::FinishFlush, weak_this_)); |
728 } | 727 } |
729 | 728 |
730 void VaapiVideoDecodeAccelerator::Flush() { | 729 void VaapiVideoDecodeAccelerator::Flush() { |
731 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 730 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
732 DVLOG(1) << "Got flush request"; | 731 DVLOG(1) << "Got flush request"; |
733 | 732 |
734 base::AutoLock auto_lock(lock_); | 733 base::AutoLock auto_lock(lock_); |
735 state_ = kFlushing; | 734 state_ = kFlushing; |
736 // Queue a flush task after all existing decoding tasks to clean up. | 735 // Queue a flush task after all existing decoding tasks to clean up. |
737 decoder_thread_task_runner_->PostTask( | 736 decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( |
738 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::FlushTask, | 737 &VaapiVideoDecodeAccelerator::FlushTask, base::Unretained(this))); |
739 base::Unretained(this))); | |
740 | 738 |
741 input_ready_.Signal(); | 739 input_ready_.Signal(); |
742 surfaces_available_.Signal(); | 740 surfaces_available_.Signal(); |
743 } | 741 } |
744 | 742 |
745 void VaapiVideoDecodeAccelerator::FinishFlush() { | 743 void VaapiVideoDecodeAccelerator::FinishFlush() { |
746 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 744 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
747 | 745 |
748 finish_flush_pending_ = false; | 746 finish_flush_pending_ = false; |
749 | 747 |
(...skipping 12 matching lines...) Expand all Loading... |
762 | 760 |
763 state_ = kIdle; | 761 state_ = kIdle; |
764 | 762 |
765 message_loop_->PostTask(FROM_HERE, base::Bind( | 763 message_loop_->PostTask(FROM_HERE, base::Bind( |
766 &Client::NotifyFlushDone, client_)); | 764 &Client::NotifyFlushDone, client_)); |
767 | 765 |
768 DVLOG(1) << "Flush finished"; | 766 DVLOG(1) << "Flush finished"; |
769 } | 767 } |
770 | 768 |
771 void VaapiVideoDecodeAccelerator::ResetTask() { | 769 void VaapiVideoDecodeAccelerator::ResetTask() { |
772 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 770 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
773 DVLOG(1) << "ResetTask"; | 771 DVLOG(1) << "ResetTask"; |
774 | 772 |
775 // All the decoding tasks from before the reset request from client are done | 773 // All the decoding tasks from before the reset request from client are done |
776 // by now, as this task was scheduled after them and client is expected not | 774 // by now, as this task was scheduled after them and client is expected not |
777 // to call Decode() after Reset() and before NotifyResetDone. | 775 // to call Decode() after Reset() and before NotifyResetDone. |
778 decoder_->Reset(); | 776 decoder_->Reset(); |
779 | 777 |
780 base::AutoLock auto_lock(lock_); | 778 base::AutoLock auto_lock(lock_); |
781 | 779 |
782 // Return current input buffer, if present. | 780 // Return current input buffer, if present. |
(...skipping 15 matching lines...) Expand all Loading... |
798 finish_flush_pending_ = false; | 796 finish_flush_pending_ = false; |
799 | 797 |
800 // Drop all remaining input buffers, if present. | 798 // Drop all remaining input buffers, if present. |
801 while (!input_buffers_.empty()) { | 799 while (!input_buffers_.empty()) { |
802 message_loop_->PostTask(FROM_HERE, base::Bind( | 800 message_loop_->PostTask(FROM_HERE, base::Bind( |
803 &Client::NotifyEndOfBitstreamBuffer, client_, | 801 &Client::NotifyEndOfBitstreamBuffer, client_, |
804 input_buffers_.front()->id)); | 802 input_buffers_.front()->id)); |
805 input_buffers_.pop(); | 803 input_buffers_.pop(); |
806 } | 804 } |
807 | 805 |
808 decoder_thread_task_runner_->PostTask( | 806 decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( |
809 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::ResetTask, | 807 &VaapiVideoDecodeAccelerator::ResetTask, base::Unretained(this))); |
810 base::Unretained(this))); | |
811 | 808 |
812 input_ready_.Signal(); | 809 input_ready_.Signal(); |
813 surfaces_available_.Signal(); | 810 surfaces_available_.Signal(); |
814 } | 811 } |
815 | 812 |
816 void VaapiVideoDecodeAccelerator::FinishReset() { | 813 void VaapiVideoDecodeAccelerator::FinishReset() { |
817 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 814 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
818 DVLOG(1) << "FinishReset"; | 815 DVLOG(1) << "FinishReset"; |
819 base::AutoLock auto_lock(lock_); | 816 base::AutoLock auto_lock(lock_); |
820 | 817 |
(...skipping 22 matching lines...) Expand all Loading... |
843 &Client::NotifyResetDone, client_)); | 840 &Client::NotifyResetDone, client_)); |
844 | 841 |
845 // The client might have given us new buffers via Decode() while we were | 842 // The client might have given us new buffers via Decode() while we were |
846 // resetting and might be waiting for our move, and not call Decode() anymore | 843 // resetting and might be waiting for our move, and not call Decode() anymore |
847 // until we return something. Post a DecodeTask() so that we won't | 844 // until we return something. Post a DecodeTask() so that we won't |
848 // sleep forever waiting for Decode() in that case. Having two of them | 845 // sleep forever waiting for Decode() in that case. Having two of them |
849 // in the pipe is harmless, the additional one will return as soon as it sees | 846 // in the pipe is harmless, the additional one will return as soon as it sees |
850 // that we are back in kDecoding state. | 847 // that we are back in kDecoding state. |
851 if (!input_buffers_.empty()) { | 848 if (!input_buffers_.empty()) { |
852 state_ = kDecoding; | 849 state_ = kDecoding; |
853 decoder_thread_task_runner_->PostTask( | 850 decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( |
854 FROM_HERE, base::Bind(&VaapiVideoDecodeAccelerator::DecodeTask, | 851 &VaapiVideoDecodeAccelerator::DecodeTask, |
855 base::Unretained(this))); | 852 base::Unretained(this))); |
856 } | 853 } |
857 | 854 |
858 DVLOG(1) << "Reset finished"; | 855 DVLOG(1) << "Reset finished"; |
859 } | 856 } |
860 | 857 |
861 void VaapiVideoDecodeAccelerator::Cleanup() { | 858 void VaapiVideoDecodeAccelerator::Cleanup() { |
862 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 859 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
863 | 860 |
864 base::AutoLock auto_lock(lock_); | 861 base::AutoLock auto_lock(lock_); |
865 if (state_ == kUninitialized || state_ == kDestroying) | 862 if (state_ == kUninitialized || state_ == kDestroying) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 | 922 |
926 pending_output_cbs_.push( | 923 pending_output_cbs_.push( |
927 base::Bind(&VaapiVideoDecodeAccelerator::OutputPicture, weak_this_, | 924 base::Bind(&VaapiVideoDecodeAccelerator::OutputPicture, weak_this_, |
928 dec_surface->va_surface(), dec_surface->bitstream_id())); | 925 dec_surface->va_surface(), dec_surface->bitstream_id())); |
929 | 926 |
930 TryOutputSurface(); | 927 TryOutputSurface(); |
931 } | 928 } |
932 | 929 |
933 scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> | 930 scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> |
934 VaapiVideoDecodeAccelerator::CreateSurface() { | 931 VaapiVideoDecodeAccelerator::CreateSurface() { |
935 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 932 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
936 base::AutoLock auto_lock(lock_); | 933 base::AutoLock auto_lock(lock_); |
937 | 934 |
938 if (available_va_surfaces_.empty()) | 935 if (available_va_surfaces_.empty()) |
939 return nullptr; | 936 return nullptr; |
940 | 937 |
941 DCHECK(!awaiting_va_surfaces_recycle_); | 938 DCHECK(!awaiting_va_surfaces_recycle_); |
942 scoped_refptr<VASurface> va_surface( | 939 scoped_refptr<VASurface> va_surface( |
943 new VASurface(available_va_surfaces_.front(), requested_pic_size_, | 940 new VASurface(available_va_surfaces_.front(), requested_pic_size_, |
944 va_surface_release_cb_)); | 941 va_surface_release_cb_)); |
945 available_va_surfaces_.pop_front(); | 942 available_va_surfaces_.pop_front(); |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 return vaapi_pic->dec_surface(); | 1509 return vaapi_pic->dec_surface(); |
1513 } | 1510 } |
1514 | 1511 |
1515 // static | 1512 // static |
1516 media::VideoDecodeAccelerator::SupportedProfiles | 1513 media::VideoDecodeAccelerator::SupportedProfiles |
1517 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { | 1514 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { |
1518 return VaapiWrapper::GetSupportedDecodeProfiles(); | 1515 return VaapiWrapper::GetSupportedDecodeProfiles(); |
1519 } | 1516 } |
1520 | 1517 |
1521 } // namespace content | 1518 } // namespace content |
OLD | NEW |