FoxiGram/TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinFFMpeg.mm
instant992 8e79f2ee9c FoxiGram: Telegram client with built-in Xray VLESS proxy
Based on Nekogram. Key additions:
- Rebrand to FoxiGram (app name, APK name, applicationId com.foxigram.app)
- Embedded Xray (VLESS+Reality) proxy client via JNI libxray.so
- Bundled hidden one-tap proxies (LTE + WiFi), read-only in UI
- Auto-restore proxy on restart, rebind to active network (LTE/WiFi)
- Server credentials externalized to git-ignored XrayServers.java (+ template)
- libxray Go source included; compiled .so, keystore, google-services.json ignored
2026-06-08 16:41:07 +04:00

41 lines
1 KiB
Text

#include "DarwinFFMpeg.h"
extern "C" {
#include <libavutil/frame.h>
#include <libavutil/pixfmt.h>
#include <libavcodec/avcodec.h>
}
#import "ExtractCVPixelBuffer.h"
namespace tgcalls {
static enum AVPixelFormat getDarwinPreferredPixelFormat(__unused AVCodecContext *ctx, __unused const enum AVPixelFormat *pix_fmts) {
return AV_PIX_FMT_VIDEOTOOLBOX;
}
void setupDarwinVideoDecoding(AVCodecContext *codecContext) {
return;
#if TARGET_IPHONE_SIMULATOR
#else
if (!codecContext) {
return;
}
av_hwdevice_ctx_create(&codecContext->hw_device_ctx, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, nullptr, nullptr, 0);
codecContext->get_format = getDarwinPreferredPixelFormat;
#endif
}
webrtc::scoped_refptr<webrtc::VideoFrameBuffer> createDarwinPlatformFrameFromData(AVFrame const *frame) {
if (!frame) {
return nullptr;
}
if (frame->format == AV_PIX_FMT_VIDEOTOOLBOX && frame->data[3]) {
return extractCVPixelBuffer((void *)frame->data[3]);
} else {
return nullptr;
}
}
}