Baidu Live SDK Engineering Transformation: Architecture Refactoring and Access Efficiency Optimization
Baidu Live revamped its SDK by adopting the EasyBox toolchain, modularizing business code into multi‑repo components, enabling fine‑grained compile‑time differentiation, and launching visual packaging, source‑code debugging, and protocol‑optimizing tools, which together cut project complexity, accelerated development, and automated host SDK access.
Baidu Live positioned itself as a live streaming SDK to empower internal Baidu apps. As business scale and code volume grew rapidly, the original project structure hindered fast development, and host access processes suffered from customization difficulties, lengthy configuration debugging, and numerous required protocols, limiting external SDK output.
The challenges fell into two categories: engineering‑layer issues (native project structure reducing development efficiency, severe business‑code coupling, and host‑bound feature macros complicating differentiated SDK output) and access‑process‑layer issues (customization difficulty, time‑consuming configuration debugging, and protocol proliferation).
To avoid impacting business iteration and scale expansion, the Live team carried out a targeted, stepwise transformation to achieve a flexible, platform‑oriented SDK output.
The engineering‑layer transformation proceeded in three steps: (1) integrating the EasyBox toolchain, (2) performing business‑dimension componentization and multi‑repository splitting, and (3) completing SDK differentiation output capabilities on the foundation of the first two steps, thereby realizing an overall architecture reconstruction and migration.
Initially, the Live project relied on Xcode native projects with multi‑project nested linking. Using the self‑developed EasyBox toolchain, the team performed a standardized template‑based transformation: first shelling the liveBoxAPP project to provide a compilation and runtime environment, then applying standard layering to the original business project and redefining the logical hierarchy into shell project, MixTure build layer (controlling SDK differentiation builds via EasyBox variant support and link_dependency‑based free SDK combination), business layer (Live core business), basic library layer, and host‑platform/third‑party dependency layer.
After this refactoring, project dependencies became clearer and EasyBox layering prevented dependency fragmentation. However, the business repository still exhibited severe coupling and lack of permission isolation, prompting a multi‑repo, multi‑component template split.
The multi‑repo split addressed business‑repository problems by: sinking common capabilities into a service‑layer repository, extracting a core live container repository that provides essential Live room capabilities, creating a generic component plugin pool for Live‑room functions, and splitting Business‑layer repository components along template dimensions so that each business template owns its specific in‑room components and plugins.
To satisfy diverse host customization needs, Live introduced a compile‑time injection mechanism for fine‑grained component differentiation. Although EasyBox supports variant‑ and link_dependency‑based differentiation, it is unsuitable for small‑grained Live‑room component trimming. Each Live component includes a register module that distributes Live core Module Events; at appropriate timing, the component’s service is registered to Pyramid via an impl‑interface separation pattern, ensuring compile‑time isolation of differentiated components while forbidding horizontal dependencies—impl components may depend only on their corresponding interfaces.
With these measures, Live achieved flexible, differentiated assembly and building of its functional small components.
To further improve access efficiency, Live developed auxiliary tools after completing the engineering‑layer refactor.
First, a visualized packaging platform was built to counter high access costs caused by complex, optional SDK features and numerous upstream/downstream dependencies. Hosts apply for SDK access, fill in required information, select functions from Live‑provided feature lists, and after approval trigger the corresponding SDK build, quickly obtaining the SDK artifact and enabling automated, standardized access per Live’s access documentation.
Second, Live created a source‑code‑debugging plugin based on EasyBox to simplify host‑side debugging. Instead of manually importing all Live repositories and configuring intricate settings, developers can one‑click configure Live source‑code debugging to the host; the plugin was extended with EasyBox binary source‑code mapping capabilities to provide fine‑grained component‑level mapping for easier troubleshooting.
Third, Live optimized access protocols by offering a set of small‑component binaries that implement generic protocols. Hosts can freely select and import the binaries they need, reducing per‑protocol integration costs.
The combined transformation yielded clear benefits: project complexity dropped via EasyBox and mgit, lowering development costs for Live business teams; the differentiation‑build design allowed vertical product customization without invading Live core business, enabling flexible, freely‑combinable components; the automated access platform greatly reduced communication overhead and realized SDK access automation and standardization; and the EasyBox source‑code‑debugging plugin facilitated rapid troubleshooting for integration engineers.
In summary, Live’s engineering evolution stands on the factory‑internal EasyBox toolchain, incorporates Live‑specific requirements, and has matured into Live’s own engineering development mode. Whether through architectural refactoring or access‑efficiency optimization, the ultimate goal is to raise development efficiency and support rapid product iteration.
Baidu Geek Talk
Follow us to discover more Baidu tech insights.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.