Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 1124423008: MJPEG acceleration for video capture using VAAPI, the GPU and IPC part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mjpeg-1-media
Patch Set: gpu_jpeg_decode_accelerator.cc filter to dispatch decode task Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 gpu_channel_manager_->RemoveChannel(client_id_); 659 gpu_channel_manager_->RemoveChannel(client_id_);
660 } 660 }
661 661
662 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { 662 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
663 bool handled = true; 663 bool handled = true;
664 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) 664 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg)
665 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer, 665 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer,
666 OnCreateOffscreenCommandBuffer) 666 OnCreateOffscreenCommandBuffer)
667 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, 667 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
668 OnDestroyCommandBuffer) 668 OnDestroyCommandBuffer)
669 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuMsg_CreateJpegDecoder,
670 OnCreateJpegDecoder)
669 IPC_MESSAGE_UNHANDLED(handled = false) 671 IPC_MESSAGE_UNHANDLED(handled = false)
670 IPC_END_MESSAGE_MAP() 672 IPC_END_MESSAGE_MAP()
671 DCHECK(handled) << msg.type(); 673 DCHECK(handled) << msg.type();
672 return handled; 674 return handled;
673 } 675 }
674 676
675 void GpuChannel::HandleMessage() { 677 void GpuChannel::HandleMessage() {
676 handle_messages_scheduled_ = false; 678 handle_messages_scheduled_ = false;
677 if (deferred_messages_.empty()) 679 if (deferred_messages_.empty())
678 return; 680 return;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 router_.RemoveRoute(route_id); 782 router_.RemoveRoute(route_id);
781 stubs_.Remove(route_id); 783 stubs_.Remove(route_id);
782 // In case the renderer is currently blocked waiting for a sync reply from the 784 // In case the renderer is currently blocked waiting for a sync reply from the
783 // stub, we need to make sure to reschedule the GpuChannel here. 785 // stub, we need to make sure to reschedule the GpuChannel here.
784 if (need_reschedule) { 786 if (need_reschedule) {
785 // This stub won't get a chance to reschedule, so update the count now. 787 // This stub won't get a chance to reschedule, so update the count now.
786 StubSchedulingChanged(true); 788 StubSchedulingChanged(true);
787 } 789 }
788 } 790 }
789 791
792 void GpuChannel::OnCreateJpegDecoder(int32 route_id, IPC::Message* reply_msg) {
793 if (!jpeg_decoder_) {
794 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_));
795 }
796 jpeg_decoder_->AddClient(route_id, reply_msg);
797 }
798
799 #if 0
800 void GpuChannel::ReleaseJpegDecoder(int32 route_id) {
801 jpeg_decoder_.reset();
802 DCHECK(jpeg_decoder_map_.get(route_id));
803 jpeg_decoder_map_.erase(route_id);
804 }
805 #endif
piman 2015/05/26 23:31:53 nit: remove
kcwu 2015/05/27 14:13:23 Done.
806
790 void GpuChannel::MessageProcessed() { 807 void GpuChannel::MessageProcessed() {
791 messages_processed_++; 808 messages_processed_++;
792 if (preempting_flag_.get()) { 809 if (preempting_flag_.get()) {
793 io_task_runner_->PostTask( 810 io_task_runner_->PostTask(
794 FROM_HERE, base::Bind(&GpuChannelMessageFilter::MessageProcessed, 811 FROM_HERE, base::Bind(&GpuChannelMessageFilter::MessageProcessed,
795 filter_, messages_processed_)); 812 filter_, messages_processed_));
796 } 813 }
797 } 814 }
798 815
799 void GpuChannel::CacheShader(const std::string& key, 816 void GpuChannel::CacheShader(const std::string& key,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 } 865 }
849 } 866 }
850 } 867 }
851 868
852 void GpuChannel::HandleUpdateValueState( 869 void GpuChannel::HandleUpdateValueState(
853 unsigned int target, const gpu::ValueState& state) { 870 unsigned int target, const gpu::ValueState& state) {
854 pending_valuebuffer_state_->UpdateState(target, state); 871 pending_valuebuffer_state_->UpdateState(target, state);
855 } 872 }
856 873
857 } // namespace content 874 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698