### Get Help for BuildFFmpeg Script Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md Display the help message for the BuildFFmpeg script to understand available options and configurations. ```bash swift package BuildFFmpeg -h ``` -------------------------------- ### Basic MPV Player Integration Source: https://context7.com/kingslay/ffmpegkit/llms.txt A conceptual Swift example demonstrating the basic integration pattern for the MPV player library. Requires C interop. ```swift // Basic MPV integration example import Foundation // MPV requires C interop - typically used through a wrapper // This shows the conceptual usage pattern class MPVPlayer { private var mpv: OpaquePointer? init() { // Create MPV context mpv = mpv_create() guard mpv != nil else { fatalError("Failed to create MPV context") } // Set options before initialization mpv_set_option_string(mpv, "vo", "gpu") mpv_set_option_string(mpv, "hwdec", "videotoolbox") // Initialize MPV let error = mpv_initialize(mpv) guard error >= 0 else { fatalError("Failed to initialize MPV: \(error)") } } func loadFile(_ path: String) { var args: [UnsafePointer?] = [ "loadfile", path, nil ] mpv_command(mpv, &args) } func play() { var flag: Int32 = 0 mpv_set_property(mpv, "pause", MPV_FORMAT_FLAG, &flag) } func pause() { var flag: Int32 = 1 mpv_set_property(mpv, "pause", MPV_FORMAT_FLAG, &flag) } deinit { mpv_terminate_destroy(mpv) } } ``` -------------------------------- ### Install FFmpegKit using CocoaPods Source: https://context7.com/kingslay/ffmpegkit/llms.txt Install FFmpegKit in your iOS project by adding the 'FFmpegKit' pod to your Podfile. ```ruby platform :ios, '13.0' target 'MyApp' do use_frameworks! pod 'FFmpegKit', '~> 6.1.0' end ``` -------------------------------- ### Libass Subtitle Renderer Integration Source: https://context7.com/kingslay/ffmpegkit/llms.txt A conceptual Swift example for integrating libass for subtitle rendering. This requires C interop and proper initialization. ```swift // libass integration pattern import Foundation // Note: libass requires C interop // This shows conceptual usage class SubtitleRenderer { private var library: OpaquePointer? private var renderer: OpaquePointer? private var track: OpaquePointer? init(width: Int, height: Int) { // Initialize ASS library library = ass_library_init() guard library != nil else { return } // Set font directory ass_set_fonts_dir(library, "/path/to/fonts") // Create renderer renderer = ass_renderer_init(library) guard renderer != nil else { return } // Set renderer size ass_set_frame_size(renderer, Int32(width), Int32(height)) // Set default font ass_set_fonts(renderer, nil, "sans-serif", ASS_FONTPROVIDER_CORETEXT, nil, 1) } func loadSubtitle(from path: String) { track = ass_read_file(library, path, nil) } func loadSubtitleData(_ data: Data, format: String) { track = ass_new_track(library) data.withUnsafeBytes { ass_process_codec_private(track, $0.baseAddress?.assumingMemoryBound(to: CChar.self), Int32(data.count)) } } func render(at timeMs: Int64) -> OpaquePointer? { var changed: Int32 = 0 return ass_render_frame(renderer, track, timeMs, &changed) } deinit { if track != nil { ass_free_track(track) } if renderer != nil { ass_renderer_done(renderer) } if library != nil { ass_library_done(library) } } } ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/ios-arm64_x86_64-simulator/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md Macros for declaring, defining, getting, and setting boolean, integer, and string flags. ```APIDOC ## Flag Related Macros ### Description Macros for declaring, defining, getting, and setting boolean, integer, and string flags. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)` * `GMOCK_DECLARE_int32_(name)` * `GMOCK_DECLARE_string_(name)` #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)` * `GMOCK_DEFINE_int32_(name, default_val, doc)` * `GMOCK_DEFINE_string_(name, default_val, doc)` #### Access Macros * `GMOCK_FLAG_GET(flag_name)` * `GMOCK_FLAG_SET(flag_name, value) ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/xros-arm64/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md Macros for declaring, defining, getting, and setting boolean, int32, and string flags. ```APIDOC ## Flag Related Macros ### Description Macros for declaring, defining, getting, and setting boolean, int32, and string flags. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)` * `GMOCK_DECLARE_int32_(name)` * `GMOCK_DECLARE_string_(name)` #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)` * `GMOCK_DEFINE_int32_(name, default_val, doc)` * `GMOCK_DEFINE_string_(name, default_val, doc)` #### Access Macros * `GMOCK_FLAG_GET(flag_name)` * `GMOCK_FLAG_SET(flag_name, value) ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/macos-arm64_x86_64/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md Macros for declaring, defining, getting, and setting boolean, int32, and string flags. ```APIDOC ## Flag Related Macros ### Description Macros for declaring, defining, getting, and setting boolean, int32, and string flags. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)` * `GMOCK_DECLARE_int32_(name)` * `GMOCK_DECLARE_string_(name)` #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)` * `GMOCK_DEFINE_int32_(name, default_val, doc)` * `GMOCK_DEFINE_string_(name, default_val, doc)` #### Access Macros * `GMOCK_FLAG_GET(flag_name)` * `GMOCK_FLAG_SET(flag_name, value) ``` -------------------------------- ### BuildFFmpeg Script Usage and Options Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md This section details the usage and available options for the `swift package BuildFFmpeg` command, including enabling various libraries and specifying deployment platforms. ```bash Usage: swift package BuildFFmpeg [OPTION]... Default Build: swift package --disable-sandbox BuildFFmpeg enable-libshaderc enable-vulkan enable-lcms2 enable-libdav1d enable-libplacebo enable-gmp enable-nettle enable-gnutls enbale-readline enable-libsmbclient enable-libsrt enable-libzvbi enable-libfreetype enable-libfribidi enable-libharfbuzz enable-libass enable-FFmpeg enable-libmpv Options: h, -h, --help display this help and exit notRecompile If there is a library, then there is no need to recompile gitCloneAll git clone not add --depth 1 enable-debug, build ffmpeg with debug information platforms=xros deployment platform: macos,ios,isimulator,tvos,tvsimulator,xros,xrsimulator,maccatalyst,watchos,watchsimulator --xx add ffmpeg Configuers Libraries: enable-libshaderc build with libshaderc enable-vulkan depend enable-libshaderc enable-libdav1d build with libdav1d enable-libplacebo depend enable-libshaderc enable-vulkan enable-lcms2 enable-libdav1d enable-nettle depend enable-gmp enable-gnutls depend enable-gmp enable-nettle enable-libsmbclient depend enable-gmp enable-nettle enable-gnutls enbale-readline enable-libsrt depend enable-openssl or enable-gnutls enable-libfreetype build with libfreetype enable-libharfbuzz depend enable-libfreetype enable-libass depend enable-libfreetype enable-libfribidi enable-libharfbuzz enable-libzvbi build with libzvbi enable-FFmpeg build with FFmpeg enable-libmpv depend enable-libass enable-FFmpeg enable-openssl build with openssl [no] ``` -------------------------------- ### Run FFmpegKit Executable Products Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md Execute the ffplay, ffmpeg, or ffprobe command-line tools directly using the swift run command. ```bash swift run ffplay ``` ```bash swift run ffmpeg ``` ```bash swift run ffprobe ``` -------------------------------- ### Build FFmpeg Native Libraries Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md Use the swift package command to build FFmpeg native libraries for your project. The --disable-sandbox flag is required. ```bash swift package --disable-sandbox BuildFFmpeg ``` -------------------------------- ### Run ffmpeg and ffprobe commands Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md Execute ffmpeg and ffprobe commands programmatically by preparing arguments and passing them to the respective execute functions. Ensure correct argument formatting and count. ```swift var arguments = ["ffmpeg", "-i", "file1.mp4", "-c:v", "mpeg4", "file2.mp4"] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffmpeg_execute(Int32(arguments.count), &argv) ``` ```swift arguments = ["ffprobe", "-h"] argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffprobe_execute(Int32(arguments.count), &argv) ``` -------------------------------- ### Run FFmpeg Command Line Tools on macOS Source: https://context7.com/kingslay/ffmpegkit/llms.txt Execute FFmpeg, ffplay, and ffprobe directly from the command line on macOS using `swift run`. This is useful for testing and development. ```bash # Run ffplay to play media files swift run ffplay video.mp4 # Run ffmpeg to convert media swift run ffmpeg -i input.mp4 -c:v hevc -c:a aac output.mp4 # Run ffprobe to analyze media files swift run ffprobe -v quiet -print_format json -show_format -show_streams video.mp4 # Example: Extract audio from video swift run ffmpeg -i video.mp4 -vn -acodec copy audio.m4a # Example: Create HLS stream swift run ffmpeg -i input.mp4 -c:v h264 -c:a aac -f hls -hls_time 10 -hls_list_size 0 output.m3u8 ``` -------------------------------- ### Build FFmpeg from Source with Swift Package Manager Plugin Source: https://context7.com/kingslay/ffmpegkit/llms.txt Customize and compile FFmpeg with specific features using the `BuildFFmpeg` plugin. This allows for fine-grained control over enabled libraries and target platforms. ```bash # Build with default configuration (all libraries enabled) swift package --disable-sandbox BuildFFmpeg # Show help and available options swift package BuildFFmpeg -h # Build for specific platforms only swift package --disable-sandbox BuildFFmpeg platforms=ios,macos # Build with debug information swift package --disable-sandbox BuildFFmpeg enable-debug # Build only specific libraries swift package --disable-sandbox BuildFFmpeg enable-FFmpeg enable-libass enable-libmpv # Build with custom FFmpeg configure options swift package --disable-sandbox BuildFFmpeg --enable-encoder=h264_videotoolbox ``` -------------------------------- ### Build FFmpegKit with Specific Libraries Source: https://context7.com/kingslay/ffmpegkit/llms.txt Use the `BuildFFmpeg` command to enable or disable specific libraries during the build process. Libraries can have dependencies on others. ```bash swift package --disable-sandbox BuildFFmpeg notRecompile ``` ```bash swift package --disable-sandbox BuildFFmpeg gitCloneAll ``` ```bash # Core libraries enable-FFmpeg # Build FFmpeg itself # Video processing enable-libdav1d # AV1 video decoder enable-libplacebo # GPU-accelerated video processing (requires: libshaderc, vulkan, lcms2, libdav1d) # Graphics/Rendering enable-libshaderc # Shader compiler enable-vulkan # Vulkan support via MoltenVK (requires: libshaderc) enable-lcms2 # Color management # Subtitles enable-libass # Advanced subtitle rendering (requires: libfreetype, libfribidi, libharfbuzz) enable-libfreetype # Font rendering enable-libfribidi # Unicode bidirectional text enable-libharfbuzz # Text shaping (requires: libfreetype) enable-libzvbi # Teletext/VBI decoder # Networking/Security enable-gmp # GNU Multiple Precision library enable-nettle # Crypto library (requires: gmp) enable-gnutls # TLS/SSL support (requires: gmp, nettle) enable-libsrt # Secure Reliable Transport (requires: openssl or gnutls) enable-libsmbclient # Samba/SMB support (requires: gmp, nettle, gnutls, readline) # Media players enable-libmpv # MPV player library (requires: libass, FFmpeg) # Optional enable-openssl # OpenSSL instead of GnuTLS enable-libfontconfig # Font configuration enable-libbluray # Blu-ray disc support (macOS only) ``` -------------------------------- ### Configure Target Platforms for FFmpegKit Source: https://context7.com/kingslay/ffmpegkit/llms.txt Specify target platforms for cross-compilation using the `platforms=` argument with the `BuildFFmpeg` command. Multiple platforms can be comma-separated. ```bash # Available platforms platforms=macos # macOS (arm64, x86_64) platforms=ios # iOS device (arm64) platforms=isimulator # iOS Simulator (arm64, x86_64) platforms=tvos # tvOS device (arm64, arm64e) platforms=tvsimulator # tvOS Simulator (arm64, x86_64) platforms=xros # visionOS device (arm64) platforms=xrsimulator # visionOS Simulator (arm64) platforms=maccatalyst # Mac Catalyst (arm64, x86_64) ``` ```bash # Build for multiple platforms swift package --disable-sandbox BuildFFmpeg platforms=ios,macos,tvos ``` ```bash # Build only for iOS and simulators swift package --disable-sandbox BuildFFmpeg platforms=ios,isimulator ``` ```bash # Build for visionOS swift package --disable-sandbox BuildFFmpeg platforms=xros,xrsimulator ``` -------------------------------- ### Enabled Filters Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the video and audio filters available in the default FFmpegKit build, including Vulkan-accelerated filters. ```bash # Enabled Filters aformat, amix, anull, aresample, areverse, asetrate, atempo, atrim, boxblur, bwdif, delogo, equalizer, estdif, firequalizer, format, fps, gblur, hflip, hwdownload, hwmap, hwupload, idet, lenscorrection, lut*, negate, null, overlay, palettegen, paletteuse, pan, rotate, scale, setpts, superequalizer, transpose, trim, vflip, volume, w3fdif, yadif, # Vulkan filters avgblur_vulkan, blend_vulkan, bwdif_vulkan, chromaber_vulkan, flip_vulkan, gblur_vulkan, hflip_vulkan, nlmeans_vulkan, overlay_vulkan, vflip_vulkan, xfade_vulkan ``` -------------------------------- ### Execute FFmpeg Commands in Swift Source: https://context7.com/kingslay/ffmpegkit/llms.txt Use the `ffmpeg_execute` and `ffprobe_execute` C functions to run FFmpeg and ffprobe commands programmatically within your Swift application. Ensure proper argument formatting and error handling. ```swift import Foundation // Convert video from MP4 to MPEG4 codec func convertVideo(input: String, output: String) { var arguments = ["ffmpeg", "-i", input, "-c:v", "mpeg4", output] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } let result = ffmpeg_execute(Int32(arguments.count), &argv) if result == 0 { print("Conversion successful") } else { print("Conversion failed with code: \(result)") } } // Probe media file information func probeMediaInfo(filePath: String) { var arguments = ["ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", filePath] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffprobe_execute(Int32(arguments.count), &argv) } // Get help for ffprobe func showFFprobeHelp() { var arguments = ["ffprobe", "-h"] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffprobe_execute(Int32(arguments.count), &argv) } ``` -------------------------------- ### Access FFmpeg C APIs from Swift Source: https://context7.com/kingslay/ffmpegkit/llms.txt Import FFmpeg libraries in Swift to directly call FFmpeg's C APIs for advanced media processing tasks. Ensure FFmpeg is initialized. ```swift // Swift code using FFmpeg C APIs import Libavcodec import Libavformat import Libavutil func getCodecInfo() { // Initialize FFmpeg av_log_set_level(AV_LOG_VERBOSE) // Find H. 264 decoder let codec = avcodec_find_decoder(AV_CODEC_ID_H264) if let codec = codec { print("Found codec: \(String(cString: codec.pointee.name))\n") print("Long name: \(String(cString: codec.pointee.long_name))\n") } // List all available codecs var opaque: UnsafeMutableRawPointer? = nil while let codec = av_codec_iterate(&opaque) { let name = String(cString: codec.pointee.name) let isDecoder = av_codec_is_decoder(codec) != 0 print("\(isDecoder ? "D" : "E"): \(name)\n") } } ``` -------------------------------- ### Add libmpv Dependency to Package.swift Source: https://context7.com/kingslay/ffmpegkit/llms.txt Specify the libmpv product as a dependency in your Package.swift file to include it in your project. ```swift // Package.swift .target( name: "MyPlayer", dependencies: [ .product(name: "libmpv", package: "FFmpegKit") ] ) ``` -------------------------------- ### Enabled Demuxers (Input Formats) Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the input formats supported by the default FFmpegKit build. These are the file types FFmpegKit can read. ```bash # Enabled Demuxers (Input Formats) aac, ac3, aiff, amr, ape, asf, ass, av1, avi, caf, concat, dash, data, dv, eac3, flac, flv, h264, hevc, hls, live_flv, loas, m4v, matroska (mkv/mka/mks), mov (mp4/m4a/3gp), mp3, mpeg*, ogg, rm, rtsp, rtp, srt, vc1, wav, webm_dash_manifest ``` -------------------------------- ### Import Specific FFmpeg Libraries in Package.swift Source: https://context7.com/kingslay/ffmpegkit/llms.txt Declare dependencies on individual FFmpeg products within your `Package.swift` file to import only the necessary libraries. ```swift // Package.swift - Import specific libraries .target( name: "MyVideoProcessor", dependencies: [ .product(name: "Libavcodec", package: "FFmpegKit"), .product(name: "Libavformat", package: "FFmpegKit"), .product(name: "Libavutil", package: "FFmpegKit"), .product(name: "Libswscale", package: "FFmpegKit"), .product(name: "Libswresample", package: "FFmpegKit"), ] ) ``` -------------------------------- ### Add libass Dependency to Package.swift Source: https://context7.com/kingslay/ffmpegkit/llms.txt Include the libass product in your Package.swift dependencies to enable subtitle rendering. ```swift // Package.swift .target( name: "MySubtitleRenderer", dependencies: [ .product(name: "libass", package: "FFmpegKit") ] ) ``` -------------------------------- ### Add FFmpegKit via Swift Package Manager Source: https://github.com/kingslay/ffmpegkit/blob/main/README.md Add FFmpegKit to your project using Swift Package Manager by specifying the repository URL and branch. ```swift dependencies: [ .package(url: "https://github.com/kingslay/FFmpegKit.git", .branch("main")) ] ``` -------------------------------- ### Enabled Encoders Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the video and audio codecs FFmpegKit can encode by default, including hardware-accelerated options for Apple platforms. ```bash # Enabled Encoders সাধারণ, alac, flac, pcm*, movtext, mpeg4, prores h264_videotoolbox, hevc_videotoolbox, prores_videotoolbox (Apple platforms) ``` -------------------------------- ### Enabled Audio Decoders Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the audio codecs FFmpegKit can decode by default. This indicates the range of audio formats that can be handled. ```bash # Enabled Audio Decoders সাধারণ, ac3*, adpcm*, alac*, amr*, ape, cook, dca, dolby_e, eac3*, flac, mp1-3*, opus, pcm*, sonic, truehd, tta, vorbis, wma*, wrapped_avframe ``` -------------------------------- ### Hardware-Accelerated Video Transcoding with VideoToolbox Source: https://context7.com/kingslay/ffmpegkit/llms.txt Use VideoToolbox for hardware-accelerated decoding and encoding on Apple platforms. This function transcodes a video file using HEVC_videotoolbox encoder. ```swift import Foundation // Hardware-accelerated video transcoding func transcodeWithHardwareAcceleration(input: String, output: String) { var arguments = [ "ffmpeg", "-hwaccel", "videotoolbox", // Use VideoToolbox for decoding "-i", input, "-c:v", "hevc_videotoolbox", // Use VideoToolbox HEVC encoder "-b:v", "5M", // Video bitrate "-c:a", "aac", // AAC audio codec "-b:a", "128k", // Audio bitrate output ] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffmpeg_execute(Int32(arguments.count), &argv) } ``` -------------------------------- ### Create ProRes File with VideoToolbox Encoder Source: https://context7.com/kingslay/ffmpegkit/llms.txt Encodes a video file into ProRes 422 HQ format using the prores_videotoolbox encoder on Apple platforms. It also uses uncompressed PCM audio. ```swift // Available VideoToolbox encoders (automatically enabled on Apple platforms) // H.264: h264_videotoolbox // HEVC: hevc_videotoolbox // ProRes: prores_videotoolbox // Example: Create ProRes file for editing func createProResFile(input: String, output: String) { var arguments = [ "ffmpeg", "-i", input, "-c:v", "prores_videotoolbox", "-profile:v", "3", // ProRes 422 HQ "-c:a", "pcm_s24le", // Uncompressed audio output ] var argv = arguments.map { UnsafeMutablePointer(mutating: ($0 as NSString).utf8String) } ffmpeg_execute(Int32(arguments.count), &argv) } ``` -------------------------------- ### Enabled Subtitle Decoders Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the subtitle formats FFmpegKit supports decoding in its default configuration. This covers various subtitle types for video. ```bash # Enabled Subtitle Decoders ass, ccaption, dvbsub, dvdsub, mpl2, movtext, pgssub, srt, ssa, subrip, xsub, webvtt ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/ios-arm64_x86_64-maccatalyst/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md These macros allow for the declaration, definition, and retrieval of flags that can customize FFmpegKit's behavior. ```APIDOC ## Flag Related Macros ### Description Macros for declaring, defining, and accessing flags to customize FFmpegKit behavior. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)`: Declares a boolean flag. * `GMOCK_DECLARE_int32_(name)`: Declares an int32 flag. * `GMOCK_DECLARE_string_(name)`: Declares a string flag. #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)`: Defines a boolean flag with a default value and documentation. * `GMOCK_DEFINE_int32_(name, default_val, doc)`: Defines an int32 flag with a default value and documentation. * `GMOCK_DEFINE_string_(name, default_val, doc)`: Defines a string flag with a default value and documentation. #### Access Macros * `GMOCK_FLAG_GET(flag_name)`: Retrieves the current value of a flag. * `GMOCK_FLAG_SET(flag_name, value)`: Sets the value of a flag. ``` -------------------------------- ### Enabled Video Decoders Source: https://context7.com/kingslay/ffmpegkit/llms.txt Lists the video codecs FFmpegKit can decode in its default build. This specifies the types of video streams that can be processed. ```bash # Enabled Video Decoders av1, dca, dxv, ffv1, ffvhuff, flv, h263, h263i, h263p, h264, hap, hevc, huffyuv, indeo5, mjpeg, mjpegb, mpeg*, mts2, prores, rv10-40, snow, svq3, tscc, tscc2, txd, wmv1-3, vc1, vp6, vp6a, vp6f, vp7, vp8, vp9 ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/tvos-arm64_x86_64-simulator/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md These macros allow for the declaration, definition, and retrieval of flags within the FFmpegKit environment. They provide a mechanism for customizing behavior by setting default values and accessing flag states. ```APIDOC ## Flag Related Macros ### Description Macros for declaring, defining, and getting/setting flag values. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)`: Declares a boolean flag. * `GMOCK_DECLARE_int32_(name)`: Declares an integer flag. * `GMOCK_DECLARE_string_(name)`: Declares a string flag. #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)`: Defines a boolean flag with a default value and documentation. * `GMOCK_DEFINE_int32_(name, default_val, doc)`: Defines an integer flag with a default value and documentation. * `GMOCK_DEFINE_string_(name, default_val, doc)`: Defines a string flag with a default value and documentation. #### Access Macros * `GMOCK_FLAG_GET(flag_name)`: Retrieves the current value of a flag. * `GMOCK_FLAG_SET(flag_name, value)`: Sets a new value for a flag. ``` -------------------------------- ### Flag Related Macros Source: https://github.com/kingslay/ffmpegkit/blob/main/Sources/libshaderc_combined.xcframework/tvos-arm64_arm64e/libshaderc_combined.framework/Headers/gmock/internal/custom/README.md These macros allow users to define, declare, and access custom flags for configuring FFmpegKit behavior. ```APIDOC ## Flag Related Macros ### Description Macros for declaring and defining boolean, integer, and string flags, as well as for getting and setting flag values. ### Macros #### Declaration Macros * `GMOCK_DECLARE_bool_(name)`: Declares a boolean flag. * `GMOCK_DECLARE_int32_(name)`: Declares an integer flag. * `GMOCK_DECLARE_string_(name)`: Declares a string flag. #### Definition Macros * `GMOCK_DEFINE_bool_(name, default_val, doc)`: Defines a boolean flag with a default value and documentation. * `GMOCK_DEFINE_int32_(name, default_val, doc)`: Defines an integer flag with a default value and documentation. * `GMOCK_DEFINE_string_(name, default_val, doc)`: Defines a string flag with a default value and documentation. #### Access Macros * `GMOCK_FLAG_GET(flag_name)`: Retrieves the current value of a flag. * `GMOCK_FLAG_SET(flag_name, value)`: Sets the value of a flag. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.