1 // Copyright (C) 2018 Thiago Santos <thiagossantos@gmail.com>
2 //                    Sebastian Dröge <sebastian@centricular.com>
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9 
10 use DiscovererVideoInfo;
11 
12 use glib::translate::*;
13 use gst;
14 use gst_pbutils_sys;
15 
16 impl DiscovererVideoInfo {
get_framerate(&self) -> gst::Fraction17     pub fn get_framerate(&self) -> gst::Fraction {
18         unsafe {
19             gst::Fraction::new(
20                 gst_pbutils_sys::gst_discoverer_video_info_get_framerate_num(self.to_glib_none().0)
21                     as i32,
22                 gst_pbutils_sys::gst_discoverer_video_info_get_framerate_denom(
23                     self.to_glib_none().0,
24                 ) as i32,
25             )
26         }
27     }
28 
get_par(&self) -> gst::Fraction29     pub fn get_par(&self) -> gst::Fraction {
30         unsafe {
31             gst::Fraction::new(
32                 gst_pbutils_sys::gst_discoverer_video_info_get_par_num(self.to_glib_none().0)
33                     as i32,
34                 gst_pbutils_sys::gst_discoverer_video_info_get_par_denom(self.to_glib_none().0)
35                     as i32,
36             )
37         }
38     }
39 }
40