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 #include "AgoraRefPtr.h"
13 
14 namespace agora {
15 namespace rtc {
16 
22  public:
26  enum class Type {
30  kRawData,
34  kTexture,
35  };
36 
40  enum class Format {
41  kUnknown,
42  kI420,
43  kI420A,
44  kI422,
45  kNV21,
46  kNV12,
47  kRGBA,
48  kARGB,
49  kBGRA
50  };
51 
57  virtual Type type() const = 0;
58 
64  virtual Format format() const = 0;
65 
72  virtual int width() const = 0;
73 
80  virtual int height() const = 0;
81 
88  virtual int size() const = 0;
89 
96  virtual int rotation() const = 0;
97 
103  virtual void setRotation(int rotation) = 0;
104 
111  virtual int64_t timestampUs() const = 0;
112 
118  virtual void setTimeStampUs(int64_t timestampUs) = 0;
119 
126  virtual const uint8_t* data() const = 0;
127 
136  virtual uint8_t* mutableData() = 0;
137 
147  virtual int resize(int width, int height) = 0;
148 
149  // Reserved for future Texture data path.
150  // Expect to change when hardware video frame path is established.
151  struct TextureId {
152  uintptr_t id_;
153 
154  TextureId() : id_(0) {}
155  };
156 
162  virtual TextureId textureId() const = 0;
163 
173  virtual int fill(Format format, int width, int height, int rotation, const uint8_t* src) = 0;
174 
182  virtual int fill(Format format, int width, int height, int rotation, TextureId textureId) = 0;
183 
184  protected:
185  ~IVideoFrame() {}
186 };
187 
188 } // namespace rtc
189 } // namespace agora
agora::rtc::IVideoFrame::mutableData
virtual uint8_t * mutableData()=0
agora::rtc::IVideoFrame::Type::kRawData
@ kRawData
agora::rtc::IVideoFrame::Type
Type
Definition: NGIAgoraVideoFrame.h:26
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::Format
Format
Definition: NGIAgoraVideoFrame.h:40
agora::rtc::IVideoFrame::timestampUs
virtual int64_t timestampUs() const =0
agora::rtc::IVideoFrame::Type::kTexture
@ kTexture
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:21
agora::rtc::IVideoFrame
Definition: NGIAgoraVideoFrame.h:21
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:151