summaryrefslogtreecommitdiff
path: root/chromium/third_party/webrtc/common_video/interface/native_handle.h
blob: d078d4ca2e93bef248f1aeb1b0c6e7c60e2cd7da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_
#define COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_

#include "webrtc/typedefs.h"

namespace webrtc {

// A class to store an opaque handle of the underlying video frame. This is used
// when the frame is backed by a texture. WebRTC carries the handle in
// TextureVideoFrame. This object keeps a reference to the handle. The reference
// is cleared when the object is destroyed. It is important to destroy the
// object as soon as possible so the texture can be recycled.
class NativeHandle {
 public:
  virtual ~NativeHandle() {}
  // For scoped_refptr
  virtual int32_t AddRef() = 0;
  virtual int32_t Release() = 0;

  // Gets the handle.
  virtual void* GetHandle() = 0;
};

}  // namespace webrtc

#endif  // COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_