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

Side by Side Diff: content/gpu/media/mft_angle_video_device.cc

Issue 6793054: Moved code that runs in both the browser and GPU process from content/gpu to content/common/gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/gpu/media/mft_angle_video_device.h ('k') | content/gpu/x_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/gpu/media/mft_angle_video_device.h"
6
7 #include <d3d9.h>
8
9 #include "media/base/video_frame.h"
10 #include "third_party/angle/src/libGLESv2/main.h"
11
12 MftAngleVideoDevice::MftAngleVideoDevice()
13 : device_(reinterpret_cast<egl::Display*>(
14 eglGetCurrentDisplay())->getDevice()) {
15 }
16
17 void* MftAngleVideoDevice::GetDevice() {
18 return device_;
19 }
20
21 bool MftAngleVideoDevice::CreateVideoFrameFromGlTextures(
22 size_t width, size_t height, media::VideoFrame::Format format,
23 const std::vector<media::VideoFrame::GlTexture>& textures,
24 scoped_refptr<media::VideoFrame>* frame) {
25 media::VideoFrame::GlTexture texture_array[media::VideoFrame::kMaxPlanes];
26 memset(texture_array, 0, sizeof(texture_array));
27
28 for (size_t i = 0; i < textures.size(); ++i) {
29 texture_array[i] = textures[i];
30 }
31
32 media::VideoFrame::CreateFrameGlTexture(format,
33 width,
34 height,
35 texture_array,
36 frame);
37 return *frame != NULL;
38 }
39
40 void MftAngleVideoDevice::ReleaseVideoFrame(
41 const scoped_refptr<media::VideoFrame>& frame) {
42 // We didn't need to anything here because we didn't allocate any resources
43 // for the VideoFrame(s) generated.
44 }
45
46 bool MftAngleVideoDevice::ConvertToVideoFrame(
47 void* buffer, scoped_refptr<media::VideoFrame> frame) {
48 gl::Context* context = (gl::Context*)eglGetCurrentContext();
49 // TODO(hclam): Connect ANGLE to upload the surface to texture when changes
50 // to ANGLE is done.
51 return true;
52 }
OLDNEW
« no previous file with comments | « content/gpu/media/mft_angle_video_device.h ('k') | content/gpu/x_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698