| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <CoreVideo/CoreVideo.h> | 5 #include <CoreVideo/CoreVideo.h> |
| 6 #include <OpenGL/CGLIOSurface.h> | 6 #include <OpenGL/CGLIOSurface.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 GL_TEXTURE_RECTANGLE_ARB, // target | 369 GL_TEXTURE_RECTANGLE_ARB, // target |
| 370 GL_RGB, // internal_format | 370 GL_RGB, // internal_format |
| 371 texture_size_.width(), // width | 371 texture_size_.width(), // width |
| 372 texture_size_.height(), // height | 372 texture_size_.height(), // height |
| 373 GL_YCBCR_422_APPLE, // format | 373 GL_YCBCR_422_APPLE, // format |
| 374 GL_UNSIGNED_SHORT_8_8_APPLE, // type | 374 GL_UNSIGNED_SHORT_8_8_APPLE, // type |
| 375 surface, // io_surface | 375 surface, // io_surface |
| 376 0)); // plane | 376 0)); // plane |
| 377 | 377 |
| 378 picture_bindings_[picture_id] = frame.image_buffer; | 378 picture_bindings_[picture_id] = frame.image_buffer; |
| 379 client_->PictureReady(media::Picture(picture_id, frame.bitstream_id)); | 379 client_->PictureReady(media::Picture( |
| 380 picture_id, frame.bitstream_id, gfx::Rect(texture_size_))); |
| 380 client_->NotifyEndOfBitstreamBuffer(frame.bitstream_id); | 381 client_->NotifyEndOfBitstreamBuffer(frame.bitstream_id); |
| 381 } | 382 } |
| 382 | 383 |
| 383 glDisable(GL_TEXTURE_RECTANGLE_ARB); | 384 glDisable(GL_TEXTURE_RECTANGLE_ARB); |
| 384 } | 385 } |
| 385 | 386 |
| 386 void VTVideoDecodeAccelerator::Flush() { | 387 void VTVideoDecodeAccelerator::Flush() { |
| 387 DCHECK(CalledOnValidThread()); | 388 DCHECK(CalledOnValidThread()); |
| 388 // TODO(sandersd): Trigger flush, sending frames. | 389 // TODO(sandersd): Trigger flush, sending frames. |
| 389 } | 390 } |
| 390 | 391 |
| 391 void VTVideoDecodeAccelerator::Reset() { | 392 void VTVideoDecodeAccelerator::Reset() { |
| 392 DCHECK(CalledOnValidThread()); | 393 DCHECK(CalledOnValidThread()); |
| 393 // TODO(sandersd): Trigger flush, discarding frames. | 394 // TODO(sandersd): Trigger flush, discarding frames. |
| 394 } | 395 } |
| 395 | 396 |
| 396 void VTVideoDecodeAccelerator::Destroy() { | 397 void VTVideoDecodeAccelerator::Destroy() { |
| 397 DCHECK(CalledOnValidThread()); | 398 DCHECK(CalledOnValidThread()); |
| 398 // TODO(sandersd): Trigger flush, discarding frames, and wait for them. | 399 // TODO(sandersd): Trigger flush, discarding frames, and wait for them. |
| 399 delete this; | 400 delete this; |
| 400 } | 401 } |
| 401 | 402 |
| 402 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { | 403 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { |
| 403 return false; | 404 return false; |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace content | 407 } // namespace content |
| OLD | NEW |