| 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 "media/video/picture.h" | 10 #include "media/video/picture.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 std::swap(callback, flush_callback_); | 391 std::swap(callback, flush_callback_); |
| 392 PP_RunCompletionCallback(&callback, PP_OK); | 392 PP_RunCompletionCallback(&callback, PP_OK); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace ppapi | 395 } // namespace ppapi |
| 396 } // namespace webkit | 396 } // namespace webkit |
| 397 | 397 |
| 398 // These functions are declared in picture.h but are defined here because of | 398 // These functions are declared in picture.h but are defined here because of |
| 399 // dependencies (we can't depend on ppapi types from media). | 399 // dependencies (we can't depend on ppapi types from media). |
| 400 namespace media { | 400 namespace media { |
| 401 BaseBuffer::BaseBuffer(const PP_BufferInfo_Dev& info) | 401 BufferInfo::BufferInfo(const PP_BufferInfo_Dev& info) |
| 402 : id_(info.id), | 402 : id_(info.id), |
| 403 size_(info.size.width, info.size.height) { | 403 size_(info.size.width, info.size.height) { |
| 404 } | 404 } |
| 405 | 405 |
| 406 // TODO(vrk): This assigns the PP_Resource context to be | 406 // TODO(vrk): This assigns the PP_Resource context to be |
| 407 // the context_id. Not sure what it's actually supposed to be. | 407 // the context_id. Not sure what it's actually supposed to be. |
| 408 GLESBuffer::GLESBuffer(const PP_GLESBuffer_Dev& buffer) | 408 GLESBuffer::GLESBuffer(const PP_GLESBuffer_Dev& buffer) |
| 409 : BaseBuffer(buffer.info), | 409 : texture_id_(buffer.texture_id), |
| 410 texture_id_(buffer.texture_id), | 410 context_id_(buffer.context), |
| 411 context_id_(buffer.context) { | 411 info_(buffer.info) { |
| 412 } | 412 } |
| 413 | 413 |
| 414 SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer) | 414 SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer) |
| 415 : BaseBuffer(buffer.info) { | 415 : info_(buffer.info) { |
| 416 scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> pepper_buffer = | 416 scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> pepper_buffer = |
| 417 webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Buffer_Impl>( | 417 webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Buffer_Impl>( |
| 418 buffer.data); | 418 buffer.data); |
| 419 assert(pepper_buffer->is_mapped()); | 419 assert(pepper_buffer->is_mapped()); |
| 420 data_ = pepper_buffer->mapped_buffer(); | 420 data_ = pepper_buffer->mapped_buffer(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 Picture::Picture(const PP_Picture_Dev& picture) | 423 Picture::Picture(const PP_Picture_Dev& picture) |
| 424 : picture_buffer_id_(picture.picture_buffer_id), | 424 : picture_buffer_id_(picture.picture_buffer_id), |
| 425 bitstream_buffer_id_(picture.bitstream_buffer_id), | 425 bitstream_buffer_id_(picture.bitstream_buffer_id), |
| 426 visible_size_(picture.visible_size.width, picture.visible_size.height), | 426 visible_size_(picture.visible_size.width, picture.visible_size.height), |
| 427 decoded_size_(picture.decoded_size.width, picture.decoded_size.height) { | 427 decoded_size_(picture.decoded_size.width, picture.decoded_size.height) { |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace media | 430 } // namespace media |
| OLD | NEW |