@@ -258,8 +258,6 @@ int v1_pipeline_create(void)
258
258
if (ret = v1_vi .fnEnableChannel (_v1_vi_chn ))
259
259
return ret ;
260
260
261
- if (ret = v1_snr_drv .fnInit ())
262
- return ret ;
263
261
if (ret = v1_snr_drv .fnRegisterCallback ())
264
262
return ret ;
265
263
@@ -274,6 +272,7 @@ int v1_pipeline_create(void)
274
272
return ret ;
275
273
if (ret = v1_isp .fnSetImageConfig (& v1_config .img ))
276
274
return ret ;
275
+ v1_config .tim .mode = V1_ISP_WIN_BOTH ;
277
276
if (ret = v1_isp .fnSetInputTiming (& v1_config .tim ))
278
277
return ret ;
279
278
@@ -423,8 +422,6 @@ int v1_sensor_init(char *name, char *obj)
423
422
} if (!v1_snr_drv .handle )
424
423
HAL_ERROR ("v1_snr" , "Failed to load the sensor driver" );
425
424
426
- if (!(v1_snr_drv .fnInit = (int (* )(void ))dlsym (v1_snr_drv .handle , "sensor_init" )))
427
- HAL_ERROR ("v1_snr" , "Failed to connect the init function" );
428
425
if (!(v1_snr_drv .fnRegisterCallback = (int (* )(void ))dlsym (v1_snr_drv .handle , "sensor_register_callback" )))
429
426
HAL_ERROR ("v1_snr" , "Failed to connect the callback register function" );
430
427
if (!(v1_snr_drv .fnUnRegisterCallback = (int (* )(void ))dlsym (v1_snr_drv .handle , "sensor_unregister_callback" )))
@@ -447,9 +444,10 @@ int v1_video_create(char index, hal_vidconfig *config)
447
444
channel .attrib .jpg .bufSize =
448
445
config -> height * config -> width * 2 ;
449
446
channel .attrib .jpg .byFrame = 1 ;
447
+ channel .attrib .jpg .fieldOrFrame = 0 ;
448
+ channel .attrib .jpg .priority = 0 ;
450
449
channel .attrib .jpg .pic .width = config -> width ;
451
450
channel .attrib .jpg .pic .height = config -> height ;
452
- channel .attrib .jpg .dcfThumbs = 0 ;
453
451
goto attach ;
454
452
} else if (config -> codec == HAL_VIDCODEC_MJPG ) {
455
453
channel .attrib .codec = V1_VENC_CODEC_MJPG ;
@@ -458,6 +456,9 @@ int v1_video_create(char index, hal_vidconfig *config)
458
456
channel .attrib .mjpg .bufSize =
459
457
config -> height * config -> width * 2 ;
460
458
channel .attrib .mjpg .byFrame = 1 ;
459
+ channel .attrib .mjpg .mainStrmOn = index ? 0 : 1 ;
460
+ channel .attrib .mjpg .fieldOrFrame = 0 ;
461
+ channel .attrib .mjpg .priority = 0 ;
461
462
channel .attrib .mjpg .pic .width = config -> width ;
462
463
channel .attrib .mjpg .pic .height = config -> height ;
463
464
switch (config -> mode ) {
@@ -507,14 +508,24 @@ int v1_video_create(char index, hal_vidconfig *config)
507
508
attrib -> bufSize = config -> height * config -> width * 2 ;
508
509
attrib -> profile = config -> profile ;
509
510
attrib -> byFrame = 1 ;
511
+ attrib -> fieldOn = 0 ;
512
+ attrib -> mainStrmOn = index ? 0 : 1 ;
513
+ attrib -> priority = 0 ;
514
+ attrib -> fieldOrFrame = 0 ;
510
515
attrib -> pic .width = config -> width ;
511
516
attrib -> pic .height = config -> height ;
512
517
attrib -> bFrameNum = 0 ;
513
518
attrib -> refNum = 1 ;
514
519
attach :
520
+ if (ret = v1_venc .fnCreateGroup (_v1_venc_dev ))
521
+ return ret ;
522
+
515
523
if (ret = v1_venc .fnCreateChannel (index , & channel ))
516
524
return ret ;
517
525
526
+ if (ret = v1_venc .fnRegisterChannel (_v1_venc_dev , index ))
527
+ return ret ;
528
+
518
529
if (config -> codec != HAL_VIDCODEC_JPG &&
519
530
(ret = v1_venc .fnStartReceiving (index )))
520
531
return ret ;
@@ -542,8 +553,14 @@ int v1_video_destroy(char index)
542
553
return ret ;
543
554
}
544
555
556
+ if (ret = v1_venc .fnUnregisterChannel (index ))
557
+ return ret ;
558
+
545
559
if (ret = v1_venc .fnDestroyChannel (index ))
546
560
return ret ;
561
+
562
+ if (ret = v1_venc .fnDestroyGroup (_v1_venc_dev ))
563
+ return ret ;
547
564
548
565
if (ret = v1_vpss .fnDisableChannel (_v1_vpss_grp , index ))
549
566
return ret ;
@@ -809,8 +826,8 @@ int v1_system_init(char *snrConfig)
809
826
v1_config .vichn .capt .width : v1_config .videv .rect .width ,
810
827
v1_config .vichn .capt .height ?
811
828
v1_config .vichn .capt .height : v1_config .videv .rect .height ,
812
- V1_PIXFMT_YUV420SP , alignWidth );
813
- pool .comm [0 ].blockCnt = 4 ;
829
+ alignWidth );
830
+ pool .comm [0 ].blockCnt = 12 ;
814
831
815
832
if (ret = v1_vb .fnConfigPool (& pool ))
816
833
return ret ;
0 commit comments