| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 93 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 94 PP_CompletionCallback callback) { | 94 PP_CompletionCallback callback) { |
| 95 if (!platform_video_decoder_) | 95 if (!platform_video_decoder_) |
| 96 return PP_ERROR_BADRESOURCE; | 96 return PP_ERROR_BADRESOURCE; |
| 97 | 97 |
| 98 EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true); | 98 EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true); |
| 99 if (enter.failed()) | 99 if (enter.failed()) |
| 100 return PP_ERROR_FAILED; | 100 return PP_ERROR_FAILED; |
| 101 | 101 |
| 102 PPB_Buffer_Impl* buffer = static_cast<PPB_Buffer_Impl*>(enter.object()); | 102 PPB_Buffer_Impl* buffer = static_cast<PPB_Buffer_Impl*>(enter.object()); |
| 103 media::BitstreamBuffer decode_buffer(bitstream_buffer->id, | 103 media::BitstreamBuffer decode_buffer( |
| 104 buffer->shared_memory()->handle(), | 104 bitstream_buffer->id, |
| 105 static_cast<size_t>(buffer->size())); | 105 buffer->shared_memory()->handle(), |
| 106 static_cast<size_t>(bitstream_buffer->size)); |
| 106 SetBitstreamBufferCallback(bitstream_buffer->id, callback); | 107 SetBitstreamBufferCallback(bitstream_buffer->id, callback); |
| 107 | 108 |
| 108 FlushCommandBuffer(); | 109 FlushCommandBuffer(); |
| 109 platform_video_decoder_->Decode(decode_buffer); | 110 platform_video_decoder_->Decode(decode_buffer); |
| 110 return PP_OK_COMPLETIONPENDING; | 111 return PP_OK_COMPLETIONPENDING; |
| 111 } | 112 } |
| 112 | 113 |
| 113 void PPB_VideoDecoder_Impl::AssignPictureBuffers( | 114 void PPB_VideoDecoder_Impl::AssignPictureBuffers( |
| 114 uint32_t no_of_buffers, | 115 uint32_t no_of_buffers, |
| 115 const PP_PictureBuffer_Dev* buffers) { | 116 const PP_PictureBuffer_Dev* buffers) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 void PPB_VideoDecoder_Impl::AddRefResource(PP_Resource resource) { | 246 void PPB_VideoDecoder_Impl::AddRefResource(PP_Resource resource) { |
| 246 ResourceTracker::Get()->AddRefResource(resource); | 247 ResourceTracker::Get()->AddRefResource(resource); |
| 247 } | 248 } |
| 248 | 249 |
| 249 void PPB_VideoDecoder_Impl::UnrefResource(PP_Resource resource) { | 250 void PPB_VideoDecoder_Impl::UnrefResource(PP_Resource resource) { |
| 250 ResourceTracker::Get()->UnrefResource(resource); | 251 ResourceTracker::Get()->UnrefResource(resource); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace ppapi | 254 } // namespace ppapi |
| 254 } // namespace webkit | 255 } // namespace webkit |
| OLD | NEW |