Comments (3)
Ah yes, I've actually not tried sending NDI using the library either yet. I think currently you would need to set up a video frame using a bunch of unsafe pointer stuff and messing with memory directly. I can try and figure out what it expects that data to be and try to create something that's somewhat reasonable for a rust API.
It might take a bit since I'm currently moving out of my apartment but if you end up figuring it out before me feel free to send a PR!
from ndi-rs.
a simple solution could be to make an interface to create VideoData like this...
impl VideoData {
...
pub fn from_buffer(width: i32, height: i32, fourcc: FourCCVideoType, framerate : i32, frame_format: FrameFormatType, timecode: i64, stride:i32, buffer: &mut [u8] ) -> Self
}
and give the user the option to create any type of video data.
A Different option would be to use an external crate like image::image, to handle the creation from ImageBuffer.
This could be a more well defined interface
from ndi-rs.
I've accepted your PR and made some changes to allow maximum flexibility to the end user.
83681c5
Like I mentioned in the PR, I'm not sure if this is too verbose and we want something to simplify creating VideoData with only modifications to the buffer, or if that's not exactly necessary right now but this at least makes it possible with the library.
from ndi-rs.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndi-rs.