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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; | 79 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void GpuVideoDecodeAccelerator::NotifyEndOfStream() { | 83 void GpuVideoDecodeAccelerator::NotifyEndOfStream() { |
84 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(host_route_id_)); | 84 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(host_route_id_)); |
85 } | 85 } |
86 | 86 |
87 void GpuVideoDecodeAccelerator::NotifyError( | 87 void GpuVideoDecodeAccelerator::NotifyError( |
88 media::VideoDecodeAccelerator::Error error) { | 88 media::VideoDecodeAccelerator::Error error) { |
89 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( | 89 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( |
Ami GONE FROM CHROMIUM
2011/08/11 04:53:19
Hmm. Your change makes me think that if init_don
piman
2011/08/11 05:08:18
I haven't audited in which conditions NotifyError
piman
2011/08/11 21:02:01
Done.
| |
90 host_route_id_, error))) { | 90 host_route_id_, error))) { |
91 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " | 91 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " |
92 << "failed"; | 92 << "failed"; |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 void GpuVideoDecodeAccelerator::Initialize( | 96 void GpuVideoDecodeAccelerator::Initialize( |
97 const std::vector<int32>& configs, | 97 const std::vector<int32>& configs, |
98 IPC::Message* init_done_msg) { | 98 IPC::Message* init_done_msg) { |
99 DCHECK(!video_decode_accelerator_.get()); | 99 DCHECK(!video_decode_accelerator_.get()); |
100 DCHECK(!init_done_msg_); | 100 DCHECK(!init_done_msg_); |
101 DCHECK(init_done_msg); | 101 DCHECK(init_done_msg); |
102 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 102 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
103 DCHECK(stub_ && stub_->scheduler()); | 103 DCHECK(stub_ && stub_->scheduler()); |
104 init_done_msg_ = init_done_msg; | 104 init_done_msg_ = init_done_msg; |
105 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); | 105 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); |
106 omx_decoder->SetEglState( | 106 omx_decoder->SetEglState( |
107 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 107 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
108 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); | 108 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); |
109 video_decode_accelerator_ = omx_decoder; | 109 video_decode_accelerator_ = omx_decoder; |
110 video_decode_accelerator_->Initialize(configs); | 110 video_decode_accelerator_->Initialize(configs); |
111 #else | 111 #else |
112 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 112 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
113 init_done_msg->set_reply_error(); | |
114 Send(init_done_msg); | |
113 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 115 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
114 } | 116 } |
115 | 117 |
116 void GpuVideoDecodeAccelerator::OnDecode( | 118 void GpuVideoDecodeAccelerator::OnDecode( |
117 base::SharedMemoryHandle handle, int32 id, int32 size) { | 119 base::SharedMemoryHandle handle, int32 id, int32 size) { |
118 DCHECK(video_decode_accelerator_.get()); | 120 DCHECK(video_decode_accelerator_.get()); |
119 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); | 121 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); |
120 } | 122 } |
121 | 123 |
122 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( | 124 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 | 187 |
186 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 188 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
187 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 189 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
188 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 190 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
189 } | 191 } |
190 | 192 |
191 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 193 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
192 DCHECK(sender_); | 194 DCHECK(sender_); |
193 return sender_->Send(message); | 195 return sender_->Send(message); |
194 } | 196 } |
OLD | NEW |