OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/gpu/dxva_video_decode_accelerator_win.h" | 5 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #if !defined(OS_WIN) | 9 #if !defined(OS_WIN) |
10 #error This file should only be built on Windows. | 10 #error This file should only be built on Windows. |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 | 1874 |
1875 void DXVAVideoDecodeAccelerator::RequestPictureBuffers(int width, int height) { | 1875 void DXVAVideoDecodeAccelerator::RequestPictureBuffers(int width, int height) { |
1876 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 1876 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
1877 // This task could execute after the decoder has been torn down. | 1877 // This task could execute after the decoder has been torn down. |
1878 if (GetState() != kUninitialized && client_) { | 1878 if (GetState() != kUninitialized && client_) { |
1879 // When sharing NV12 textures, the client needs to provide 2 texture IDs | 1879 // When sharing NV12 textures, the client needs to provide 2 texture IDs |
1880 // per picture buffer, 1 for the Y channel and 1 for the UV channels. | 1880 // per picture buffer, 1 for the Y channel and 1 for the UV channels. |
1881 // They're shared to ANGLE using EGL_NV_stream_consumer_gltexture_yuv, so | 1881 // They're shared to ANGLE using EGL_NV_stream_consumer_gltexture_yuv, so |
1882 // they need to be GL_TEXTURE_EXTERNAL_OES. | 1882 // they need to be GL_TEXTURE_EXTERNAL_OES. |
1883 client_->ProvidePictureBuffers( | 1883 client_->ProvidePictureBuffers( |
1884 kNumPictureBuffers, | 1884 kNumPictureBuffers, share_nv12_textures_ ? 2 : 1, |
1885 share_nv12_textures_ ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN, | 1885 gfx::Size(width, height), |
1886 share_nv12_textures_ ? 2 : 1, gfx::Size(width, height), | |
1887 share_nv12_textures_ ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D); | 1886 share_nv12_textures_ ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D); |
1888 } | 1887 } |
1889 } | 1888 } |
1890 | 1889 |
1891 void DXVAVideoDecodeAccelerator::NotifyPictureReady(int picture_buffer_id, | 1890 void DXVAVideoDecodeAccelerator::NotifyPictureReady(int picture_buffer_id, |
1892 int input_buffer_id) { | 1891 int input_buffer_id) { |
1893 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 1892 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
1894 // This task could execute after the decoder has been torn down. | 1893 // This task could execute after the decoder has been torn down. |
1895 if (GetState() != kUninitialized && client_) { | 1894 if (GetState() != kUninitialized && client_) { |
1896 // TODO(henryhsu): Use correct visible size instead of (0, 0). We can't use | 1895 // TODO(henryhsu): Use correct visible size instead of (0, 0). We can't use |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 DismissStaleBuffers(true); | 2677 DismissStaleBuffers(true); |
2679 Invalidate(); | 2678 Invalidate(); |
2680 Initialize(config_, client_); | 2679 Initialize(config_, client_); |
2681 decoder_thread_task_runner_->PostTask( | 2680 decoder_thread_task_runner_->PostTask( |
2682 FROM_HERE, | 2681 FROM_HERE, |
2683 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2682 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
2684 base::Unretained(this))); | 2683 base::Unretained(this))); |
2685 } | 2684 } |
2686 | 2685 |
2687 } // namespace media | 2686 } // namespace media |
OLD | NEW |