mirror of
git://f0xx.org/android_cast
synced 2026-07-29 03:38:52 +03:00
snap
This commit is contained in:
@@ -8,7 +8,7 @@ The app loads `libandroidcast_codecs.so` for availability probes and future soft
|
||||
|-----------|------|--------|-------|
|
||||
| FEC 3/4 + RS | Yes | — | v2 **per-shard** on wire (`FecShardWire`); v1 monolithic decode still accepted |
|
||||
| NACK + retransmit cache | Yes | — | UDP `MSG_NACK`, combined with FEC when enabled |
|
||||
| libvpx VP8/VP9 | Native | Encode + decode | Screen cast via ImageReader; receiver libvpx or MediaCodec fallback |
|
||||
| libvpx VP8/VP9 | Native | Encode + decode | Screen cast via ImageReader; receiver libvpx (decoder uses `VPX_CODEC_USE_ERROR_CONCEALMENT` when supported) or MediaCodec fallback |
|
||||
| Opus / Speex | Stub | Probe only | Submodules under `third-party/` |
|
||||
|
||||
## Enable libvpx (developer)
|
||||
|
||||
@@ -342,9 +342,15 @@ Java_com_foxx_androidcast_media_codec_jni_NativeCodecBridge_nativeVpxDecoderCrea
|
||||
return 0L;
|
||||
}
|
||||
ctx->magic = VPX_DEC_MAGIC;
|
||||
vpx_codec_iface_t *iface = pick_decoder_iface(mime_utf);
|
||||
vpx_codec_dec_cfg_t cfg = {0};
|
||||
cfg.threads = 1;
|
||||
if (vpx_codec_dec_init(&ctx->codec, pick_decoder_iface(mime_utf), &cfg, 0) != VPX_CODEC_OK) {
|
||||
/* vpxdec.c: dec_flags |= VPX_CODEC_USE_ERROR_CONCEALMENT when --error-concealment */
|
||||
int dec_flags = 0;
|
||||
if (vpx_codec_get_caps(iface) & VPX_CODEC_CAP_ERROR_CONCEALMENT) {
|
||||
dec_flags |= VPX_CODEC_USE_ERROR_CONCEALMENT;
|
||||
}
|
||||
if (vpx_codec_dec_init(&ctx->codec, iface, &cfg, dec_flags) != VPX_CODEC_OK) {
|
||||
free(ctx);
|
||||
(*env)->ReleaseStringUTFChars(env, mime, mime_utf);
|
||||
return 0L;
|
||||
@@ -381,9 +387,8 @@ Java_com_foxx_androidcast_media_codec_jni_NativeCodecBridge_nativeVpxDecodeFrame
|
||||
vpx_codec_err_t err = vpx_codec_decode(&ctx->codec, (const uint8_t *) bytes, (unsigned int) len,
|
||||
NULL, 0);
|
||||
(*env)->ReleaseByteArrayElements(env, data, bytes, JNI_ABORT);
|
||||
if (err != VPX_CODEC_OK) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
/* With error concealment, vpx_codec_decode may warn yet still output a frame (see vpxdec.c). */
|
||||
(void) err;
|
||||
|
||||
ANativeWindow *window = ANativeWindow_fromSurface(env, surface);
|
||||
if (window == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user