All Projects → Smithay → drm-rs

Smithay / drm-rs

Licence: MIT license
A low-level abstraction of the Direct Rendering Manager API

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to drm-rs

OpenOS-DRM
OpenOS-DRM
Stars: ✭ 19 (-68.33%)
Mutual labels:  drm
lucurious
😱 Lucurious -> [Library] for building advanced DRM/KMS Vulkan Renderers 😱
Stars: ✭ 18 (-70%)
Mutual labels:  drm
ReferenceApplication
No description or website provided.
Stars: ✭ 63 (+5%)
Mutual labels:  drm
SimpleLicensing
A Go Based Licensing System for Digital Rights Management
Stars: ✭ 96 (+60%)
Mutual labels:  drm
Shaka Player
JavaScript player library / DASH & HLS client / MSE-EME player
Stars: ✭ 5,386 (+8876.67%)
Mutual labels:  drm
Dash.js
A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
Stars: ✭ 4,160 (+6833.33%)
Mutual labels:  drm
knock
Convert ACSM files to DRM-free EPUB files with one command on Linux
Stars: ✭ 263 (+338.33%)
Mutual labels:  drm
kaltura-player-android
Kaltura Player is a rich, easy to integrate and easy to use video player for all media types and ad scenarios you need. - based on Google ExoPlayer
Stars: ✭ 22 (-63.33%)
Mutual labels:  drm
hookey
Enables all the DLCs. Like Creamapi but just for linux and a subset of Paradox games.
Stars: ✭ 87 (+45%)
Mutual labels:  drm
speke-reference-server
Secure Packager and Encoder Key Exchange (SPEKE) is part of the AWS Elemental content encryption protection strategy for media services customers. SPEKE defines the standard for communication between our media services and digital rights management (DRM) system key servers. This project provides the basic framework that partners can specialize a…
Stars: ✭ 91 (+51.67%)
Mutual labels:  drm
electron-releases
castLabs Electron for Content Security
Stars: ✭ 173 (+188.33%)
Mutual labels:  drm
eglfs
🚀 EGL fullscreen platform plugin
Stars: ✭ 21 (-65%)
Mutual labels:  drm
LightweightQtDRMStreamViewer
A lightweight as possible DRM stream viewer based on the Qt Web Engine
Stars: ✭ 15 (-75%)
Mutual labels:  drm
shaka-player-react
A simple React component wrapper for shaka-player
Stars: ✭ 79 (+31.67%)
Mutual labels:  drm
kaltura-device-info-android
Kaltura Device Info
Stars: ✭ 26 (-56.67%)
Mutual labels:  drm

drm-rs

Crates.io docs.rs Build Status

A safe interface to the Direct Rendering Manager.

Direct Rendering Manager

The Direct Rendering Manager is a subsystem found on multiple Unix-based operating systems that provides a userspace API to graphics hardware. See the Wikipedia article for more details.

Usage

Basic

The DRM is accessed using ioctls on a file representing a graphics card. These can normally be found in /dev/dri, but can also be opened in other ways (ex. udev).

This crate does not provide a method of opening these files. Instead, the user program must provide a way to access the file descriptor representing the device through the AsRawFd trait. Here is a basic example using File as a backend:

/// A simple wrapper for a device node.
pub struct Card(std::fs::File);

/// Implementing [`AsFd`] is a prerequisite to implementing the traits found
/// in this crate. Here, we are just calling [`File::as_fd()`] on the inner
/// [`File`].
impl AsFd for Card {
    fn as_fd(&self) -> BorrowedFd<'_> {
        self.0.as_fd()
    }
}

/// Simple helper methods for opening a `Card`.
impl Card {
    pub fn open(path: &str) -> Self {
        let mut options = std::fs::OpenOptions::new();
        options.read(true);
        options.write(true);
        Card(options.open(path).unwrap())
    }
}

Finally, you can implement drm::Device to gain access to the basic DRM functionality:

impl drm::Device for Card {}

fn main() {
    let gpu = Card::open("/dev/dri/card0");
    println!("{:#?}", gpu.get_driver().unwrap());
}

Control (modesetting)

See drm::control::Device as well as our mode-setting examples: atomic_modeset and legacy_modeset

Rendering

Rendering is done by creating and attaching framebuffers to crtcs.

A framebuffer is created from anything implementing Buffer like the always available, but very limited, DumbBuffer.

For faster hardware-backed buffers, checkout gbm.rs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].