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 "base/file_descriptor_posix.h" | 5 #include "base/file_descriptor_posix.h" |
6 #include "media/gpu/va_surface.h" | 6 #include "media/gpu/va_surface.h" |
7 #include "media/gpu/vaapi_drm_picture.h" | 7 #include "media/gpu/vaapi_drm_picture.h" |
8 #include "media/gpu/vaapi_wrapper.h" | 8 #include "media/gpu/vaapi_wrapper.h" |
9 #include "third_party/libva/va/drm/va_drm.h" | 9 #include "third_party/libva/va/drm/va_drm.h" |
10 #include "third_party/libva/va/va.h" | 10 #include "third_party/libva/va/va.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return Initialize(); | 116 return Initialize(); |
117 } | 117 } |
118 | 118 |
119 bool VaapiDrmPicture::ImportGpuMemoryBufferHandle( | 119 bool VaapiDrmPicture::ImportGpuMemoryBufferHandle( |
120 gfx::BufferFormat format, | 120 gfx::BufferFormat format, |
121 const gfx::GpuMemoryBufferHandle& gpu_memory_buffer_handle) { | 121 const gfx::GpuMemoryBufferHandle& gpu_memory_buffer_handle) { |
122 ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance(); | 122 ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance(); |
123 ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone(); | 123 ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone(); |
124 // CreateNativePixmapFromHandle() will take ownership of the handle. | 124 // CreateNativePixmapFromHandle() will take ownership of the handle. |
125 pixmap_ = factory->CreateNativePixmapFromHandle( | 125 pixmap_ = factory->CreateNativePixmapFromHandle( |
126 size_, format, gpu_memory_buffer_handle.native_pixmap_handle); | 126 gfx::kNullAcceleratedWidget, size_, format, |
| 127 gpu_memory_buffer_handle.native_pixmap_handle); |
127 if (!pixmap_) { | 128 if (!pixmap_) { |
128 DVLOG(1) << "Failed creating a pixmap from a native handle"; | 129 DVLOG(1) << "Failed creating a pixmap from a native handle"; |
129 return false; | 130 return false; |
130 } | 131 } |
131 | 132 |
132 return Initialize(); | 133 return Initialize(); |
133 } | 134 } |
134 | 135 |
135 bool VaapiDrmPicture::DownloadFromSurface( | 136 bool VaapiDrmPicture::DownloadFromSurface( |
136 const scoped_refptr<VASurface>& va_surface) { | 137 const scoped_refptr<VASurface>& va_surface) { |
137 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); | 138 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); |
138 } | 139 } |
139 | 140 |
140 bool VaapiDrmPicture::AllowOverlay() const { | 141 bool VaapiDrmPicture::AllowOverlay() const { |
141 return true; | 142 return true; |
142 } | 143 } |
143 | 144 |
144 } // namespace media | 145 } // namespace media |
OLD | NEW |