Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2021-06-17 01:53:04 +0300
committerMathieu Duponchelle <mathieu@centricular.com>2021-06-17 01:54:14 +0300
commitd15e97efb875812af52d8b63e30bb7864e119160 (patch)
tree2591557c53a0d6498e94fb3e9885565ffb886982
parentada328df010e31487afd8c6b56756e40f099b6d6 (diff)
awstranscriber: expose optional session-id property
When set, it can be used to identify transcription sessions a posteriori.
-rw-r--r--net/rusoto/src/aws_transcriber/imp.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs
index c974eb4a1..08c6bddc6 100644
--- a/net/rusoto/src/aws_transcriber/imp.rs
+++ b/net/rusoto/src/aws_transcriber/imp.rs
@@ -119,6 +119,7 @@ struct Settings {
language_code: Option<String>,
use_partial_results: bool,
vocabulary: Option<String>,
+ session_id: Option<String>,
}
impl Default for Settings {
@@ -128,6 +129,7 @@ impl Default for Settings {
language_code: Some("en-US".to_string()),
use_partial_results: DEFAULT_USE_PARTIAL_RESULTS,
vocabulary: None,
+ session_id: None,
}
}
}
@@ -895,6 +897,11 @@ impl Transcriber {
signed.add_param("vocabulary-name", vocabulary);
}
+ if let Some(ref session_id) = settings.session_id {
+ gst_debug!(CAT, obj: element, "Using session ID: {}", session_id);
+ signed.add_param("session-id", session_id);
+ }
+
let url = signed.generate_presigned_url(&creds, &std::time::Duration::from_secs(60), true);
let (ws, _) = {
@@ -1078,6 +1085,13 @@ impl ObjectImpl for Transcriber {
None,
glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY,
),
+ glib::ParamSpec::new_string(
+ "session-id",
+ "Session ID",
+ "The ID of the transcription session, must be length 36",
+ None,
+ glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY,
+ ),
]
});
@@ -1118,6 +1132,10 @@ impl ObjectImpl for Transcriber {
let mut settings = self.settings.lock().unwrap();
settings.vocabulary = value.get().expect("type checked upstream");
}
+ "session-id" => {
+ let mut settings = self.settings.lock().unwrap();
+ settings.session_id = value.get().expect("type checked upstream");
+ }
_ => unimplemented!(),
}
}
@@ -1140,6 +1158,10 @@ impl ObjectImpl for Transcriber {
let settings = self.settings.lock().unwrap();
settings.vocabulary.to_value()
}
+ "session-id" => {
+ let settings = self.settings.lock().unwrap();
+ settings.session_id.to_value()
+ }
_ => unimplemented!(),
}
}