| 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 #ifndef CHROME_GPU_MEDIA_GPU_VIDEO_DEVICE_H_ | |
| 6 #define CHROME_GPU_MEDIA_GPU_VIDEO_DEVICE_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "media/base/video_frame.h" | |
| 11 #include "media/video/video_decode_context.h" | |
| 12 | |
| 13 // A GpuVideoDevice is used by GpuVideoDecoder to allocate video frames | |
| 14 // meaningful to a corresponding VideoDecodeEngine. | |
| 15 // | |
| 16 // GpuVideoDecoder will provide a set of GL textures to this class and then | |
| 17 // GpuVideoDevice will transform the textures into a set of VideoFrame | |
| 18 // objects that can be used by VideoDecodeEngine. | |
| 19 // | |
| 20 // See text in GpuVideoDecoder for the overall flow for buffer allocation. | |
| 21 // | |
| 22 // Since all graphics commands execute on the main thread in the GPU process | |
| 23 // all the methods provided by this class are synchronous. | |
| 24 class GpuVideoDevice { | |
| 25 public: | |
| 26 virtual ~GpuVideoDevice() {} | |
| 27 | |
| 28 // Get the hardware video decoding device handle. | |
| 29 virtual void* GetDevice() = 0; | |
| 30 | |
| 31 // The following method is used by GpuVideoDecoder to create VideoFrame(s) | |
| 32 // associated with some GL textures. | |
| 33 // | |
| 34 // VideoFrame generated is used by VideoDecodeEngine for output buffer. | |
| 35 // | |
| 36 // |frame| will contain the VideoFrame generated. | |
| 37 // | |
| 38 // Return true if the operation was successful. | |
| 39 virtual bool CreateVideoFrameFromGlTextures( | |
| 40 size_t width, size_t height, media::VideoFrame::Format format, | |
| 41 const std::vector<media::VideoFrame::GlTexture>& textures, | |
| 42 scoped_refptr<media::VideoFrame>* frame) = 0; | |
| 43 | |
| 44 // Release VideoFrame generated. | |
| 45 virtual void ReleaseVideoFrame( | |
| 46 const scoped_refptr<media::VideoFrame>& frame) = 0; | |
| 47 | |
| 48 // Upload a device specific buffer to a VideoFrame object that can be used in | |
| 49 // the GPU process. | |
| 50 // | |
| 51 // Return true if successful. | |
| 52 virtual bool ConvertToVideoFrame(void* buffer, | |
| 53 scoped_refptr<media::VideoFrame> frame) = 0; | |
| 54 }; | |
| 55 | |
| 56 #endif // CHROME_GPU_MEDIA_GPU_VIDEO_DEVICE_H_ | |
| OLD | NEW |