Skip to content

RDKDEV-1424 Add HDMICEC Documentation#60

Open
gourivarma3 wants to merge 1 commit into
rdkcentral:developfrom
gourivarma3:feature/RDKDEV-1424
Open

RDKDEV-1424 Add HDMICEC Documentation#60
gourivarma3 wants to merge 1 commit into
rdkcentral:developfrom
gourivarma3:feature/RDKDEV-1424

Conversation

@gourivarma3

Copy link
Copy Markdown

Added documentation for HDMI CEC library including features, design, and configuration.
I have read the CLA Document and I hereby sign the CLA

Add detailed documentation for HDMI CEC library including features, design, and configuration.
Copilot AI review requested due to automatic review settings June 8, 2026 12:49
@gourivarma3 gourivarma3 requested a review from a team as a code owner June 8, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a comprehensive top-level README documenting the HDMI CEC middleware library in the RDK stack, covering architecture, threading model, initialization/state flows, HAL integration, and runtime configuration.

Changes:

  • Introduces new README.md with detailed component overview, design notes, and module breakdown.
  • Adds multiple Mermaid diagrams for system positioning, internal architecture, and call flows.
  • Documents build/runtime dependencies and configuration (e.g., log level via /tmp/cec_log_enabled).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md

#### Initialization to Active State

The HDMI CEC library initialization begins when an application calls LibCCEC::getInstance() which creates the singleton instance and implicitly starts the Bus singleton. The Bus constructor automatically launches reader and writer threads that immediately begin running. The application then calls LibCCEC::init() to mark the library as initialized and optionally calls Bus::start() to open the driver. When the driver opens via DriverImpl::open(), it calls HdmiCecOpen() and registers receive and transmit callbacks. For source devices, the HAL performs logical address discovery during HdmiCecOpen(). The application creates Connection instances which register FrameListener objects with the Bus to begin receiving frames.
Comment thread README.md
Comment on lines +194 to +207
App->>LibCCEC: getInstance()
LibCEC->>LibCEC: Create singleton
LibCEC->>Bus: getInstance()
Bus->>Bus: Constructor
Bus->>Reader: Create and start thread
Bus->>Writer: Create and start thread
Note over Reader,Writer: Threads running, waiting for driver

App->>LibCCEC: init(name)
LibCCEC->>LibCCEC: Set initialized flag
LibCCEC-->>App: Initialized

App->>Bus: start()
Bus->>Driver: open()
Comment thread README.md
Comment on lines +353 to +357
Writer->>Writer: Dequeue frame
Writer->>Driver: writeAsync(frame)
Driver->>Driver: Lock mutex, check status
Driver->>HAL: HdmiCecTxAsync(handle, buf, len)
HAL-->>Driver: Queued status
Comment thread README.md

- **Worker Threads**:
- _Bus Reader Thread_: Continuously polls Driver.read() to receive incoming CEC frames. When a frame arrives, it locks the reader mutex and iterates through all registered FrameListener instances, invoking their notify() method synchronously. Owns the frame dispatch logic.
- _Bus Writer Thread_: Processes an EventQueue of outgoing CECFrame pointers. Dequeues frames, invokes Driver.write() or Driver.writeAsync(), and handles transmission errors. Uses condition variables for efficient waiting when the queue is empty.
Comment thread README.md

- **Build Dependencies**:
- virtual/vendor-hdmicec-hal: Vendor-specific HAL implementation that the library wraps. This is the primary interface to hardware and is directly called throughout DriverImpl.
- glib-2.0 (>= 0.10.28): Provides core data structures and utilities used across the library codebase.
Comment thread README.md

### Prerequisites & Dependencies

The HDMI CEC library is designed as a standalone middleware library with minimal external dependencies. It requires a vendor-specific HAL implementation to interface with hardware and uses glib for basic utilities. The library does not directly depend on IARM, Device Settings, or Thunder framework components - these are used by applications that consume the library, not by the library itself. Build-time dependencies are limited to essential libraries that are actually invoked in the library source code.
Comment thread README.md
Comment on lines +273 to +290
App->>LibCEC: getInstance()
Note over LibCEC: First call creates singleton
LibCEC->>Bus: getInstance()
Note over Bus: Constructor starts threads
LibCEC-->>App: libCCEC reference

App->>LibCEC: init("component")
LibCEC->>LibCEC: Check initialized flag
alt Not yet initialized
LibCEC->>LibCEC: Set initialized = true
LibCEC->>LibCEC: Set log prefix
end
LibCEC-->>App: Initialized

App->>Bus: start()
Bus->>Driver: getInstance()
Driver->>Driver: Create singleton
Bus->>Driver: open()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants