[spice-streaming-agent,v2,2/2] gst-plugin: Use autovideoconvert element for color space conversion

Submitted by Snir Sheriber on June 27, 2019, 1:37 p.m.

Details

Message ID 20190627133722.15613-2-ssheribe@redhat.com
State Accepted
Commit e0cf764baff9d678a6e75916457300d1ff39b169
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Snir Sheriber June 27, 2019, 1:37 p.m.
When VAAPI based encoder is used it's likely that also VAAPI based
conversion is available (using the vaapipostproc element).
Moving to autovideoconvert will automatically choose a suitable
convert element according to elements availability (e.g. in the
VAAPI case it would select vaapipostproc due to its high rank).

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
---
Basically Acked, for the record I'm sending it again with the minor changes
---
 src/gst-plugin.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gst-plugin.cpp b/src/gst-plugin.cpp
index 0dd7796..3887b47 100644
--- a/src/gst-plugin.cpp
+++ b/src/gst-plugin.cpp
@@ -216,9 +216,9 @@  void GstreamerFrameCapture::pipeline_init(const GstreamerEncoderSettings &settin
     if (!capture) {
         throw std::runtime_error("Gstreamer's capture element cannot be created");
     }
-    GstObjectUPtr<GstElement> convert(gst_element_factory_make("videoconvert", "convert"));
+    GstObjectUPtr<GstElement> convert(gst_element_factory_make("autovideoconvert", "convert"));
     if (!convert) {
-        throw std::runtime_error("Gstreamer's 'videoconvert' element cannot be created");
+        throw std::runtime_error("Gstreamer's 'autovideoconvert' element cannot be created");
     }
     GstCapsUPtr sink_caps;
     GstObjectUPtr<GstElement> encoder(get_encoder_plugin(settings, sink_caps));

Comments

> 
> When VAAPI based encoder is used it's likely that also VAAPI based
> conversion is available (using the vaapipostproc element).
> Moving to autovideoconvert will automatically choose a suitable
> convert element according to elements availability (e.g. in the
> VAAPI case it would select vaapipostproc due to its high rank).
> 
> Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
> Acked-by: Frediano Ziglio <fziglio@redhat.com>
> ---
> Basically Acked, for the record I'm sending it again with the minor changes

yes, confirmed for me

> ---
>  src/gst-plugin.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gst-plugin.cpp b/src/gst-plugin.cpp
> index 0dd7796..3887b47 100644
> --- a/src/gst-plugin.cpp
> +++ b/src/gst-plugin.cpp
> @@ -216,9 +216,9 @@ void GstreamerFrameCapture::pipeline_init(const
> GstreamerEncoderSettings &settin
>      if (!capture) {
>          throw std::runtime_error("Gstreamer's capture element cannot be
>          created");
>      }
> -    GstObjectUPtr<GstElement>
> convert(gst_element_factory_make("videoconvert", "convert"));
> +    GstObjectUPtr<GstElement>
> convert(gst_element_factory_make("autovideoconvert", "convert"));
>      if (!convert) {
> -        throw std::runtime_error("Gstreamer's 'videoconvert' element cannot
> be created");
> +        throw std::runtime_error("Gstreamer's 'autovideoconvert' element
> cannot be created");
>      }
>      GstCapsUPtr sink_caps;
>      GstObjectUPtr<GstElement> encoder(get_encoder_plugin(settings,
>      sink_caps));

Frediano