Skip to content

Commit 9778ed2

Browse files
aoife cassidytheomonnom
andauthored
examples: update e2ee to use current API (#220)
Co-authored-by: Théo Monnom <[email protected]>
1 parent bfa00ed commit 9778ed2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/e2ee.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ async def draw_cube(source: rtc.VideoSource):
4747
[3, 7],
4848
]
4949

50-
frame = rtc.ArgbFrame.create(rtc.VideoFormatType.FORMAT_ARGB, WIDTH, HEIGHT)
51-
arr = np.frombuffer(frame.data, dtype=np.uint8)
50+
arr = np.zeros((WIDTH * HEIGHT * 4), dtype=np.uint8)
5251
angle = 0
5352

5453
while True:
@@ -88,7 +87,7 @@ async def draw_cube(source: rtc.VideoSource):
8887
idx = (y + dy) * WIDTH * 4 + (x + dx) * 4
8988
arr[idx : idx + 4] = [255, 255, 255, 255]
9089

91-
f = rtc.VideoFrame(frame.to_i420())
90+
f = rtc.VideoFrame(WIDTH, HEIGHT, rtc.VideoBufferType.ARGB, arr)
9291
source.capture_frame(f)
9392
angle += 0.02
9493

0 commit comments

Comments
 (0)