@@ -76,8 +76,8 @@ public MMALCameraComponent() : base(MMALParameters.MMAL_COMPONENT_DEFAULT_CAMERA
7676 this . CameraInfo . MaxHeight ,
7777 0 ,
7878 1 ,
79- MMALCameraConfig . PreviewResolution . Width ,
80- MMALCameraConfig . PreviewResolution . Height ,
79+ MMALCameraConfig . VideoResolution . Width ,
80+ MMALCameraConfig . VideoResolution . Height ,
8181 3 ,
8282 0 ,
8383 0 ,
@@ -138,26 +138,10 @@ internal void Initialise()
138138
139139 private void InitialisePreview ( )
140140 {
141- if ( MMALCameraConfig . PreviewResolution . Width == 0 || MMALCameraConfig . PreviewResolution . Width > this . CameraInfo . MaxWidth )
142- {
143- MMALCameraConfig . PreviewResolution . Width = this . CameraInfo . MaxWidth ;
144- }
145-
146- if ( MMALCameraConfig . PreviewResolution . Height == 0 || MMALCameraConfig . PreviewResolution . Height > this . CameraInfo . MaxHeight )
147- {
148- MMALCameraConfig . PreviewResolution . Height = this . CameraInfo . MaxHeight ;
149- }
150-
151- if ( MMALCameraConfig . VideoResolution != null && MMALCameraConfig . PreviewResolution . CompareTo ( MMALCameraConfig . VideoResolution ) > 0 )
152- {
153- //HW limitation means Preview must be the same as Video resolution if applicable. Does not apply for still capture.
154- MMALCameraConfig . PreviewResolution = MMALCameraConfig . VideoResolution ;
155- }
156-
157141 var vFormat = new MMAL_VIDEO_FORMAT_T (
158- MMALUtil . VCOS_ALIGN_UP ( MMALCameraConfig . PreviewResolution . Width , 32 ) ,
159- MMALUtil . VCOS_ALIGN_UP ( MMALCameraConfig . PreviewResolution . Height , 16 ) ,
160- new MMAL_RECT_T ( 0 , 0 , MMALCameraConfig . PreviewResolution . Width , MMALCameraConfig . PreviewResolution . Height ) ,
142+ MMALUtil . VCOS_ALIGN_UP ( MMALCameraConfig . VideoResolution . Width , 32 ) ,
143+ MMALUtil . VCOS_ALIGN_UP ( MMALCameraConfig . VideoResolution . Height , 16 ) ,
144+ new MMAL_RECT_T ( 0 , 0 , MMALCameraConfig . VideoResolution . Width , MMALCameraConfig . VideoResolution . Height ) ,
161145 new MMAL_RATIONAL_T ( 0 , 1 ) ,
162146 this . PreviewPort . Ptr ->Format ->es ->video . Par ,
163147 this . PreviewPort . Ptr ->Format ->es ->video . ColorSpace
@@ -227,7 +211,7 @@ private void InitialiseStill()
227211 {
228212 MMALCameraConfig . StillResolution . Height = this . CameraInfo . MaxHeight ;
229213 }
230-
214+
231215 var vFormat = new MMAL_VIDEO_FORMAT_T ( ) ;
232216
233217 if ( MMALCameraConfig . StillEncoding == MMALEncoding . MMAL_ENCODING_RGB32 ||
@@ -262,12 +246,12 @@ private void InitialiseStill()
262246 this . StillPort . Ptr ->Format ->es ->video = vFormat ;
263247 this . StillPort . Ptr ->Format ->encoding = MMALCameraConfig . StillEncoding . EncodingVal ;
264248 this . StillPort . Ptr ->Format ->encodingVariant = MMALCameraConfig . StillSubFormat . EncodingVal ;
265-
249+
266250 if ( MMALCameraConfig . Debug )
267251 Console . WriteLine ( "Commit still" ) ;
268252
269253 this . StillPort . Commit ( ) ;
270-
254+
271255 this . StillPort . Ptr ->BufferNum = Math . Max ( this . StillPort . BufferNumRecommended ,
272256 this . StillPort . BufferNumMin ) ;
273257
0 commit comments