diff --git a/gstreamer-video/src/caps_features.rs b/gstreamer-video/src/caps_features.rs new file mode 100644 index 000000000..7a71dd9aa --- /dev/null +++ b/gstreamer-video/src/caps_features.rs @@ -0,0 +1,49 @@ +// Copyright (C) 2020 Mathieu Duponchelle +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use gst::CapsFeatures; +use gst_video_sys; +use std::ffi::CStr; + +lazy_static! { + pub static ref CAPS_FEATURE_FORMAT_INTERLACED: &'static str = unsafe { + CStr::from_ptr(gst_video_sys::GST_CAPS_FEATURE_FORMAT_INTERLACED) + .to_str() + .unwrap() + }; + pub static ref CAPS_FEATURES_FORMAT_INTERLACED: CapsFeatures = + CapsFeatures::new(&[*CAPS_FEATURE_FORMAT_INTERLACED]); + pub static ref CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: &'static str = unsafe { + CStr::from_ptr(gst_video_sys::GST_CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META) + .to_str() + .unwrap() + }; + pub static ref CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: CapsFeatures = + CapsFeatures::new(&[*CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META]); + pub static ref CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: &'static str = unsafe { + CStr::from_ptr(gst_video_sys::GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META) + .to_str() + .unwrap() + }; + pub static ref CAPS_FEATURES_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: CapsFeatures = + CapsFeatures::new(&[*CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META]); + pub static ref CAPS_FEATURE_META_GST_VIDEO_META: &'static str = unsafe { + CStr::from_ptr(gst_video_sys::GST_CAPS_FEATURE_META_GST_VIDEO_META) + .to_str() + .unwrap() + }; + pub static ref CAPS_FEATURES_META_GST_VIDEO_META: CapsFeatures = + CapsFeatures::new(&[*CAPS_FEATURE_META_GST_VIDEO_META]); + pub static ref CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION: &'static str = unsafe { + CStr::from_ptr(gst_video_sys::GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION) + .to_str() + .unwrap() + }; + pub static ref CAPS_FEATURES_META_GST_VIDEO_OVERLAY_COMPOSITION: CapsFeatures = + CapsFeatures::new(&[*CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION]); +} diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 6ed325673..b1aad5e0c 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -43,6 +43,15 @@ macro_rules! skip_assert_initialized { mod auto; pub use auto::*; +mod caps_features; +pub use caps_features::{ + CAPS_FEATURES_FORMAT_INTERLACED, CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META, + CAPS_FEATURES_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, CAPS_FEATURES_META_GST_VIDEO_META, + CAPS_FEATURES_META_GST_VIDEO_OVERLAY_COMPOSITION, CAPS_FEATURE_FORMAT_INTERLACED, + CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META, + CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, CAPS_FEATURE_META_GST_VIDEO_META, + CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, +}; mod video_format; pub use video_format::*; mod video_format_info;