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

Side by Side Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 1421903006: ui/gl: Move GLImage into gl namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone demo Created 5 years, 1 month 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 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return lhs->pic_order_cnt > rhs->pic_order_cnt; 293 return lhs->pic_order_cnt > rhs->pic_order_cnt;
294 // If |pic_order_cnt| is the same, fall back on using the bitstream order. 294 // If |pic_order_cnt| is the same, fall back on using the bitstream order.
295 // TODO(sandersd): Assign a sequence number in Decode() and use that instead. 295 // TODO(sandersd): Assign a sequence number in Decode() and use that instead.
296 // TODO(sandersd): Using the sequence number, ensure that frames older than 296 // TODO(sandersd): Using the sequence number, ensure that frames older than
297 // |kMaxReorderQueueSize| are ordered first, regardless of |pic_order_cnt|. 297 // |kMaxReorderQueueSize| are ordered first, regardless of |pic_order_cnt|.
298 return lhs->bitstream_id > rhs->bitstream_id; 298 return lhs->bitstream_id > rhs->bitstream_id;
299 } 299 }
300 300
301 VTVideoDecodeAccelerator::VTVideoDecodeAccelerator( 301 VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
302 const base::Callback<bool(void)>& make_context_current, 302 const base::Callback<bool(void)>& make_context_current,
303 const base::Callback<void(uint32, uint32, scoped_refptr<gfx::GLImage>)>& 303 const base::Callback<void(uint32, uint32, scoped_refptr<gl::GLImage>)>&
304 bind_image) 304 bind_image)
305 : make_context_current_(make_context_current), 305 : make_context_current_(make_context_current),
306 bind_image_(bind_image), 306 bind_image_(bind_image),
307 client_(nullptr), 307 client_(nullptr),
308 state_(STATE_DECODING), 308 state_(STATE_DECODING),
309 format_(nullptr), 309 format_(nullptr),
310 session_(nullptr), 310 session_(nullptr),
311 last_sps_id_(-1), 311 last_sps_id_(-1),
312 last_pps_id_(-1), 312 last_pps_id_(-1),
313 gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()), 313 gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()),
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 surface, // io_surface 1037 surface, // io_surface
1038 0); // plane 1038 0); // plane
1039 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile) 1039 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile)
1040 glDisable(GL_TEXTURE_RECTANGLE_ARB); 1040 glDisable(GL_TEXTURE_RECTANGLE_ARB);
1041 if (status != kCGLNoError) { 1041 if (status != kCGLNoError) {
1042 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR); 1042 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR);
1043 return false; 1043 return false;
1044 } 1044 }
1045 1045
1046 bool allow_overlay = false; 1046 bool allow_overlay = false;
1047 scoped_refptr<gfx::GLImageIOSurface> gl_image( 1047 scoped_refptr<gl::GLImageIOSurface> gl_image(
1048 new gfx::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT)); 1048 new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT));
1049 if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(), 1049 if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(),
1050 gfx::BufferFormat::BGRA_8888)) { 1050 gfx::BufferFormat::BGRA_8888)) {
1051 allow_overlay = true; 1051 allow_overlay = true;
1052 } else { 1052 } else {
1053 gl_image = nullptr; 1053 gl_image = nullptr;
1054 } 1054 }
1055 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB, 1055 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB,
1056 gl_image); 1056 gl_image);
1057 1057
1058 // Assign the new image(s) to the the picture info. 1058 // Assign the new image(s) to the the picture info.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 SupportedProfile profile; 1142 SupportedProfile profile;
1143 profile.profile = supported_profile; 1143 profile.profile = supported_profile;
1144 profile.min_resolution.SetSize(16, 16); 1144 profile.min_resolution.SetSize(16, 16);
1145 profile.max_resolution.SetSize(4096, 2160); 1145 profile.max_resolution.SetSize(4096, 2160);
1146 profiles.push_back(profile); 1146 profiles.push_back(profile);
1147 } 1147 }
1148 return profiles; 1148 return profiles;
1149 } 1149 }
1150 1150
1151 } // namespace content 1151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698