@@ -146,6 +146,16 @@ enum {
146
146
N_PROPERTIES
147
147
};
148
148
149
+ typedef enum {
150
+ GST_ZEDSRC_HD2K = 0 , // 2208x1242
151
+ GST_ZEDSRC_HD1080 = 1 , // 1920x1080
152
+ GST_ZEDSRC_HD1200 = 2 , // 1920x1200
153
+ GST_ZEDSRC_HD720 = 3 , // 1280x720
154
+ GST_ZEDSRC_SVGA = 4 , // 960x600
155
+ GST_ZEDSRC_VGA = 5 , // 672x376
156
+ GST_ZEDSRC_AUTO_RES = 6 , // Default value for the camera model
157
+ } GstZedSrcRes;
158
+
149
159
typedef enum {
150
160
GST_ZEDSRC_120FPS = 120 ,
151
161
GST_ZEDSRC_100FPS = 100 ,
@@ -220,7 +230,7 @@ typedef enum {
220
230
// ///////////////////////////////////////////////////////////////////////////
221
231
222
232
// INITIALIZATION
223
- #define DEFAULT_PROP_CAM_RES static_cast <gint>(sl::RESOLUTION::AUTO)
233
+ #define DEFAULT_PROP_CAM_RES GST_ZEDSRC_AUTO_RES
224
234
#define DEFAULT_PROP_CAM_FPS GST_ZEDSRC_15FPS
225
235
#define DEFAULT_PROP_SDK_VERBOSE 0
226
236
#define DEFAULT_PROP_CAM_FLIP 2
@@ -364,18 +374,18 @@ static GType gst_zedsrc_resol_get_type(void) {
364
374
365
375
if (!zedsrc_resol_type) {
366
376
static GEnumValue pattern_types[] = {
367
- {static_cast <gint>(sl::RESOLUTION::HD2K) , " 2208x1242" , " HD2K (USB3)" },
368
- {static_cast <gint>(sl::RESOLUTION::HD1200) , " 1920x1200 " , " HD1200 ( GMSL2)" },
369
- {static_cast <gint>(sl::RESOLUTION::HD1080) , " 1920x1080 " , " HD1080 (USB3/ GMSL2)" },
370
- {static_cast <gint>(sl::RESOLUTION::HD720) , " 1280x720" , " HD720 (USB3)" },
371
- {static_cast <gint>(sl::RESOLUTION::SVGA) , " 960x600" , " SVGA (GMSL2)" },
372
- {static_cast <gint>(sl::RESOLUTION::VGA) , " 672x376" , " VGA (USB3)" },
373
- {static_cast <gint>(sl::RESOLUTION::AUTO) , " Automatic" ,
377
+ {GST_ZEDSRC_HD2K , " 2208x1242" , " HD2K (USB3)" },
378
+ {GST_ZEDSRC_HD1080 , " 1920x1080 " , " HD1080 (USB3/ GMSL2)" },
379
+ {GST_ZEDSRC_HD1200 , " 1920x1200 " , " HD1200 ( GMSL2)" },
380
+ {GST_ZEDSRC_HD720 , " 1280x720" , " HD720 (USB3)" },
381
+ {GST_ZEDSRC_SVGA , " 960x600" , " SVGA (GMSL2)" },
382
+ {GST_ZEDSRC_VGA , " 672x376" , " VGA (USB3)" },
383
+ {GST_ZEDSRC_AUTO_RES , " Automatic" ,
374
384
" Default value for the camera model" },
375
385
{0 , NULL , NULL },
376
386
};
377
387
378
- zedsrc_resol_type = g_enum_register_static (" GstZedsrcResolution " , pattern_types);
388
+ zedsrc_resol_type = g_enum_register_static (" GstZedSrcRes " , pattern_types);
379
389
}
380
390
381
391
return zedsrc_resol_type;
@@ -2181,7 +2191,33 @@ static gboolean gst_zedsrc_start(GstBaseSrc *bsrc) {
2181
2191
2182
2192
GST_INFO (" CAMERA INITIALIZATION PARAMETERS" );
2183
2193
2184
- init_params.camera_resolution = static_cast <sl::RESOLUTION>(src->camera_resolution );
2194
+ switch (src->camera_resolution ) {
2195
+ case GST_ZEDSRC_HD2K:
2196
+ init_params.camera_resolution = sl::RESOLUTION::HD2K;
2197
+ break ;
2198
+ case GST_ZEDSRC_HD1080:
2199
+ init_params.camera_resolution = sl::RESOLUTION::HD1080;
2200
+ break ;
2201
+ case GST_ZEDSRC_HD1200:
2202
+ init_params.camera_resolution = sl::RESOLUTION::HD1200;
2203
+ break ;
2204
+ case GST_ZEDSRC_HD720:
2205
+ init_params.camera_resolution = sl::RESOLUTION::HD720;
2206
+ break ;
2207
+ case GST_ZEDSRC_SVGA:
2208
+ init_params.camera_resolution = sl::RESOLUTION::SVGA;
2209
+ break ;
2210
+ case GST_ZEDSRC_VGA:
2211
+ init_params.camera_resolution = sl::RESOLUTION::SVGA;
2212
+ break ;
2213
+ case GST_ZEDSRC_AUTO_RES:
2214
+ init_params.camera_resolution = sl::RESOLUTION::AUTO;
2215
+ break ;
2216
+ default :
2217
+ GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
2218
+ (" Failed to set camera resolution" ), (NULL ));
2219
+ return FALSE ;
2220
+ }
2185
2221
GST_INFO (" * Camera resolution: %s" , sl::toString (init_params.camera_resolution ).c_str ());
2186
2222
init_params.camera_fps = src->camera_fps ;
2187
2223
GST_INFO (" * Camera FPS: %d" , init_params.camera_fps );
0 commit comments