Agora Java API Reference for Android
NGIAgoraVideoFrame.h
1 
2 // Copyright (c) 2020 Agora.io. All rights reserved
3 
4 // This program is confidential and proprietary to Agora.io.
5 // And may not be copied, reproduced, modified, disclosed to others, published
6 // or used, in whole or in part, without the express prior written permission
7 // of Agora.io.
8 
9 #pragma once // NOLINT(build/header_guard)
10 
11 #include "AgoraBase.h"
12 
13 #ifndef OPTIONAL_ENUM_CLASS
14 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
15 #define OPTIONAL_ENUM_CLASS enum class
16 #else
17 #define OPTIONAL_ENUM_CLASS enum
18 #endif
19 #endif
20 
21 namespace agora {
22 namespace rtc {
23 
29  public:
33  OPTIONAL_ENUM_CLASS Type {
37  kRawData,
41  kTexture,
42  };
43 
47  OPTIONAL_ENUM_CLASS Format {
48  kUnknown,
49  kI420,
50  kI420A,
51  kI422,
52  kNV21,
53  kNV12,
54  kRGBA,
55  kARGB,
56  kBGRA
57  };
58 
64  virtual Type type() const = 0;
65 
71  virtual Format format() const = 0;
72 
79  virtual int width() const = 0;
80 
87  virtual int height() const = 0;
88 
95  virtual int size() const = 0;
96 
103  virtual int rotation() const = 0;
104 
110  virtual void setRotation(int rotation) = 0;
111 
118  virtual int64_t timestampUs() const = 0;
119 
125  virtual void setTimeStampUs(int64_t timestampUs) = 0;
126 
133  virtual const uint8_t* data() const = 0;
134 
143  virtual uint8_t* mutableData() = 0;
144 
154  virtual int resize(int width, int height) = 0;
155 
156  // Reserved for future Texture data path.
157  // Expect to change when hardware video frame path is established.
158  struct TextureId {
159  uintptr_t id_;
160 
161  TextureId() : id_(0) {}
162  };
163 
169  virtual TextureId textureId() const = 0;
170 
180  virtual int fill(Format format, int width, int height, int rotation, const uint8_t* src) = 0;
181 
189  virtual int fill(Format format, int width, int height, int rotation, TextureId textureId) = 0;
190 
191  protected:
192  ~IVideoFrame() {}
193 };
194 
195 } // namespace rtc
196 } // namespace agora
agora::rtc::IVideoFrame::Type
OPTIONAL_ENUM_CLASS Type
Definition: NGIAgoraVideoFrame.h:33
agora::rtc::IVideoFrame::mutableData
virtual uint8_t * mutableData()=0
agora::rtc::IVideoFrame::height
virtual int height() const =0
agora::rtc::IVideoFrame::textureId
virtual TextureId textureId() const =0
agora::rtc::IVideoFrame::setRotation
virtual void setRotation(int rotation)=0
agora::rtc::IVideoFrame::fill
virtual int fill(Format format, int width, int height, int rotation, const uint8_t *src)=0
agora::rtc::IVideoFrame::resize
virtual int resize(int width, int height)=0
agora::rtc::IVideoFrame::format
virtual Format format() const =0
agora::rtc::IVideoFrame::data
virtual const uint8_t * data() const =0
agora::rtc::IVideoFrame::fill
virtual int fill(Format format, int width, int height, int rotation, TextureId textureId)=0
agora::rtc::IVideoFrame::type
virtual Type type() const =0
agora::rtc::IVideoFrame::timestampUs
virtual int64_t timestampUs() const =0
agora::rtc::IVideoFrame::setTimeStampUs
virtual void setTimeStampUs(int64_t timestampUs)=0
agora::rtc::IVideoFrame::width
virtual int width() const =0
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::IVideoFrame
Definition: NGIAgoraVideoFrame.h:28
agora::rtc::IVideoFrame::Format
OPTIONAL_ENUM_CLASS Format
Definition: NGIAgoraVideoFrame.h:47
agora::rtc::IVideoFrame::size
virtual int size() const =0
agora::rtc::IVideoFrame::rotation
virtual int rotation() const =0
agora::rtc::IVideoFrame::TextureId
Definition: NGIAgoraVideoFrame.h:158