Chromium Code Reviews| 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 "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 return PP_OK_COMPLETIONPENDING; | 172 return PP_OK_COMPLETIONPENDING; |
| 173 } | 173 } |
| 174 | 174 |
| 175 void PPB_VideoDecoder_Impl::Destroy() { | 175 void PPB_VideoDecoder_Impl::Destroy() { |
| 176 if (!platform_video_decoder_) | 176 if (!platform_video_decoder_) |
| 177 return; | 177 return; |
| 178 platform_video_decoder_->Destroy(); | 178 platform_video_decoder_->Destroy(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 181 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
| 182 uint32 requested_num_of_buffers, | 182 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { |
| 183 const gfx::Size& dimensions, | |
| 184 media::VideoDecodeAccelerator::MemoryType type) { | |
| 185 if (!ppp_videodecoder_) | 183 if (!ppp_videodecoder_) |
| 186 return; | 184 return; |
| 187 | 185 |
| 188 // TODO(vrk): Compiler assert or use switch statement instead of making | |
| 189 // a blind cast. | |
|
Ami GONE FROM CHROMIUM
2011/07/18 18:33:00
Does this TODO not apply elsewhere?
vrk (LEFT CHROMIUM)
2011/07/19 01:26:08
Looks like there are TODOs written in all the othe
| |
| 190 PP_PictureBufferType_Dev out_type = | |
| 191 static_cast<PP_PictureBufferType_Dev>(type); | |
| 192 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 186 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
| 193 ppp_videodecoder_->ProvidePictureBuffers( | 187 ppp_videodecoder_->ProvidePictureBuffers( |
| 194 instance()->pp_instance(), requested_num_of_buffers, out_dim, out_type); | 188 instance()->pp_instance(), requested_num_of_buffers, out_dim); |
| 195 } | 189 } |
| 196 | 190 |
| 197 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { | 191 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
| 198 if (!ppp_videodecoder_) | 192 if (!ppp_videodecoder_) |
| 199 return; | 193 return; |
| 200 | 194 |
| 201 PP_Picture_Dev output; | 195 PP_Picture_Dev output; |
| 202 output.picture_buffer_id = picture.picture_buffer_id(); | 196 output.picture_buffer_id = picture.picture_buffer_id(); |
| 203 output.bitstream_buffer_id = picture.bitstream_buffer_id(); | 197 output.bitstream_buffer_id = picture.bitstream_buffer_id(); |
| 204 output.visible_size = PP_MakeSize(picture.visible_size().width(), | |
| 205 picture.visible_size().height()); | |
| 206 output.decoded_size = PP_MakeSize(picture.decoded_size().width(), | |
| 207 picture.decoded_size().height()); | |
| 208 ppp_videodecoder_->PictureReady(instance()->pp_instance(), output); | 198 ppp_videodecoder_->PictureReady(instance()->pp_instance(), output); |
| 209 } | 199 } |
| 210 | 200 |
| 211 void PPB_VideoDecoder_Impl::DismissPictureBuffer(int32 picture_buffer_id) { | 201 void PPB_VideoDecoder_Impl::DismissPictureBuffer(int32 picture_buffer_id) { |
| 212 if (!ppp_videodecoder_) | 202 if (!ppp_videodecoder_) |
| 213 return; | 203 return; |
| 214 | 204 |
| 215 ppp_videodecoder_->DismissPictureBuffer( | 205 ppp_videodecoder_->DismissPictureBuffer( |
| 216 instance()->pp_instance(), picture_buffer_id); | 206 instance()->pp_instance(), picture_buffer_id); |
| 217 } | 207 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 | 254 |
| 265 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 255 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
| 266 if (initialization_callback_.func == NULL) | 256 if (initialization_callback_.func == NULL) |
| 267 return; | 257 return; |
| 268 | 258 |
| 269 PP_RunAndClearCompletionCallback(&initialization_callback_, PP_OK); | 259 PP_RunAndClearCompletionCallback(&initialization_callback_, PP_OK); |
| 270 } | 260 } |
| 271 | 261 |
| 272 } // namespace ppapi | 262 } // namespace ppapi |
| 273 } // namespace webkit | 263 } // namespace webkit |
| OLD | NEW |