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( | 379 client_->PictureReady(media::Picture(picture_id, frame.bitstream_id)); |
380 picture_id, frame.bitstream_id, gfx::Rect(texture_size_))); | |
381 client_->NotifyEndOfBitstreamBuffer(frame.bitstream_id); | 380 client_->NotifyEndOfBitstreamBuffer(frame.bitstream_id); |
382 } | 381 } |
383 | 382 |
384 glDisable(GL_TEXTURE_RECTANGLE_ARB); | 383 glDisable(GL_TEXTURE_RECTANGLE_ARB); |
385 } | 384 } |
386 | 385 |
387 void VTVideoDecodeAccelerator::Flush() { | 386 void VTVideoDecodeAccelerator::Flush() { |
388 DCHECK(CalledOnValidThread()); | 387 DCHECK(CalledOnValidThread()); |
389 // TODO(sandersd): Trigger flush, sending frames. | 388 // TODO(sandersd): Trigger flush, sending frames. |
390 } | 389 } |
391 | 390 |
392 void VTVideoDecodeAccelerator::Reset() { | 391 void VTVideoDecodeAccelerator::Reset() { |
393 DCHECK(CalledOnValidThread()); | 392 DCHECK(CalledOnValidThread()); |
394 // TODO(sandersd): Trigger flush, discarding frames. | 393 // TODO(sandersd): Trigger flush, discarding frames. |
395 } | 394 } |
396 | 395 |
397 void VTVideoDecodeAccelerator::Destroy() { | 396 void VTVideoDecodeAccelerator::Destroy() { |
398 DCHECK(CalledOnValidThread()); | 397 DCHECK(CalledOnValidThread()); |
399 // TODO(sandersd): Trigger flush, discarding frames, and wait for them. | 398 // TODO(sandersd): Trigger flush, discarding frames, and wait for them. |
400 delete this; | 399 delete this; |
401 } | 400 } |
402 | 401 |
403 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { | 402 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { |
404 return false; | 403 return false; |
405 } | 404 } |
406 | 405 |
407 } // namespace content | 406 } // namespace content |
OLD | NEW |