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/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 init_done_msg_ = NULL; | 97 init_done_msg_ = NULL; |
98 } | 98 } |
99 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( | 99 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( |
100 host_route_id_, error))) { | 100 host_route_id_, error))) { |
101 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " | 101 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " |
102 << "failed"; | 102 << "failed"; |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 void GpuVideoDecodeAccelerator::Initialize( | 106 void GpuVideoDecodeAccelerator::Initialize( |
107 const std::vector<int32>& configs, | 107 const media::VideoDecodeAccelerator::Profile profile, |
108 IPC::Message* init_done_msg) { | 108 IPC::Message* init_done_msg) { |
109 DCHECK(!video_decode_accelerator_.get()); | 109 DCHECK(!video_decode_accelerator_.get()); |
110 DCHECK(!init_done_msg_); | 110 DCHECK(!init_done_msg_); |
111 DCHECK(init_done_msg); | 111 DCHECK(init_done_msg); |
112 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 112 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
113 DCHECK(stub_ && stub_->scheduler()); | 113 DCHECK(stub_ && stub_->scheduler()); |
114 init_done_msg_ = init_done_msg; | 114 init_done_msg_ = init_done_msg; |
115 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); | 115 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); |
116 omx_decoder->SetEglState( | 116 omx_decoder->SetEglState( |
117 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 117 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
118 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); | 118 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); |
119 video_decode_accelerator_ = omx_decoder; | 119 video_decode_accelerator_ = omx_decoder; |
120 video_decode_accelerator_->Initialize(configs); | 120 video_decode_accelerator_->Initialize(profile); |
121 #else | 121 #else |
122 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 122 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
123 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 123 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
124 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 124 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
125 } | 125 } |
126 | 126 |
127 void GpuVideoDecodeAccelerator::OnDecode( | 127 void GpuVideoDecodeAccelerator::OnDecode( |
128 base::SharedMemoryHandle handle, int32 id, int32 size) { | 128 base::SharedMemoryHandle handle, int32 id, int32 size) { |
129 DCHECK(video_decode_accelerator_.get()); | 129 DCHECK(video_decode_accelerator_.get()); |
130 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); | 130 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 197 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
198 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 198 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
199 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 199 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
200 } | 200 } |
201 | 201 |
202 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 202 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
203 DCHECK(sender_); | 203 DCHECK(sender_); |
204 return sender_->Send(message); | 204 return sender_->Send(message); |
205 } | 205 } |
OLD | NEW |