drivers/media/test-drivers/vidtv/vidtv_mux.h
Source file repositories/reference/linux-study-clean/drivers/media/test-drivers/vidtv/vidtv_mux.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/test-drivers/vidtv/vidtv_mux.h- Extension
.h- Size
- 5638 bytes
- Lines
- 183
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hashtable.hlinux/types.hlinux/workqueue.hmedia/dvb_frontend.hvidtv_psi.h
Detected Declarations
struct vidtv_mux_timingstruct vidtv_mux_sistruct vidtv_mux_pid_ctxstruct vidtv_muxstruct vidtv_mux_init_args
Annotated Snippet
struct vidtv_mux_timing {
u64 start_jiffies;
u64 current_jiffies;
u64 past_jiffies;
u64 clk;
u64 pcr_period_usecs;
u64 si_period_usecs;
};
/**
* struct vidtv_mux_si - Store the PSI context.
*
* This is used to store the PAT, PMT sections and SDT in use by the muxer.
*
* The muxer acquire these by looking into the hardcoded channels in
* vidtv_channel and then periodically sends the TS packets for them>
*
* @pat: The PAT in use by the muxer.
* @pmt_secs: The PMT sections in use by the muxer. One for each program in the PAT.
* @sdt: The SDT in use by the muxer.
* @nit: The NIT in use by the muxer.
* @eit: the EIT in use by the muxer.
*/
struct vidtv_mux_si {
/* the SI tables */
struct vidtv_psi_table_pat *pat;
struct vidtv_psi_table_pmt **pmt_secs; /* the PMT sections */
struct vidtv_psi_table_sdt *sdt;
struct vidtv_psi_table_nit *nit;
struct vidtv_psi_table_eit *eit;
};
/**
* struct vidtv_mux_pid_ctx - Store the context for a given TS PID.
* @pid: The TS PID.
* @cc: The continuity counter for this PID. It is incremented on every TS
* pack and it will wrap around at 0xf0. If the decoder notices a sudden jump in
* this counter this will trigger a discontinuity state.
* @h: This is embedded in a hash table, mapping pid -> vidtv_mux_pid_ctx
*/
struct vidtv_mux_pid_ctx {
u16 pid;
u8 cc; /* continuity counter */
struct hlist_node h;
};
/**
* struct vidtv_mux - A muxer abstraction loosely based in libavcodec/mpegtsenc.c
* @fe: The frontend structure allocated by the muxer.
* @dev: pointer to struct device.
* @timing: Keeps track of timing related information.
* @mux_rate_kbytes_sec: The bit rate for the TS, in kbytes.
* @pid_ctx: A hash table to keep track of per-PID metadata.
* @on_new_packets_available_cb: A callback to inform of new TS packets ready.
* @mux_buf: A pointer to a buffer for this muxer. TS packets are stored there
* and then passed on to the bridge driver.
* @mux_buf_sz: The size for 'mux_buf'.
* @mux_buf_offset: The current offset into 'mux_buf'.
* @channels: The channels associated with this muxer.
* @si: Keeps track of the PSI context.
* @num_streamed_pcr: Number of PCR packets streamed.
* @num_streamed_si: The number of PSI packets streamed.
* @mpeg_thread: Thread responsible for the muxer loop.
* @streaming: whether 'mpeg_thread' is running.
* @pcr_pid: The TS PID used for the PSI packets. All channels will share the
* same PCR.
* @transport_stream_id: The transport stream ID
* @network_id: The network ID
* @network_name: The network name
* @priv: Private data.
*/
struct vidtv_mux {
struct dvb_frontend *fe;
struct device *dev;
struct vidtv_mux_timing timing;
u32 mux_rate_kbytes_sec;
DECLARE_HASHTABLE(pid_ctx, 3);
void (*on_new_packets_available_cb)(void *priv, u8 *buf, u32 npackets);
u8 *mux_buf;
u32 mux_buf_sz;
u32 mux_buf_offset;
struct vidtv_channel *channels;
Annotation
- Immediate include surface: `linux/hashtable.h`, `linux/types.h`, `linux/workqueue.h`, `media/dvb_frontend.h`, `vidtv_psi.h`.
- Detected declarations: `struct vidtv_mux_timing`, `struct vidtv_mux_si`, `struct vidtv_mux_pid_ctx`, `struct vidtv_mux`, `struct vidtv_mux_init_args`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.