Skip to content

Commit

Permalink
Move streaming code to common.
Browse files Browse the repository at this point in the history
  • Loading branch information
uglyoldbob committed Jan 31, 2024
1 parent f27a84c commit 0aeb090
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 476 deletions.
1 change: 1 addition & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub mod recording;
pub mod rom_status;
pub mod romlist;
pub mod storage;
pub mod streaming;
pub mod video;

/// The types of errors that can occur when loading a rom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use gstreamer::prelude::{
Cast, ElementExt, ElementExtManual, GstBinExtManual, GstObjectExt, PadExt,
};

use common_emulator::audio::AudioProducerWithRate;
use crate::audio::AudioProducerWithRate;

/// The main struct for sending a video stream over an arbitrary stream
pub struct StreamingOut {
Expand Down
7 changes: 3 additions & 4 deletions nes/rust/src/network/emulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ use libp2p::{
use crate::controller::ButtonCombination;
use common_emulator::audio::AudioProducerWithRate;

use super::{
streaming::{StreamingIn, StreamingOut},
NodeRole,
};
use super::NodeRole;

use common_emulator::streaming::{StreamingIn, StreamingOut};

/// Represents a message that can be sent to and from other nodes in the network.
#[derive(Debug, serde::Deserialize, serde::Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions nes/rust/src/network/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! This is the module for network play related code.
mod emulator;
mod streaming;

use std::collections::HashSet;

Expand All @@ -12,7 +11,7 @@ use libp2p::{futures::StreamExt, Multiaddr, Swarm};
use crate::controller::ButtonCombination;
use common_emulator::audio::AudioProducerWithRate;

use self::streaming::StreamingIn;
use common_emulator::streaming::StreamingIn;

#[derive(PartialEq, Copy, Clone, Debug, serde::Deserialize, serde::Serialize)]
/// The roles that a node on the network can have
Expand Down
6 changes: 2 additions & 4 deletions snes/rust/src/network/emulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ use libp2p::{
use crate::controller::ButtonCombination;
use common_emulator::audio::AudioProducerWithRate;

use super::{
streaming::{StreamingIn, StreamingOut},
NodeRole,
};
use super::NodeRole;
use common_emulator::streaming::{StreamingIn, StreamingOut};

/// Represents a message that can be sent to and from other nodes in the network.
#[derive(Debug, serde::Deserialize, serde::Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions snes/rust/src/network/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! This is the module for network play related code.
mod emulator;
mod streaming;

use std::collections::HashSet;

Expand All @@ -12,7 +11,7 @@ use libp2p::{futures::StreamExt, Multiaddr, Swarm};
use crate::controller::ButtonCombination;
use common_emulator::audio::AudioProducerWithRate;

use self::streaming::StreamingIn;
use common_emulator::streaming::StreamingIn;

#[derive(PartialEq, Copy, Clone, Debug, serde::Deserialize, serde::Serialize)]
/// The roles that a node on the network can have
Expand Down
Loading

0 comments on commit 0aeb090

Please sign in to comment.