[shotwell/wip/phako/external-gstreamer: 41/43] WIP
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/phako/external-gstreamer: 41/43] WIP
- Date: Wed, 31 Jul 2019 12:43:09 +0000 (UTC)
commit 6dd8c0754566f6c1d3ff642fb99310e91f2ef613
Author: Jens Georg <mail jensge org>
Date: Sat Jun 8 18:33:18 2019 +0200
WIP
src/ExternalHelper.vala | 2 +-
src/video-support/VideoMetadataReaderProcess.vala | 17 +++++++++++++----
src/video-support/VideoReader.vala | 18 +++++++++++++-----
3 files changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/src/ExternalHelper.vala b/src/ExternalHelper.vala
index 617e679d..d74ac46a 100644
--- a/src/ExternalHelper.vala
+++ b/src/ExternalHelper.vala
@@ -87,7 +87,7 @@ public class ExternalProxy<G> : Object, Initable {
if (remote_process == null) {
remote_process = new Subprocess(SubprocessFlags.NONE, remote_helper_path, "--address=" +
server.get_client_address());
remote_process.wait_async.begin(null, on_process_exited);
- startup_timeout = Timeout.add_seconds(2, () => {
+ startup_timeout = Timeout.add_seconds(10, () => {
startup_timeout = 0;
saved_get_remote_callback();
critical("=====> Timeout");
diff --git a/src/video-support/VideoMetadataReaderProcess.vala
b/src/video-support/VideoMetadataReaderProcess.vala
index 1373c759..41ca6865 100644
--- a/src/video-support/VideoMetadataReaderProcess.vala
+++ b/src/video-support/VideoMetadataReaderProcess.vala
@@ -51,15 +51,17 @@ internal class MetadataReader : GLib.Object {
var result = info.get_result ();
if (result == Gst.PbUtils.DiscovererResult.TIMEOUT) {
- debug ("Extraction timed out on %s", file.get_uri ());
+ critical ("Extraction timed out on %s", file.get_uri ());
} else if (result == Gst.PbUtils.DiscovererResult.MISSING_PLUGINS) {
- debug ("Plugins are missing for extraction of file %s",
+ critical ("Plugins are missing for extraction of file %s",
file.get_uri ());
}
throw error;
}
+ print ("Before return!");
+
return info.get_duration();
}
@@ -106,19 +108,22 @@ internal class MetadataReader : GLib.Object {
}
private bool on_authorize_peer(DBusAuthObserver observer, IOStream stream, Credentials? credentials) {
- debug("Observer trying to authorize for %s", credentials.to_string());
+ critical("helper: Observer trying to authorize for %s", credentials.to_string());
if (credentials == null) {
+ critical ("Invalid credentials");
return false;
}
try {
if (!credentials.is_same_user(new Credentials())) {
+ critical ("different user");
return false;
}
return true;
} catch (Error error) {
+ critical ("Error %s", error.message);
return false;
}
}
@@ -137,11 +142,15 @@ int main(string[] args) {
}
if (address != null) {
+ critical("=> Creating new connection");
var observer = new DBusAuthObserver();
observer.authorize_authenticated_peer.connect(on_authorize_peer);
- var connection = new DBusConnection.for_address_sync(address,
DBusConnectionFlags.AUTHENTICATION_CLIENT,
+ var connection = new DBusConnection.for_address_sync(address, DBusConnectionFlags.NONE,
//AUTHENTICATION_CLIENT,
observer, null);
+
+ critical("=> Registering object");
connection.register_object ("/org/gnome/Shotwell/VideoMetadata1", new MetadataReader());
+
}
loop = new MainLoop(null, false);
diff --git a/src/video-support/VideoReader.vala b/src/video-support/VideoReader.vala
index 677ede21..d13320b2 100644
--- a/src/video-support/VideoReader.vala
+++ b/src/video-support/VideoReader.vala
@@ -35,7 +35,13 @@ internal class VideoMetadataReader : ExternalProxy<VideoMetadataReaderInterface>
public async uint64 get_duration(string uri) throws Error {
var r = yield get_remote();
- return yield r.get_duration(uri);
+ debug ("Got remote!");
+
+ var d = yield r.get_duration(uri);
+
+ debug ("Got duration");
+
+ return d;
}
public async string[] read_metadata(string uri) throws Error {
@@ -214,23 +220,25 @@ public class VideoReader {
file.get_path()));
var reader = VideoMetadataReader.get_instance();
+ var context = new MainContext();
try {
- var context = new MainContext();
- context.push_thread_default();
- var loop = new MainLoop(context, false);
AsyncResult result = null;
+ var loop = new MainLoop(context, false);
reader.get_duration.begin(file.get_uri(), (obj, res) => {
+ critical ("=> Got reader callback!");
result = res;
loop.quit();
});
+ context.push_thread_default();
loop.run();
clip_duration = ((double) reader.get_duration.end(result)) / 1000000000.0;
- context.pop_thread_default();
} catch (Error e) {
debug("Video read error: %s", e.message);
throw new VideoError.CONTENTS("GStreamer couldn't extract clip information: %s"
.printf(e.message));
+ } finally {
+ context.pop_thread_default();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]