Skip to content

Commit

Permalink
docs: add info about pipewire stream example
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedAhkam committed Nov 18, 2024
1 parent 69e0786 commit 55b8fa9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ pub async fn run() -> ashpd::Result<()> {
}
```

Open a Screencast stream and connect using [pipewire-rs](https://gitlab.freedesktop.org/pipewire/pipewire-rs/)

```bash
$ cargo run --example screen_cast_pw
```

The source can be read [here](examples/screen_cast_pw.rs).

## Optional features

| Feature | Description | Default |
Expand Down
13 changes: 13 additions & 0 deletions src/desktop/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
//! Ok(())
//! }
//! ```
//! An example on how to connect with Pipewire can be found [here](https://github.com/bilelmoussaoui/ashpd/blob/master/examples/screen_cast_pw.rs).
//! Although the example's primary focus is screen casting, stream connection logic remains the same -- with one accessibility change:
//! ```rust,no_run
//! let stream = pw::stream::Stream::new(

Check failure on line 22 in src/desktop/camera.rs

View workflow job for this annotation

GitHub Actions / Test Suite

failed to resolve: use of undeclared crate or module `pw`
//! &core,

Check failure on line 23 in src/desktop/camera.rs

View workflow job for this annotation

GitHub Actions / Test Suite

expected value, found crate `core`
//! "video-test",
//! properties! {

Check failure on line 25 in src/desktop/camera.rs

View workflow job for this annotation

GitHub Actions / Test Suite

cannot find macro `properties` in this scope
//! *pw::keys::MEDIA_TYPE => "Video",
//! *pw::keys::MEDIA_CATEGORY => "Capture",
//! *pw::keys::MEDIA_ROLE => "Screen", // <-- make this 'Camera'
//! },
//! )?;
//! ```

use std::{collections::HashMap, os::fd::OwnedFd};

Expand Down
1 change: 1 addition & 0 deletions src/desktop/screencast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
//! Ok(())
//! }
//! ```
//! An example on how to connect with Pipewire can be found [here](https://github.com/bilelmoussaoui/ashpd/blob/master/examples/screen_cast_pw.rs).

use std::{collections::HashMap, fmt::Debug, os::fd::OwnedFd};

Expand Down

0 comments on commit 55b8fa9

Please sign in to comment.