Meeting SDK for Android API Reference
Loading...
Searching...
No Matches
ZoomSDKVideoRawData.java
Go to the documentation of this file.
1package us.zoom.sdk;
2
3import java.nio.ByteBuffer;
4
5import us.zoom.internal.RTCConference;
6import us.zoom.internal.impl.ZoomSDKFaceROIInfoImpl;
7
13public class ZoomSDKVideoRawData {
14
15 public static final int FORMAT_TYPE_I420 = 0;
16
17 private ByteBuffer yBuffer;
18
19 private ByteBuffer uBuffer;
20
21 private ByteBuffer vBuffer;
22
23 private ByteBuffer aBuffer;
24
25 private boolean isLimited;
26
27 private int streamWidth;
28
29 private int streamHeight;
30
31 private int rotation;
32 private long timeStamp;
33
34 private int format;
35
36 private long nativeHandle = -1;
37 private long nativeYHandle = -1;
38 private long nativeUHandle = -1;
39 private long nativeVHandle = -1;
40
41 private long nativeAHandle = -1;
42
50
51 public ZoomSDKVideoRawData(ByteBuffer yBuffer, ByteBuffer uBuffer, ByteBuffer vBuffer, ByteBuffer aBuffer,boolean isLimited, int streamWidth, int streamHeight, int rotation,long timeStamp, int format, long nativeHandle,
53 this.yBuffer = yBuffer;
54 this.uBuffer = uBuffer;
55 this.vBuffer = vBuffer;
56 this.aBuffer = aBuffer;
57 this.isLimited = isLimited;
58 this.streamWidth = streamWidth;
59 this.streamHeight = streamHeight;
60 this.rotation = rotation;
61 this.timeStamp=timeStamp;
62 this.format = format;
63 this.nativeHandle = nativeHandle;
64 this.nativeYHandle = nativeYHandle;
65 this.nativeUHandle = nativeUHandle;
66 this.nativeVHandle = nativeVHandle;
67 this.nativeAHandle = nativeAHandle;
68 }
69
74
75 public ZoomSDKVideoRawData(ByteBuffer yBuffer, ByteBuffer uBuffer, ByteBuffer vBuffer, boolean isLimited, int streamWidth, int streamHeight, int rotation, long timeStamp,int format, long nativeHandle) {
76 this.yBuffer = yBuffer;
77 this.uBuffer = uBuffer;
78 this.vBuffer = vBuffer;
79 this.isLimited = isLimited;
80 this.streamWidth = streamWidth;
81 this.streamHeight = streamHeight;
82 this.rotation = rotation;
83 this.timeStamp=timeStamp;
84 this.format = format;
85 this.nativeHandle = nativeHandle;
86 }
87
88 public boolean canAddRef() {
89 if (nativeHandle == -1) {
90 return false;
91 }
92 return RTCConference.getInstance().getVideoRawDataHelper().canAddRef(nativeHandle);
93 }
94
95 public void addRef() {
96 if (nativeHandle == -1) {
97 return;
98 }
99 RTCConference.getInstance().getVideoRawDataHelper().addRef(nativeHandle);
100 }
101
102 public void releaseRef() {
103 if (nativeHandle == -1) {
104 return;
105 }
106 int count = RTCConference.getInstance().getVideoRawDataHelper().releaseRef(nativeHandle);
107 if (count <= 0) {
108 nativeHandle = -1;
109 }
110 }
111
117 public ByteBuffer getyBuffer() {
118 return yBuffer;
119 }
120
126 public ByteBuffer getuBuffer() {
127 return uBuffer;
128 }
129
135 public ByteBuffer getvBuffer() {
136 return vBuffer;
137 }
138
144 public ByteBuffer getAlphaBuffer() {
145 return aBuffer;
146 }
147
153 public boolean isLimited() {
154 return isLimited;
155 }
156
162 public int getStreamWidth() {
163 return streamWidth;
164 }
165
171 public int getStreamHeight() {
172 return streamHeight;
173 }
174
180 public int getRotation() {
181 return rotation;
182 }
183
189 public int getFormat() {
190 return format;
191 }
192
198 public long getTimeStamp() {
199 return timeStamp;
200 }
201
202
203 public long getNativeHandle() {
204 return nativeHandle;
205 }
206
207 public long getNativeYBuffer() {
208 return nativeYHandle;
209 }
210
211 public long getNativeUBuffer() {
212 return nativeUHandle;
213 }
214
215 public long getNativeVBuffer() {
216 return nativeVHandle;
217 }
218
219 public long getNativeAlphaBuffer() {
220 return nativeAHandle;
221 }
222
236 if (faceROIInfoCache != null) {
237 return faceROIInfoCache;
238 }
239 float[] rects = null;
240 if (nativeHandle != -1) {
241 // Single JNI round-trip per frame; native side reads
242 // YUVRawDataI420::GetFaceROIInfo() and packs into float[].
243 rects = RTCConference.getInstance().getVideoRawDataHelper()
244 .getFaceROIRects(nativeHandle);
245 }
246 faceROIInfoCache = new ZoomSDKFaceROIInfoImpl(rects);
247 return faceROIInfoCache;
248 }
249}
ByteBuffer getyBuffer()
Gets the YUVI420 Y buffer.
long getTimeStamp()
Gets the timestamp.
ByteBuffer getvBuffer()
Gets the YUVI420 V buffer.
boolean isLimited()
Determines whether video raw data is limited.
ByteBuffer getAlphaBuffer()
Gets the YUVI420 alpha buffer.
int getFormat()
Gets the video raw data format.
int getStreamWidth()
Gets the stream width.
IZoomSDKFaceROIInfo getFaceROIInfo()
Gets the per-frame face ROI metadata reported by the sender.
int getStreamHeight()
Gets the stream height.
int getRotation()
Gets the video raw data rotation.
ByteBuffer getuBuffer()
Gets the YUVI420 U buffer.
ZoomSDKVideoRawData(ByteBuffer yBuffer, ByteBuffer uBuffer, ByteBuffer vBuffer, boolean isLimited, int streamWidth, int streamHeight, int rotation, long timeStamp, int format, long nativeHandle)
ZoomSDKVideoRawData(ByteBuffer yBuffer, ByteBuffer uBuffer, ByteBuffer vBuffer, boolean isLimited, int streamWidth, int streamHeight, int rotation, long timeStamp, int format, long nativeHandle, long nativeYHandle, long nativeUHandle, long nativeVHandle)
ZoomSDKVideoRawData(ByteBuffer yBuffer, ByteBuffer uBuffer, ByteBuffer vBuffer, ByteBuffer aBuffer, boolean isLimited, int streamWidth, int streamHeight, int rotation, long timeStamp, int format, long nativeHandle, long nativeYHandle, long nativeUHandle, long nativeVHandle, long nativeAHandle)
Per-frame face ROI metadata accessor.