| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 "chrome/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 } | |
| OLD | NEW |