wu@webrtc.org | 9dba525 | 2013-08-05 20:36:57 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ |
| 12 | #define COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ |
| 13 | |
| 14 | #include "webrtc/typedefs.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | // A class to store an opaque handle of the underlying video frame. This is used |
| 19 | // when the frame is backed by a texture. WebRTC carries the handle in |
| 20 | // TextureVideoFrame. This object keeps a reference to the handle. The reference |
| 21 | // is cleared when the object is destroyed. It is important to destroy the |
| 22 | // object as soon as possible so the texture can be recycled. |
| 23 | class NativeHandle { |
| 24 | public: |
| 25 | virtual ~NativeHandle() {} |
| 26 | // For scoped_refptr |
| 27 | virtual int32_t AddRef() = 0; |
| 28 | virtual int32_t Release() = 0; |
| 29 | |
| 30 | // Gets the handle. |
| 31 | virtual void* GetHandle() = 0; |
| 32 | }; |
| 33 | |
| 34 | } // namespace webrtc |
| 35 | |
| 36 | #endif // COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ |