Skip to content

Instantly share code, notes, and snippets.

@JBurkeKF
JBurkeKF / YuvFrame.java
Last active February 8, 2023 06:02
Copy a WebRTC I420Frame, convert it to a Bitmap (requires io.pristine:libjingle)
// TODO: Your own package name here
//package com.kittehface;
// Some work based on http://stackoverflow.com/a/12702836 by rics (http://stackoverflow.com/users/21047/rics)
import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
// TODO: project should include io.pristine:libjingle from Maven
@JBurkeKF
JBurkeKF / YuvFrame.java
Created February 19, 2020 22:24
Copy a WebRTC I420Frame, convert it to a Bitmap (requires org.webrtc:google-webrtc and io.github.zncmn.libyuv:core)
// TODO: Your own package name here
//package com.kittehface;
// Some work based on http://stackoverflow.com/a/12702836 by rics (http://stackoverflow.com/users/21047/rics)
import android.graphics.Bitmap;
import android.graphics.Matrix;
// TODO: project should include org.webrtc:google-webrtc from Google
import org.webrtc.VideoFrame;
@JBurkeKF
JBurkeKF / I420Frame.h
Created February 20, 2020 18:33
Copy a WebRTC I420Frame, convert it to a UIImage (requires CocoaPods GoogleWebRTC and libyuv-iOS)
//
// I420Frame.h
//
// Created by Joel Burke on 2/7/17.
// Copyright © 2017 Kittehface Software. All rights reserved.
//
// Requires GoogleWebRTC CocoaPod
// Requires libyuv-iOS CocoaPod
#ifndef I420Frame_h
import os
import sys
import subprocess
def Execute( command, cwd=None ):
result = 0
output = ""
print( "Run command [" + command + "]" )
mainBall = Circle(180, 200, 10, fill='red')
l = Label('No hit', 200, 20)
padLeft = Rect(5, 180, 5, 40, fill='black')
padRight = Rect(390, 180, 5, 40, fill='black')
mainBall.speedX = 6
mainBall.speedY = 5
mainBall.currentSpeedX = mainBall.speedX