You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
impement android.media.MediaCodec using libavcodec
The current implementation requires a VA-API driver and a Wayland compositor with YUV-buffer support. GNOME supports YUV-buffers since the recent version 45 release
This commit is contained in:
42
src/api-impl/android/media/MediaFormat.java
Normal file
42
src/api-impl/android/media/MediaFormat.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package android.media;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MediaFormat {
|
||||
|
||||
private Map<String, Object> map = new HashMap<>();
|
||||
|
||||
public void setString(String key, String value) {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
public void setInteger(String key, int value) {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
public void setByteBuffer(String key, ByteBuffer value) {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
public void setFloat(String key, float value) {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
public ByteBuffer getByteBuffer(String name) {
|
||||
return (ByteBuffer) map.get(name);
|
||||
}
|
||||
|
||||
public int getInteger(String name) {
|
||||
return (int) map.get(name);
|
||||
}
|
||||
|
||||
public boolean containsKey(String name) {
|
||||
return map.containsKey(name);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return map.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user