Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/common/gpu/media/media_service.h" | |
| 6 | |
| 7 #include "ipc/ipc_message_macros.h" | |
| 8 #include "ipc/param_traits_macros.h" | |
| 9 #include "content/common/gpu/gpu_channel.h" | |
| 10 #include "content/common/gpu/gpu_channel_manager.h" | |
| 11 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | |
| 12 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" | |
| 13 #include "content/common/gpu/media/media_channel.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 MediaService::MediaService(GpuChannelManager* channel_manager) | |
| 18 : channel_manager_(channel_manager) {} | |
| 19 | |
| 20 MediaService::~MediaService() {} | |
| 21 | |
| 22 void MediaService::AddChannel(int32_t client_id) { | |
| 23 GpuChannel* gpu_channel = channel_manager_->LookupChannel(client_id); | |
| 24 DCHECK(gpu_channel); | |
| 25 scoped_ptr<MediaChannel> media_channel(new MediaChannel(gpu_channel)); | |
| 26 gpu_channel->SetUnhandledMessageListener(media_channel.get()); | |
| 27 media_channels_.set(client_id, std::move(media_channel)); | |
|
dcheng
2016/03/03 23:46:42
#include <utility>
Fady Samuel
2016/03/04 01:46:32
Done.
| |
| 28 } | |
| 29 | |
| 30 void MediaService::RemoveChannel(int32_t client_id) { | |
| 31 media_channels_.erase(client_id); | |
| 32 } | |
| 33 | |
| 34 void MediaService::DestroyAllChannels() { | |
| 35 media_channels_.clear(); | |
| 36 } | |
| 37 | |
| 38 } // namespace content | |
| OLD | NEW |