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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include <CoreVideo/CoreVideo.h> | 7 #include <CoreVideo/CoreVideo.h> |
8 #include <OpenGL/CGLIOSurface.h> | 8 #include <OpenGL/CGLIOSurface.h> |
9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
10 | 10 |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 surface, // io_surface | 854 surface, // io_surface |
855 0); // plane | 855 0); // plane |
856 if (status != kCGLNoError) { | 856 if (status != kCGLNoError) { |
857 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status); | 857 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status); |
858 return false; | 858 return false; |
859 } | 859 } |
860 glDisable(GL_TEXTURE_RECTANGLE_ARB); | 860 glDisable(GL_TEXTURE_RECTANGLE_ARB); |
861 | 861 |
862 available_picture_ids_.pop_back(); | 862 available_picture_ids_.pop_back(); |
863 picture_bindings_[picture_id] = frame.image; | 863 picture_bindings_[picture_id] = frame.image; |
864 client_->PictureReady(media::Picture( | 864 client_->PictureReady(media::Picture(picture_id, frame.bitstream_id, |
865 picture_id, frame.bitstream_id, gfx::Rect(frame.coded_size))); | 865 gfx::Rect(frame.coded_size), false)); |
866 return true; | 866 return true; |
867 } | 867 } |
868 | 868 |
869 void VTVideoDecodeAccelerator::NotifyError(Error error) { | 869 void VTVideoDecodeAccelerator::NotifyError(Error error) { |
870 if (!gpu_thread_checker_.CalledOnValidThread()) { | 870 if (!gpu_thread_checker_.CalledOnValidThread()) { |
871 gpu_task_runner_->PostTask(FROM_HERE, base::Bind( | 871 gpu_task_runner_->PostTask(FROM_HERE, base::Bind( |
872 &VTVideoDecodeAccelerator::NotifyError, weak_this_, error)); | 872 &VTVideoDecodeAccelerator::NotifyError, weak_this_, error)); |
873 } else if (state_ == STATE_DECODING) { | 873 } else if (state_ == STATE_DECODING) { |
874 state_ = STATE_ERROR; | 874 state_ = STATE_ERROR; |
875 client_->NotifyError(error); | 875 client_->NotifyError(error); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 assigned_bitstream_ids_.clear(); | 916 assigned_bitstream_ids_.clear(); |
917 state_ = STATE_DESTROYING; | 917 state_ = STATE_DESTROYING; |
918 QueueFlush(TASK_DESTROY); | 918 QueueFlush(TASK_DESTROY); |
919 } | 919 } |
920 | 920 |
921 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { | 921 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { |
922 return false; | 922 return false; |
923 } | 923 } |
924 | 924 |
925 } // namespace content | 925 } // namespace content |
OLD | NEW |