@@ -106,6 +106,46 @@ impl VideoFormat {
106106 pub fn get_name ( & self ) -> Option < String > {
107107 unsafe { API :: get_cached ( ) . get_video_format_name ( & self . as_ptr ( ) ) }
108108 }
109+
110+ pub const YUV420P8 : Self = Self {
111+ color_family : ColorFamily :: YUV ,
112+ sample_type : SampleType :: Integer ,
113+ bits_per_sample : 8 ,
114+ bytes_per_sample : 1 ,
115+ sub_sampling_w : 2 ,
116+ sub_sampling_h : 2 ,
117+ num_planes : 3 ,
118+ } ;
119+
120+ pub const YUV444P8 : Self = Self {
121+ color_family : ColorFamily :: YUV ,
122+ sample_type : SampleType :: Integer ,
123+ bits_per_sample : 8 ,
124+ bytes_per_sample : 1 ,
125+ sub_sampling_w : 1 ,
126+ sub_sampling_h : 1 ,
127+ num_planes : 3 ,
128+ } ;
129+
130+ pub const RGB24 : Self = Self {
131+ color_family : ColorFamily :: RGB ,
132+ sample_type : SampleType :: Integer ,
133+ bits_per_sample : 8 ,
134+ bytes_per_sample : 1 ,
135+ sub_sampling_w : 0 ,
136+ sub_sampling_h : 0 ,
137+ num_planes : 3 ,
138+ } ;
139+
140+ pub const GRAY8 : Self = Self {
141+ color_family : ColorFamily :: Gray ,
142+ sample_type : SampleType :: Integer ,
143+ bits_per_sample : 8 ,
144+ bytes_per_sample : 1 ,
145+ sub_sampling_w : 0 ,
146+ sub_sampling_h : 0 ,
147+ num_planes : 1 ,
148+ } ;
109149}
110150
111151impl VideoInfo {
@@ -197,28 +237,6 @@ impl VideoFormatBuilder {
197237 }
198238}
199239
200- impl VideoFormat {
201- /// Convenience method to create common YUV420P8 format
202- pub fn yuv420p8 ( core : & crate :: core:: CoreRef ) -> Result < Self , FormatError > {
203- Self :: query ( ColorFamily :: YUV , SampleType :: Integer , 8 , 1 , 1 , core)
204- }
205-
206- /// Convenience method to create common YUV444P8 format
207- pub fn yuv444p8 ( core : & crate :: core:: CoreRef ) -> Result < Self , FormatError > {
208- Self :: query ( ColorFamily :: YUV , SampleType :: Integer , 8 , 0 , 0 , core)
209- }
210-
211- /// Convenience method to create common RGB24 format
212- pub fn rgb24 ( core : & crate :: core:: CoreRef ) -> Result < Self , FormatError > {
213- Self :: query ( ColorFamily :: RGB , SampleType :: Integer , 8 , 0 , 0 , core)
214- }
215-
216- /// Convenience method to create common Gray8 format
217- pub fn gray8 ( core : & crate :: core:: CoreRef ) -> Result < Self , FormatError > {
218- Self :: query ( ColorFamily :: Gray , SampleType :: Integer , 8 , 0 , 0 , core)
219- }
220- }
221-
222240/// Information about a video clip
223241#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
224242pub struct VideoInfo {
0 commit comments