From 4ca3437a739700a9c726248f165ada8169a02de2 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Thu, 27 Jun 2024 09:44:33 -0300 Subject: [PATCH] Explain how to use CEF with a macOS app bundle --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ba7f034..00b9c50 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,48 @@ yourself. Thankfully at least two projects can help you with that daunting task: - https://github.com/reinismu/cefbuild : Docker to build cef with all codecs - https://github.com/philn/cef-build-box : Semi-automatic and reproducible CEF build +## Preparation + +On macOS, CEF tests at multiple steps that it is being loaded from within an +application bundle. This means that when you call e.g. `gst-launch-1.0`, it must +first be turned into a macOS app. To do this, you can follow these steps: + +1. Move `/bin/gst-launch-1.0` to `/bin/gst-launch-1.0.app/Contents/MacOS/gst-launch-1.0` +2. Symlink `/bin/gst-launch-1.0.app/Contents/MacOS/gst-launch-1.0` to `/bin/gst-launch-1.0` +3. Paste the XML file below into `/bin/gst-launch-1.0.app/Contents/Info.plist` + +```xml + + + + + CFBundleGetInfoString + GStreamer + CFBundleExecutable + gst-launch-1.0 + CFBundleIdentifier + org.gstreamer.GStreamer + CFBundleName + gst-launch-1.0 + CFBundleShortVersionString + 1.0 + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + NSPrincipalClass + NSApplication + NSHighResolutionCapable + True + LSMinimumSystemVersion + 10.13.0 + + +``` + +After this, you can run the steps below, replacing `gst-launch-1.0` with +`/bin/gst-launch-1.0.app/Contents/MacOS/gst-launch-1.0`. + ## Run The element can then be tested with: @@ -103,4 +145,4 @@ chrome-extra-flags="use-gl=egl, enable-gpu-rasterization,ignore-gpu-blocklist" \ ! pngenc ! multifilesink location="frame%d.png" ``` -It is also helpful to run nvidia-smi or nvtop to verify the GPU is being used. Note it is possible to use the GPU within a kube pod as well. This has been tested and runs in a production environment on GKE using Container Optimized OS. \ No newline at end of file +It is also helpful to run nvidia-smi or nvtop to verify the GPU is being used. Note it is possible to use the GPU within a kube pod as well. This has been tested and runs in a production environment on GKE using Container Optimized OS.