OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gpu_video_service.h" | 5 #include "content/common/gpu/gpu_video_service.h" |
6 | 6 |
7 #include "content/common/gpu/gpu_channel.h" | 7 #include "content/common/gpu/gpu_channel.h" |
8 #include "content/common/gpu/gpu_messages.h" | 8 #include "content/common/gpu/gpu_messages.h" |
9 #include "content/common/gpu/gpu_video_decode_accelerator.h" | 9 #include "content/common/gpu/gpu_video_decode_accelerator.h" |
10 | 10 |
| 11 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 12 #include "content/common/gpu/omx_video_decode_accelerator.h" |
| 13 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 14 |
11 GpuVideoService::GpuVideoService() { | 15 GpuVideoService::GpuVideoService() { |
12 // TODO(jiesun): move this time consuming stuff out of here. | 16 // TODO(jiesun): move this time consuming stuff out of here. |
13 IntializeGpuVideoService(); | 17 IntializeGpuVideoService(); |
14 } | 18 } |
15 | 19 |
16 GpuVideoService::~GpuVideoService() { | 20 GpuVideoService::~GpuVideoService() { |
17 // TODO(jiesun): move this time consuming stuff out of here. | 21 // TODO(jiesun): move this time consuming stuff out of here. |
18 UnintializeGpuVideoService(); | 22 UnintializeGpuVideoService(); |
19 } | 23 } |
20 | 24 |
(...skipping 29 matching lines...) Expand all Loading... |
50 | 54 |
51 bool GpuVideoService::CreateVideoDecoder( | 55 bool GpuVideoService::CreateVideoDecoder( |
52 GpuChannel* channel, | 56 GpuChannel* channel, |
53 MessageRouter* router, | 57 MessageRouter* router, |
54 int32 decoder_host_id, | 58 int32 decoder_host_id, |
55 int32 decoder_id, | 59 int32 decoder_id, |
56 const std::vector<uint32>& configs) { | 60 const std::vector<uint32>& configs) { |
57 // Create GpuVideoDecodeAccelerator and add to map. | 61 // Create GpuVideoDecodeAccelerator and add to map. |
58 scoped_refptr<GpuVideoDecodeAccelerator> decoder = | 62 scoped_refptr<GpuVideoDecodeAccelerator> decoder = |
59 new GpuVideoDecodeAccelerator(channel, decoder_host_id); | 63 new GpuVideoDecodeAccelerator(channel, decoder_host_id); |
| 64 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 65 decoder->set_video_decode_accelerator( |
| 66 new OmxVideoDecodeAccelerator(decoder, MessageLoop::current())); |
| 67 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
60 | 68 |
61 bool result = decoder_map_.insert(std::make_pair(decoder_id, decoder)).second; | 69 bool result = decoder_map_.insert(std::make_pair(decoder_id, decoder)).second; |
62 | 70 |
63 // Decoder ID is a unique ID determined by GpuVideoServiceHost. | 71 // Decoder ID is a unique ID determined by GpuVideoServiceHost. |
64 // We should always be adding entries here. | 72 // We should always be adding entries here. |
65 DCHECK(result); | 73 DCHECK(result); |
66 | 74 |
67 router->AddRoute(decoder_id, decoder); | 75 router->AddRoute(decoder_id, decoder); |
68 | 76 |
69 // Tell client that initialization is complete. | 77 // Tell client that initialization is complete. |
70 channel->Send( | 78 channel->Send( |
71 new AcceleratedVideoDecoderHostMsg_CreateDone( | 79 new AcceleratedVideoDecoderHostMsg_CreateDone( |
72 decoder_host_id, decoder_id)); | 80 decoder_host_id, decoder_id)); |
73 | 81 |
74 return true; | 82 return true; |
75 } | 83 } |
76 | 84 |
77 void GpuVideoService::DestroyVideoDecoder( | 85 void GpuVideoService::DestroyVideoDecoder( |
78 MessageRouter* router, | 86 MessageRouter* router, |
79 int32 decoder_id) { | 87 int32 decoder_id) { |
80 router->RemoveRoute(decoder_id); | 88 router->RemoveRoute(decoder_id); |
81 decoder_map_.erase(decoder_id); | 89 decoder_map_.erase(decoder_id); |
82 } | 90 } |
OLD | NEW |