### Build and Install Tizonia from Source Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt This section details the steps to compile and install Tizonia from its source code using either autotools or meson build systems. It includes commands for installing build dependencies on Debian/Ubuntu, Python dependencies, cloning the repository, configuring, building, and installing the software. Finally, it shows how to verify the installation and run the test suite. ```bash # Install build dependencies (Debian/Ubuntu) sudo apt-get update sudo apt-get install -y \ build-essential autoconf automake libtool libmad0-dev \ liblog4c-dev libasound2-dev libdbus-1-dev libdbus-c++-dev \ libsqlite3-dev libboost-all-dev uuid-dev libsdl1.2-dev \ libvpx-dev libmp3lame-dev libfaad-dev libev-dev libtag1-dev \ libfishsound-dev libmediainfo-dev libcurl4-openssl-dev \ libpulse-dev libmpg123-dev libvorbis-dev libopus-dev \ libopusfile-dev libogg-dev libflac-dev liboggz2-dev \ libsndfile1-dev libwebm-dev libspotify-dev check libffi-dev \ python3-dev python3-pip # Install Python dependencies sudo pip3 install \ gmusicapi soundcloud youtube-dl pafy pycountry \ titlecase pychromecast plexapi spotipy fuzzywuzzy \ eventlet python-Levenshtein # Clone repository git clone https://github.com/tizonia/tizonia-openmax-il.git cd tizonia-openmax-il # Build with autotools autoreconf -ifs ./configure --prefix=/usr --sysconfdir=/etc make sudo make install sudo ldconfig # Or build with meson (alternative) meson setup builddir --prefix=/usr --sysconfdir=/etc meson compile -C builddir sudo meson install -C builddir # Verify installation tizonia --version OMX_Init_test # Test IL Core # Run test suite make check # List available components tizonia --help ``` -------------------------------- ### Install Ninja Build Backend Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING_with_meson.md Installs the Ninja build system, which is the recommended backend for Meson. This command is for Debian-based systems. ```shell sudo apt-get install ninja-build ``` -------------------------------- ### Install Tizonia OpenMAX IL Tags and Suites Source: https://github.com/tizonia/tizonia-openmax-il/wiki/Skema Installs all available tags and suites for Tizonia OpenMAX IL. This is a prerequisite for running suites. The installation can be done individually or all at once using a convenience script. ```bash # Example of installing a single tag ./skema install_tag OMX_ComponentNameEnum # Example of installing a single suite ./skema install_suite ComponentNameEnum # Script to re-install all suites and tags ./skema-reinstall-all ``` -------------------------------- ### Tizonia Spotify Search Examples Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/spotify.md These examples illustrate how to use Tizonia's command-line options to search and play music from Spotify. They demonstrate searching by artist, album, and public playlist, providing practical usage scenarios for the described options. ```bash $ tizonia --spotify-artist 'enya' $ tizonia --spotify-album 'the greatest showman' # Search and play a *public* playlist owned by the current user $ tizonia --spotify-playlist 'Summer 2019' ``` -------------------------------- ### Build and Install Debian Package for Tizonia Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md This command builds and installs a Debian package named 'tizonia-all-testing'. To remove the package, use 'dpkg -r tizonia-all-testing'. ```bash tizonia-dev-build --debian dpkg -r tizonia-all-testing ``` -------------------------------- ### Install bear for JSON Compilation Database Creation Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/development/BUILDING.md This command installs 'bear', a utility used to generate JSON compilation databases. These databases are essential for development tools like RTags to perform static analysis and provide IDE-like features for C/C++ code. ```default $ sudo apt-get install bear ``` -------------------------------- ### Install Tizonia with Ninja Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING_with_meson.md Installs Tizonia using Ninja after compilation. The DESTDIR variable can be used to specify an alternative installation root for staging or packaging. Similar to the build command, it uses verbose output and single-threaded execution. ```shell DESTDIR= /usr/bin/ninja install -v -j1 -C build ``` -------------------------------- ### Skema Help Command Source: https://github.com/tizonia/tizonia-openmax-il/wiki/Skema Example of running the 'skema help' command to display available Skema commands. This provides a list of functionalities such as listing suites, installing/uninstalling tags, and running tests. ```bash ./skema help Available commands: list_installed_suites list_installed_tags help list_suites uninstall_tag version install_suite run_suite list_tags uninstall_suite install_tag To access extended help on a command use 'skema help [command]' ``` -------------------------------- ### Tizonia Command-Line Examples for SoundCloud Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/soundcloud.md Demonstrates various command-line invocations for Tizonia to stream music from SoundCloud based on tracks, creators, genres, and playlists. ```bash $ tizonia --soundcloud-tracks 'all right now' $ tizonia --soundcloud-creator "twit" $ tizonia --soundcloud-genres "piano" $ tizonia --soundcloud-playlists "joe satriani by Jimmy Mendoza" ``` -------------------------------- ### Build Tizonia from AUR Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/overview/README.md Installs Tizonia from the Arch User Repository. Users must uninstall any existing Tizonia installation before building a new version. This method supports both the latest stable release and the HEAD of the master branch. ```bash # For the latest stable release git clone https://aur.archlinux.org/tizonia-all.git cd tizonia-all makepkg -si # There is also a -git package: git clone https://aur.archlinux.org/tizonia-all-git.git cd tizonia-all makepkg -si ``` -------------------------------- ### iHeart Station Search Examples (Bash) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/iheart.md These examples demonstrate how to use the Tizonia command-line interface to search for iHeart radio stations. The `--iheart-search` option is used with various search terms, and an optional `--iheart-keywords` argument can refine the search. ```bash $ tizonia --iheart-search "top 40" $ tizonia --iheart-search "kiss" $ tizonia --iheart-search "ny" $ tizonia --iheart-search "albuquerque" $ tizonia --iheart-search "90s" $ tizonia --iheart-search "rock" --iheart-keywords 'The Rocket' ``` -------------------------------- ### Configure and Use Tizonia Docker Wrapper Script Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/docker.md Instructions to set up and use the `docker-tizonia` wrapper script. This involves changing permissions for the Tizonia configuration directory, installing the script to your system's PATH, and then running Tizonia commands through the script. ```bash # Change Tizonia's config dir permissions $ chmod a+wrx $HOME/.config/tizonia # Install the wrapper script in a location in your PATH $ sudo install docker-tizonia /usr/local/bin # Pass the usual Tizonia commands to the wrapper $ docker-tizonia --youtube-audio-mix-search "Queen Official" ``` -------------------------------- ### Build and Install Release Variant of Tizonia (Bash) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/overview/BUILDING.md Re-configures Tizonia sub-projects with release flags, then builds and installs them. This is the recommended variant for general use after dependencies are met and environment variables are set. ```bash $ tizonia-dev-build --release --install ``` -------------------------------- ### Install Meson Build System Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING_with_meson.md Installs or upgrades the Meson build system to version 0.53.0 or later using pip3. Meson is a prerequisite for building Tizonia from source. ```shell sudo -H pip3 install meson --upgrade ``` -------------------------------- ### Install ccache for Faster Recompilation Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/development/BUILDING.md This command installs ccache, a compiler cache that significantly speeds up recompilation times by storing previous build artifacts. It is particularly useful during development with projects like Tizonia. ```default $ sudo apt-get install ccache ``` -------------------------------- ### Install bear on Debian Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md Installs the 'bear' utility on Debian-based systems. Bear is used to generate JSON compilation databases, which are utilized by various development tools for tasks such as static code analysis and providing IDE integrations. ```bash sudo apt-get install bear ``` -------------------------------- ### Configure Tizonia Settings Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/README.md This snippet shows how to locate and edit the Tizonia configuration file. It specifies the default path and an alternative path for Snap installations. No credentials are required for YouTube or TuneIn streaming. ```bash # On first use, Tizonia outputs its configuration file, if it is not there yet $ tizonia --help # now edit $HOME/.config/tizonia/tizonia.conf # NOTE: If Tizonia was installed from the 'snap' package, use this path instead # $HOME/snap/tizonia/current/.config/tizonia/tizonia.conf ``` -------------------------------- ### Skema XML Test Suite Example Source: https://github.com/tizonia/tizonia-openmax-il/wiki/Skema An example of a Skema XML script defining a test suite for MP3 playback. It demonstrates the structure for initializing and deinitializing OpenMAX IL components, handling component instances, and managing resources. ```xml ``` -------------------------------- ### iHeart Configuration Example (Bash) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/iheart.md This snippet shows an example of the Tizonia configuration file for the iHeart integration. It includes a commented-out setting for 'iheart.buffer_seconds', which controls the audio buffer size in seconds during stream downloads. The default value is 120 seconds. ```bash # iHeart configuration # ------------------------------------------------------------------------- # To avoid passing this information on the command line, uncomment and # configure here. # # # iheart.buffer_seconds = size of the audio buffer (in seconds) to use # while downloading streams. Default: 120. # Increase in case of cuts. ``` -------------------------------- ### Search Local TuneIn Stations with Keywords Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/tunein.md Example of searching for local TuneIn stations, specifying the station type, and adding a keyword to filter results. ```bash $ tizonia --tunein-local "Cambridge" --tunein-type "stations" --tunein-keywords "BBC" ``` -------------------------------- ### Set Up Tizonia Configuration File Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md This command sequence creates the necessary directory and copies the 'tizonia.conf' configuration file to the user's configuration folder. This file is essential for configuring Tizonia's behavior. ```bash mkdir -p $HOME/.config/tizonia \ && cp $TIZONIA_REPO_DIR/config/src/tizonia.conf $HOME/.config/tizonia ``` -------------------------------- ### Install Tizonia Snap Package Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/overview/README.md Installs Tizonia using the Snap package manager. This method requires Snapd to be installed and configured on your system. It provides a convenient way to install Tizonia across various Linux distributions. ```bash sudo snap install tizonia ``` -------------------------------- ### Install Tizonia on Debian/Ubuntu/Raspbian Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/overview/README.md Installs the latest stable release of Tizonia and its dependencies on Debian-compatible systems. It is recommended to review the script before execution. This method is suitable for Ubuntu, Debian, and Raspbian distributions. ```bash curl -kL https://github.com/tizonia/tizonia-openmax-il/raw/master/tools/install.sh | bash # Or its shortened version: curl -kL https://goo.gl/Vu8qGR | bash ``` -------------------------------- ### Tizonia PulseAudio Configuration for Mac Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/docker.md This snippet outlines the necessary steps to configure PulseAudio for Tizonia on macOS. It includes installing PulseAudio via Homebrew, uncommenting specific module lines in the default.pa configuration file, and starting the PulseAudio daemon. ```bash # Step 1) Install PulseAudio and configure default.pa # brew install pulseaudio # Uncomment the following lines in /usr/local/Cellar/pulseaudio/13.0/etc/pulse/default.pa: # load-module module-esound-protocol-tcp # load-module module-native-protocol-tcp # Step 2) Set default sink pactl list short sinks pacmd set-default-sink n # replace 'n' with the chosen output number # Step 3) Start Pulseaudio daemon pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon ``` -------------------------------- ### Set up Audio Processing Pipeline with Component Tunneling in C Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt Demonstrates how to set up an audio processing pipeline by creating tunneled connections between OpenMAX IL components. Tunneling enables zero-copy buffer passing, improving efficiency. This requires the `` header and involves getting handles for source, decoder, and renderer components, setting up tunnels between them, and transitioning their states to Idle and then Executing. Error handling is included for cleanup. ```c #include OMX_ERRORTYPE setup_audio_pipeline(void) { OMX_ERRORTYPE error; OMX_HANDLETYPE http_source = NULL; OMX_HANDLETYPE mp3_decoder = NULL; OMX_HANDLETYPE pcm_renderer = NULL; OMX_CALLBACKTYPE callbacks = { .EventHandler = event_handler, .EmptyBufferDone = empty_buffer_done, .FillBufferDone = fill_buffer_done }; // Initialize Core error = OMX_Init(); if (error != OMX_ErrorNone) return error; // Get component handles error = OMX_GetHandle(&http_source, "OMX.Aratelia.audio_source.http", NULL, &callbacks); if (error != OMX_ErrorNone) goto cleanup; error = OMX_GetHandle(&mp3_decoder, "OMX.Aratelia.audio_decoder.mp3", NULL, &callbacks); if (error != OMX_ErrorNone) goto cleanup; error = OMX_GetHandle(&pcm_renderer, "OMX.Aratelia.audio_renderer.alsa.pcm", NULL, &callbacks); if (error != OMX_ErrorNone) goto cleanup; // Create tunnels: http_source:0 -> mp3_decoder:0 error = OMX_SetupTunnel(http_source, 0, mp3_decoder, 0); if (error != OMX_ErrorNone) { fprintf(stderr, "Failed to setup tunnel source->decoder: 0x%08x\n", error); goto cleanup; } // Create tunnel: mp3_decoder:1 -> pcm_renderer:0 error = OMX_SetupTunnel(mp3_decoder, 1, pcm_renderer, 0); if (error != OMX_ErrorNone) { fprintf(stderr, "Failed to setup tunnel decoder->renderer: 0x%08x\n", error); goto cleanup; } // Transition components to Idle state error = OMX_SendCommand(http_source, OMX_CommandStateSet, OMX_StateIdle, NULL); error = OMX_SendCommand(mp3_decoder, OMX_CommandStateSet, OMX_StateIdle, NULL); error = OMX_SendCommand(pcm_renderer, OMX_CommandStateSet, OMX_StateIdle, NULL); // Transition to Executing state error = OMX_SendCommand(http_source, OMX_CommandStateSet, OMX_StateExecuting, NULL); error = OMX_SendCommand(mp3_decoder, OMX_CommandStateSet, OMX_StateExecuting, NULL); error = OMX_SendCommand(pcm_renderer, OMX_CommandStateSet, OMX_StateExecuting, NULL); return OMX_ErrorNone; cleanup: if (pcm_renderer) OMX_FreeHandle(pcm_renderer); if (mp3_decoder) OMX_FreeHandle(mp3_decoder); if (http_source) OMX_FreeHandle(http_source); OMX_Deinit(); return error; } ``` -------------------------------- ### Control Tizonia via MPRIS D-Bus Interface Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt Remotely manage Tizonia's playback using the MPRIS v2 D-Bus interface, enabling integration with desktop environments and remote control applications. Ensure MPRIS is enabled in `tizonia.conf` (`mpris-enabled = true`). This example shows how to send commands like Play/Pause and Next track to Tizonia using `dbus-send` after starting the player in the background. ```bash # Enable MPRIS in tizonia.conf # mpris-enabled = true # Start Tizonia player tizonia --spotify-playlist "My Playlist" & # Control via dbus-send # Play/Pause dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tizonia \ /org/mpris/MediaPlayer2 \ org.mpris.MediaPlayer2.Player.PlayPause # Next track dbus-send --print-reply --dest=org.mpris.MediaPlayer2.tizonia \ /org/mpris/MediaPlayer2 \ org.mpris.MediaPlayer2.Player.Next ``` -------------------------------- ### List Tizonia Help Topics (Bash) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/manual/helptopics.md This command lists all available help topics for Tizonia. It provides an overview of the different categories of options and functionalities supported by the tool, such as global options, specific service integrations (Spotify, YouTube, etc.), and configuration details. ```bash $ tizonia --help ``` -------------------------------- ### Install Tizonia Development Dependencies (Debian) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING_with_meson.md Installs all necessary development dependencies for Tizonia using the tizonia-dev-build script. This script handles Python packages and system libraries. Environment variables for repository and installation directories, as well as PYTHONPATH, must be set beforehand. ```shell # Setup the following environment variables $ export TIZONIA_REPO_DIR=/path/to/tizonia/repo # (e.g. /home/user/tizonia-openmax-il) $ export TIZONIA_INSTALL_DIR=/path/to/install/dir # (e.g. /usr or /home/user/temp) $ export PATH=$TIZONIA_REPO_DIR/tools:$PATH # Set the PYTHONPATH accordingly (replace X to match the python version on your system) $ export PYTHONPATH=$TIZONIA_INSTALL_DIR/lib/python3.X/site-packages:$PYTHONPATH # Now install everything that is required to build Tizonia from source (Debian derivative assumed) $ tizonia-dev-build --deps ``` -------------------------------- ### MP3 Playback Configuration and Execution (Skema XML) Source: https://github.com/tizonia/tizonia-openmax-il/wiki/Mp3playback101 This Skema XML defines a test case for MP3 playback. It initializes OMX components, configures parameters for audio rendering and decoding, sets the input URI, establishes tunnels between components, and transitions them through Idle and Executing states. ```xml ``` -------------------------------- ### Create JSON Compilation Database with Tizonia Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/development/BUILDING.md These commands initiate the creation of a JSON compilation database using 'tizonia-dev-build' and 'bear'. The first command builds the project (debug or release), and the second command generates the database. This database aids static analysis tools. ```default $ tizonia-dev-build --debug (or --release) # followed by $ tizonia-dev-build --bear ``` -------------------------------- ### Configure Documentation Options (Array and Combo) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/meson_options.txt These options control the generation of project documentation. 'docs_options' is an array that specifies which documentation formats to build, supporting a wide range of types. 'docs_paper' is a combo option to select the paper size for printed documentation. ```text option('docs_options', type: 'array', description: 'which documentation to build', choices: [ 'html', 'dirhtml', 'singlehtml', 'pickle', 'json', 'htmlhelp', 'qthelp', 'devhelp', 'epub', 'latex', 'latexpdf', 'text', 'man', 'texinfo', 'info', 'gettext', 'changes', 'linkcheck' ], value: ['man', 'html'] ) option('docs_paper', type: 'combo', choices: ['a4', 'legal'], value: 'a4') ``` -------------------------------- ### Build and Install Debug Variant of Tizonia (Bash) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/docs/sphinx-src/overview/BUILDING.md Re-configures Tizonia sub-projects with debug flags and then builds and installs them. This command is used after dependencies are met and environment variables are set. ```bash $ tizonia-dev-build --debug --install ``` -------------------------------- ### Install ccache on Debian Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md Installs the ccache compiler cache utility on Debian-based systems. ccache speeds up recompilations by caching previous compilations, which is particularly useful for projects with complex build processes like Tizonia. ```bash sudo apt-get install ccache ``` -------------------------------- ### Set Up D-BUS Service Activation for Resource Manager Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md This command copies the D-BUS service activation file for the OpenMAX IL Resource Manager. This is an optional step required for OpenMAX IL 1.2 compliance testing and enables the Resource Management feature. ```bash mkdir -p ~/.local/share/dbus-1/services \ && cp rm/tizrmd/dbus/com.aratelia.tiz.rm.service ~/.local/share/dbus-1/services ``` -------------------------------- ### Initialize OpenMAX IL Core System in C Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt Initializes the OpenMAX IL Core system, which is necessary before using any components. This function discovers and loads available plugin components from configured paths. It requires the `` and `` headers. The function returns an OMX_ERRORTYPE, indicating success or failure. ```c #include #include int main(void) { OMX_ERRORTYPE error; OMX_HANDLETYPE handle = NULL; OMX_CALLBACKTYPE callbacks; // Initialize the IL Core error = OMX_Init(); if (error != OMX_ErrorNone) { fprintf(stderr, "Failed to initialize OMX IL Core: 0x%08x\n", error); return 1; } // Set up callbacks callbacks.EventHandler = event_handler_callback; callbacks.EmptyBufferDone = empty_buffer_done_callback; callbacks.FillBufferDone = fill_buffer_done_callback; // Get a component handle error = OMX_GetHandle(&handle, "OMX.Aratelia.audio_decoder.mp3", (OMX_PTR)&app_data, &callbacks); if (error != OMX_ErrorNone) { fprintf(stderr, "Failed to get component handle: 0x%08x\n", error); OMX_Deinit(); return 1; } // Use the component... // Clean up OMX_FreeHandle(handle); OMX_Deinit(); return 0; } ``` -------------------------------- ### Initialize HTTP Parser and Settings (C) Source: https://github.com/tizonia/tizonia-openmax-il/blob/master/libtizplatform/src/http-parser/README.md Demonstrates how to initialize the http_parser structure and its associated settings, including defining callback functions for various parsing events. This is the initial setup required before processing any HTTP data. ```c http_parser_settings settings; settings.on_url = my_url_callback; settings.on_header_field = my_header_field_callback; /* ... more callbacks */ http_parser *parser = malloc(sizeof(http_parser)); http_parser_init(parser, HTTP_REQUEST); parser->data = my_socket; ``` -------------------------------- ### Stream Music via Tizonia Command Line Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt Control music playback from various online and local sources using Tizonia's command-line interface. Supports Spotify tracks and playlists, Google Play Music searches by artist, album, or playlist, YouTube audio streams, SoundCloud user streams and specific creators, TuneIn radio, and local audio files. Options for casting to Chromecast, running as an experimental HTTP/ICEcast server, shuffling, and daemon mode are also available. ```bash # Play Spotify track by URI tizonia --spotify-track "spotify:track:5ChkMS8OtdzJeqyybCc9R5" # Play Spotify playlist tizonia --spotify-playlist "Discover Weekly" # Search and play from Google Play Music tizonia --gmusic-artist "Miles Davis" tizonia --gmusic-album "Kind of Blue" tizonia --gmusic-playlist "Jazz Classics" # Stream from YouTube tizonia --youtube-audio-search "pink floyd comfortably numb" tizonia --youtube-audio-playlist "https://www.youtube.com/playlist?list=PLxxx" # Play from SoundCloud tizonia --soundcloud-user-stream tizonia --soundcloud-creator "artist-name" # TuneIn internet radio tizonia --tunein-search "jazz" tizonia --tunein-category "local" # Play local files tizonia /path/to/music/*.mp3 tizonia --recurse /path/to/music/directory/ # Stream to Chromecast tizonia --cast "Living Room" --youtube-audio-search "beethoven symphony 9" # Act as HTTP/ICEcast server (experimental) tizonia --server --port 8010 /path/to/music/*.mp3 # Shuffle and repeat options tizonia --shuffle --daemon /path/to/playlist.m3u ``` -------------------------------- ### Configure HTTP Streaming Source (C) Source: https://context7.com/tizonia/tizonia-openmax-il/llms.txt Sets up an HTTP source component to stream audio from a given URL. It configures the content URI and enables ICEcast metadata extraction using Tizonia extensions. Requires OpenMAX IL and Tizonia extension headers. ```c #include #include #include OMX_ERRORTYPE setup_http_source(OMX_HANDLETYPE handle, const char *url) { OMX_ERRORTYPE error; OMX_PARAM_CONTENTURITYPE *content_uri; // Allocate and configure content URI parameter content_uri = (OMX_PARAM_CONTENTURITYPE *)malloc( sizeof(OMX_PARAM_CONTENTURITYPE) + strlen(url) + 1); content_uri->nSize = sizeof(OMX_PARAM_CONTENTURITYPE) + strlen(url) + 1; content_uri->nVersion.nVersion = OMX_VERSION; strcpy((char *)content_uri->contentURI, url); // Set the content URI on the HTTP source component error = OMX_SetParameter(handle, OMX_IndexParamContentURI, content_uri); free(content_uri); if (error != OMX_ErrorNone) { fprintf(stderr, "Failed to set content URI: 0x%08x\n", error); return error; } // Configure ICEcast/SHOUTcast metadata extraction (Tizonia extension) OMX_TIZONIA_AUDIO_PARAM_HTTPSOURCETYPE http_config; http_config.nSize = sizeof(OMX_TIZONIA_AUDIO_PARAM_HTTPSOURCETYPE); http_config.nVersion.nVersion = OMX_VERSION; http_config.nPortIndex = 0; // Get current config error = OMX_GetParameter(handle, OMX_TizoniaIndexParamAudioHttp, &http_config); if (error != OMX_ErrorNone) { return error; } // Enable ICEcast metadata http_config.bEnableIcyMetadata = OMX_TRUE; http_config.nProbeStreamMs = 10000; // 10 seconds probe time // Apply configuration error = OMX_SetParameter(handle, OMX_TizoniaIndexParamAudioHttp, &http_config); return error; } int main(void) { OMX_ERRORTYPE error; OMX_HANDLETYPE http_source; OMX_CALLBACKTYPE callbacks = { .EventHandler = event_handler, .EmptyBufferDone = NULL, .FillBufferDone = fill_buffer_done }; error = OMX_Init(); if (error != OMX_ErrorNone) return 1; error = OMX_GetHandle(&http_source, "OMX.Aratelia.audio_source.http", NULL, &callbacks); if (error != OMX_ErrorNone) { OMX_Deinit(); return 1; } // Configure HTTP source to stream internet radio const char *radio_url = "http://stream.example.com:8000/jazz.mp3"; error = setup_http_source(http_source, radio_url); if (error == OMX_ErrorNone) { printf("HTTP source configured successfully\n"); // Continue with pipeline setup... } OMX_FreeHandle(http_source); OMX_Deinit(); return 0; } ```