mirror of
https://github.com/servo/servo.git
synced 2025-07-31 11:10:22 +01:00
Auto merge of #24255 - ferjm:gst.log.uwp, r=jdm
Hook up GST_DEBUG log to visual studio output - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23700 <strike>Depends on https://github.com/servo/media/pull/312</strike> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24255) <!-- Reviewable:end -->
This commit is contained in:
commit
a7f76a3d09
3 changed files with 49 additions and 16 deletions
|
@ -86,8 +86,9 @@ webxr-api = {git = "https://github.com/servo/webxr"}
|
|||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies]
|
||||
gaol = {git = "https://github.com/servo/gaol"}
|
||||
|
||||
[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies.servo-media-gstreamer]
|
||||
git = "https://github.com/servo/media"
|
||||
[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies]
|
||||
gstreamer = "0.14.5"
|
||||
servo-media-gstreamer= {git = "https://github.com/servo/media"}
|
||||
|
||||
[target.'cfg(not(any(target_os = "android", target_arch = "x86_64", target_os = "windows")))'.dependencies.servo-media-dummy]
|
||||
git = "https://github.com/servo/media"
|
||||
|
|
|
@ -130,6 +130,34 @@ mod media_platform {
|
|||
use super::ServoMedia;
|
||||
use servo_media_gstreamer::GStreamerBackend;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn set_gstreamer_log_handler() {
|
||||
use gstreamer::{debug_add_log_function, debug_remove_default_log_function, DebugLevel};
|
||||
|
||||
debug_remove_default_log_function();
|
||||
debug_add_log_function(|cat, level, file, function, line, _, message| {
|
||||
let message = format!(
|
||||
"{:?} {:?} {:?}:{:?}:{:?} {:?}",
|
||||
cat.get_name(),
|
||||
level,
|
||||
file,
|
||||
line,
|
||||
function,
|
||||
message
|
||||
);
|
||||
match level {
|
||||
DebugLevel::Debug => debug!("{}", message),
|
||||
DebugLevel::Error => error!("{}", message),
|
||||
DebugLevel::Warning => warn!("{}", message),
|
||||
DebugLevel::Fixme | DebugLevel::Info => info!("{}", message),
|
||||
DebugLevel::Memdump | DebugLevel::Count | DebugLevel::Trace => {
|
||||
trace!("{}", message)
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn init() {
|
||||
// UWP apps have the working directory set appropriately. Win32 apps
|
||||
|
@ -195,6 +223,9 @@ mod media_platform {
|
|||
},
|
||||
};
|
||||
ServoMedia::init_with_backend(backend);
|
||||
if cfg!(feature = "uwp") {
|
||||
set_gstreamer_log_handler();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue