Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 1942123002: Plumb decoded video pixel format from GPU process to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, share_nv12_textures_ ? 2 : 1, 1884 kNumPictureBuffers,
1885 gfx::Size(width, height), 1885 share_nv12_textures_ ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN,
1886 share_nv12_textures_ ? 2 : 1, gfx::Size(width, height),
1886 share_nv12_textures_ ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D); 1887 share_nv12_textures_ ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D);
1887 } 1888 }
1888 } 1889 }
1889 1890
1890 void DXVAVideoDecodeAccelerator::NotifyPictureReady(int picture_buffer_id, 1891 void DXVAVideoDecodeAccelerator::NotifyPictureReady(int picture_buffer_id,
1891 int input_buffer_id) { 1892 int input_buffer_id) {
1892 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 1893 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
1893 // This task could execute after the decoder has been torn down. 1894 // This task could execute after the decoder has been torn down.
1894 if (GetState() != kUninitialized && client_) { 1895 if (GetState() != kUninitialized && client_) {
1895 // TODO(henryhsu): Use correct visible size instead of (0, 0). We can't use 1896 // 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
2677 DismissStaleBuffers(true); 2678 DismissStaleBuffers(true);
2678 Invalidate(); 2679 Invalidate();
2679 Initialize(config_, client_); 2680 Initialize(config_, client_);
2680 decoder_thread_task_runner_->PostTask( 2681 decoder_thread_task_runner_->PostTask(
2681 FROM_HERE, 2682 FROM_HERE,
2682 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, 2683 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers,
2683 base::Unretained(this))); 2684 base::Unretained(this)));
2684 } 2685 }
2685 2686
2686 } // namespace media 2687 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698