فهرست منبع

Initial project

Alexandre Janniaux 5 سال پیش
کامیت
dd58d6fa0f
4فایلهای تغییر یافته به همراه57 افزوده شده و 0 حذف شده
  1. 2 0
      .gitignore
  2. 25 0
      Cargo.lock
  3. 10 0
      Cargo.toml
  4. 20 0
      src/main.rs

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+/target
+**/*.rs.bk

+ 25 - 0
Cargo.lock

@@ -0,0 +1,25 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "libc"
+version = "0.2.65"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "vlc-rs"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "vlc-transcode"
+version = "0.1.0"
+dependencies = [
+ "vlc-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[metadata]
+"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8"
+"checksum vlc-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6223b2d4a7b2977e0758cbff1cb00df37236f91de4593da47f8a2737ac59a96e"

+ 10 - 0
Cargo.toml

@@ -0,0 +1,10 @@
+[package]
+name = "vlc-transcode"
+version = "0.1.0"
+authors = ["Alexandre Janniaux <ajanni@videolabs.io>"]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+vlc-rs = "0.3"

+ 20 - 0
src/main.rs

@@ -0,0 +1,20 @@
+use vlc::{Instance, Media};
+use std::path::PathBuf;
+
+fn main()
+    -> std::result::Result<(), ()>
+{
+    let args = std::env::args()
+        .collect::<Vec<String>>();
+
+    assert!(args.len() > 1);
+
+    let filename = args[1].clone();
+
+    let path = PathBuf::from(filename);
+    let instance = Instance::new().unwrap();
+
+    let md = Media::new_path(&instance, &path).unwrap();
+
+    Ok(())
+}