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:
authorFrançois Laignel <fengalin@free.fr>2022-02-21 20:43:46 +0300
committerFrançois Laignel <fengalin@free.fr>2022-02-21 22:50:01 +0300
commit422ea740ca937c3d669b7c961a67a09d9b1baed0 (patch)
treed6b0333340dcb3621a2195d2b92ffb23e402d5b6 /tutorial/tutorial-1.md
parent8263e19313df6af6bb9dc59bad94bec0769192fc (diff)
Update to gst::_log_macro_
See the details: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/980
Diffstat (limited to 'tutorial/tutorial-1.md')
-rw-r--r--tutorial/tutorial-1.md13
1 files changed, 6 insertions, 7 deletions
diff --git a/tutorial/tutorial-1.md b/tutorial/tutorial-1.md
index 7ea9cb9e6..fc997b766 100644
--- a/tutorial/tutorial-1.md
+++ b/tutorial/tutorial-1.md
@@ -146,7 +146,6 @@ With that our `src/lib.rs` is complete, and all following code is only in `src/r
```rust
use gst::glib;
-use gst::{gst_debug, gst_info};
use gst_base::subclass::prelude::*;
use std::i32;
@@ -438,7 +437,7 @@ impl BaseTransformImpl for Rgb2Gray {
Some(info) => info,
};
- gst_debug!(
+ gst::debug!(
CAT,
obj: element,
"Configured for caps {} to {}",
@@ -455,14 +454,14 @@ impl BaseTransformImpl for Rgb2Gray {
// Drop state
let _ = self.state.lock().unwrap().take();
- gst_info!(CAT, obj: element, "Stopped");
+ gst::info!(CAT, obj: element, "Stopped");
Ok(())
}
}
```
-This code should be relatively self-explanatory. In `set_caps` we’re parsing the two caps into a `VideoInfo` and then store this in our `State`, in `stop` we drop the `State` and replace it with `None`. In addition we make use of our debug category here and use the `gst_info!` and `gst_debug!` macros to output the current caps configuration to the GStreamer debug logging system. This information can later be useful for debugging any problems once the element is running.
+This code should be relatively self-explanatory. In `set_caps` we’re parsing the two caps into a `VideoInfo` and then store this in our `State`, in `stop` we drop the `State` and replace it with `None`. In addition we make use of our debug category here and use the `gst::info!` and `gst::debug!` macros to output the current caps configuration to the GStreamer debug logging system. This information can later be useful for debugging any problems once the element is running.
Next we have to provide information to the `BaseTransform` base class about the size in bytes of a video frame with specific caps. This is needed so that the base class can allocate an appropriately sized output buffer for us, that we can then fill later. This is done with the `get_unit_size` virtual method, which is required to return the size of one processing unit in specific caps. In our case, one processing unit is one video frame. In the case of raw audio it would be the size of one sample multiplied by the number of channels.
@@ -518,7 +517,7 @@ impl BaseTransformImpl for Rgb2Gray {
gray_caps
};
- gst_debug!(
+ gst::debug!(
CAT,
obj: element,
"Transformed caps from {} to {} in direction {:?}",
@@ -778,7 +777,7 @@ impl ObjectImpl for Rgb2Gray {
"invert" => {
let mut settings = self.settings.lock().unwrap();
let invert = value.get_some().expect("type checked upstream");
- gst_info!(
+ gst::info!(
CAT,
obj: obj,
"Changing invert from {} to {}",
@@ -790,7 +789,7 @@ impl ObjectImpl for Rgb2Gray {
"shift" => {
let mut settings = self.settings.lock().unwrap();
let shift = value.get_some().expect("type checked upstream");
- gst_info!(
+ gst::info!(
CAT,
obj: obj,
"Changing shift from {} to {}",