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

Side by Side Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.h

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: edit description Created 6 years 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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/threading/non_thread_safe.h" 11 #include "base/threading/non_thread_safe.h"
12 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 12 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
13 #include "gpu/config/gpu_info.h"
13 #include "ipc/ipc_listener.h" 14 #include "ipc/ipc_listener.h"
14 #include "media/video/video_decode_accelerator.h" 15 #include "media/video/video_decode_accelerator.h"
15 #include "ui/gfx/size.h" 16 #include "ui/gfx/size.h"
16 17
17 namespace content { 18 namespace content {
18 class GpuChannelHost; 19 class GpuChannelHost;
19 20
20 // This class is used to talk to VideoDecodeAccelerator in the Gpu process 21 // This class is used to talk to VideoDecodeAccelerator in the Gpu process
21 // through IPC messages. 22 // through IPC messages.
22 class GpuVideoDecodeAcceleratorHost 23 class GpuVideoDecodeAcceleratorHost
23 : public IPC::Listener, 24 : public IPC::Listener,
24 public media::VideoDecodeAccelerator, 25 public media::VideoDecodeAccelerator,
25 public CommandBufferProxyImpl::DeletionObserver, 26 public CommandBufferProxyImpl::DeletionObserver,
26 public base::NonThreadSafe { 27 public base::NonThreadSafe {
27 public: 28 public:
28 // |this| is guaranteed not to outlive |channel| and |impl|. (See comments 29 // |this| is guaranteed not to outlive |channel| and |impl|. (See comments
29 // for |channel_| and |impl_|.) 30 // for |channel_| and |impl_|.)
30 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, 31 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel,
31 CommandBufferProxyImpl* impl); 32 CommandBufferProxyImpl* impl);
32 33
34 static std::vector<media::VideoDecodeAccelerator::SupportedProfile>
35 ConvertGpuToMediaProfiles(const std::vector<
36 gpu::VideoDecodeAcceleratorSupportedProfile>& gpu_profiles);
37
33 // IPC::Listener implementation. 38 // IPC::Listener implementation.
34 void OnChannelError() override; 39 void OnChannelError() override;
35 bool OnMessageReceived(const IPC::Message& message) override; 40 bool OnMessageReceived(const IPC::Message& message) override;
36 41
37 // media::VideoDecodeAccelerator implementation. 42 // media::VideoDecodeAccelerator implementation.
43 std::vector<media::VideoDecodeAccelerator::SupportedProfile>
44 GetSupportedProfiles();
38 bool Initialize(media::VideoCodecProfile profile, Client* client) override; 45 bool Initialize(media::VideoCodecProfile profile, Client* client) override;
39 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; 46 void Decode(const media::BitstreamBuffer& bitstream_buffer) override;
40 void AssignPictureBuffers( 47 void AssignPictureBuffers(
41 const std::vector<media::PictureBuffer>& buffers) override; 48 const std::vector<media::PictureBuffer>& buffers) override;
42 void ReusePictureBuffer(int32 picture_buffer_id) override; 49 void ReusePictureBuffer(int32 picture_buffer_id) override;
43 void Flush() override; 50 void Flush() override;
44 void Reset() override; 51 void Reset() override;
45 void Destroy() override; 52 void Destroy() override;
46 53
47 // CommandBufferProxyImpl::DeletionObserver implemetnation. 54 // CommandBufferProxyImpl::DeletionObserver implemetnation.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 98
92 // WeakPtr factory for posting tasks back to itself. 99 // WeakPtr factory for posting tasks back to itself.
93 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; 100 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_;
94 101
95 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); 102 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost);
96 }; 103 };
97 104
98 } // namespace content 105 } // namespace content
99 106
100 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 107 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698