|
@@ -19,6 +19,11 @@ namespace Ppub {
|
|
|
private Gee.HashMap<string, string> entries { get; set; }
|
|
|
|
|
|
public Invercargill.Sequence<VideoDescription> streams { get; set; }
|
|
|
+
|
|
|
+ public VideoManifest() {
|
|
|
+ entries = new Gee.HashMap<string, string>();
|
|
|
+ streams = Invercargill.empty<VideoDescription>().to_sequence();
|
|
|
+ }
|
|
|
|
|
|
public string? get_value(string name) {
|
|
|
if (entries.has_key(name)) {
|
|
@@ -149,6 +154,23 @@ namespace Ppub {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public string to_string() {
|
|
|
+ var data = "PPVM\n";
|
|
|
+ foreach (var key in entries.keys) {
|
|
|
+ data += @"$key: $(entries[key])\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ data += "\n";
|
|
|
+
|
|
|
+ foreach (var stream in streams) {
|
|
|
+ data += @"$VIDEO: $(stream.to_string())\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ data += "\n";
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -162,6 +184,10 @@ namespace Ppub {
|
|
|
|
|
|
private Gee.HashMap<string, string> properties { get; set; }
|
|
|
|
|
|
+ public VideoDescription() {
|
|
|
+ properties = new Gee.HashMap<string, string>();
|
|
|
+ }
|
|
|
+
|
|
|
public VideoDescription.from_string(string line) {
|
|
|
var fields = line.split(", ", 3);
|
|
|
version_label = fields[0];
|
|
@@ -182,6 +208,15 @@ namespace Ppub {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public string to_string() {
|
|
|
+ var meta = "";
|
|
|
+ foreach(var key in properties.keys) {
|
|
|
+ meta += @" $key=\"$(properties[key])\";";
|
|
|
+ }
|
|
|
+
|
|
|
+ return @"$version_label, $file_name,$meta";
|
|
|
+ }
|
|
|
+
|
|
|
public string? get_property(string name) {
|
|
|
if (properties.has_key(name)) {
|
|
|
return properties.get(name);
|