5555555555555555555555555

博客提供了hao123的网址链接,即http://www.hao123.com/ 。
http://www.hao123.com/
Widget buildCaptureButton({ required BuildContext context, required BoxConstraints constraints, }) { final showProgressIndicator = isCaptureButtonTapDown || MediaQuery.accessibleNavigationOf(context); if (!showProgressIndicator && isRecordingVideo) { return const SizedBox.shrink(); } const size = Size.square(82.0); return MergeSemantics( child: Semantics( label: isRecordingVideo ? textDelegate.sActionStopRecordingHint : textShootingButtonLabel, button: true, onTap: onTap, onTapHint: onTapHint, onLongPress: onLongPress, onLongPressHint: onLongPressHint, child: Listener( behavior: HitTestBehavior.opaque, onPointerUp: onPointerUp, onPointerMove: onPointerMove(constraints), child: GestureDetector( onTap: onTap, onLongPress: onLongPress, onTapDown: (_) => safeSetState(() { isCaptureButtonTapDown = true; print("lal 111111111111111111 按下"); } ), onTapUp: (_) => safeSetState(() { if (!enableTapRecording) { isCaptureButtonTapDown = false; print("lal 222222222222222222222222抬起"); } }), onTapCancel: () => safeSetState(() { isCaptureButtonTapDown = false; print("lal 33333333333333333333取消点击");}), onLongPressStart: (_) => safeSetState((){ isCaptureButtonTapDown = true; print("lal 444444444444444444444444444444长按开始");}), onLongPressEnd: (_) => safeSetState(() {isCaptureButtonTapDown = false; print("lal 5555555555555555555555555长按结束");}), onLongPressCancel: () => safeSetState(() {isCaptureButtonTapDown = false; print("lal 6666666666666666666666666666666取消长按");}), child: SizedBox.fromSize( size: size, child: Stack( fit: StackFit.expand, children: [ AnimatedContainer( duration: const Duration(microseconds: 100), padding: EdgeInsets.all(isCaptureButtonTapDown ? 16 : 8), decoration: BoxDecoration( border: Border.all( color: Colors.white, strokeAlign: BorderSide.strokeAlignCenter, width: 2, ), shape: BoxShape.circle, ), child: const DecoratedBox( decoration: BoxDecoration( color: Colors.white, shape: BoxShape.circle, ), ), ), if (shouldCaptureButtonDisplay) RotatedBox( quarterTurns: enableScaledPreview ? 0 : cameraQuarterTurns, child: CameraProgressButton( isAnimating: showProgressIndicator && isShootingButtonAnimate, duration: pickerConfig.maximumRecordingDuration!, size: size, // ignore: deprecated_member_use ringsColor: Theme.of(context).indicatorColor, ringsWidth: 3, ), ), ], ), ), ), ), ), ); } 如何可以检测这个按钮是正常显示在ui上的
11-12
int CONFIG_VENC_CHN_ATTR(int VencChn, ENCODERCONFIG *compess) { HI_U8 flag = 0; HI_S32 s32Ret; VENC_CHN_ATTR_S stVencChnAttr; VENC_RECV_PIC_PARAM_S stRecvParam; HI_U32 u32StatTime = 1; //编码类型 PAYLOAD_TYPE_E enType; PAYLOAD_TYPE_E curenType; if(compess->encoderType==1) { enType =PT_H264; } else if(compess->encoderType==8) { enType =PT_H265; } SIZE_S stPicSize; stPicSize.u32Height=compess->height; stPicSize.u32Width=compess->width; //码率类型 unsigned int enRcMode =compess->bitType; HI_FR32 u32FrameRate = compess->videoEncoder.videoFrameRate; HI_U16 u32Gop = compess->videoEncoder.intervalFrameI; HI_U32 u32BitRate = compess->videoEncoder.maxVideoBitrate; MPP_CHN_S stSrcChn; stSrcChn.enModId = HI_ID_VPSS; stSrcChn.s32DevId = 0; stSrcChn.s32ChnId = 0; curenType=stVencChnAttr.stVencAttr.enType; printf("----curenType=%d enType=%d\n",curenType,enType); flag = 1; s32Ret = HI_MPI_VENC_StopRecvFrame(VencChn); if (HI_SUCCESS != s32Ret) { printf("HI_MPI_VENC_StopRecvPic vechn[%d] failed with %#x!\n", \ VencChn, s32Ret); return s32Ret; } printf("HI_MPI_VENC_StopRecvFrame success\n"); bcloseconsock=1; int i= 0; for ( i = 0; i < 8; i++) { s32Ret = HI_MPI_RGN_DetachFromChn(20+(VencChn%3)*10+i, &stSrcChn); if(HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_RGN_DetachFromChn failed with region = %d s32Ret: 0x%x.\n", i, s32Ret); return HI_FAILURE; } } VPSS_GRP VpssGrp = 0; VPSS_CHN VpssChn = VPSS_CHN0; memset(&stVencChnAttr,0,sizeof(VENC_CHN_ATTR_S)); stVencChnAttr.stVencAttr.enType = enType; stVencChnAttr.stVencAttr.u32MaxPicWidth = stPicSize.u32Width; stVencChnAttr.stVencAttr.u32MaxPicHeight = stPicSize.u32Height; stVencChnAttr.stVencAttr.u32PicWidth = stPicSize.u32Width;/*the picture width*/ stVencChnAttr.stVencAttr.u32PicHeight = stPicSize.u32Height;/*the picture height*/ stVencChnAttr.stVencAttr.u32BufSize = stPicSize.u32Width * stPicSize.u32Height * 2;/*stream buffer size*/ stVencChnAttr.stVencAttr.u32Profile = 0; stVencChnAttr.stVencAttr.bByFrame = HI_TRUE;/*get stream mode is slice mode or frame mode?*/ #if 1 switch(enType) { case PT_H264: { if (VENC_RC_MODE_H264CBR == enRcMode) { printf("-----h264 VENC_RC_MODE_H264CBR\n"); if(stVencChnAttr.stRcAttr.enRcMode==VENC_RC_MODE_H264CBR) { stVencChnAttr.stRcAttr.stH264Cbr.u32Gop = u32Gop; if(u32FrameRate > stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRate) { stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRate = u32FrameRate; stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRate = u32FrameRate; } else { stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRate = u32FrameRate; } stVencChnAttr.stRcAttr.stH264Cbr.u32BitRate = u32BitRate; } else { stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264CBR; stVencChnAttr.stRcAttr.stH264Cbr.u32Gop = u32Gop; if(u32FrameRate > stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRate) { stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRate = u32FrameRate; stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRate = u32FrameRate; } else { stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRate = u32FrameRate; } stVencChnAttr.stRcAttr.stH264Cbr.u32BitRate = u32BitRate; } } else if (VENC_RC_MODE_H264VBR == enRcMode) { printf("-----h264 VENC_RC_MODE_H264VBR\n"); if(stVencChnAttr.stRcAttr.enRcMode==VENC_RC_MODE_H264VBR) { printf("-----1111111111111111111111\n"); stVencChnAttr.stRcAttr.stH264Vbr.u32Gop = u32Gop; if(u32FrameRate > stVencChnAttr.stRcAttr.stH264Vbr.u32SrcFrameRate) { printf("-----22222222222222222222\n"); stVencChnAttr.stRcAttr.stH264Vbr.u32SrcFrameRate = u32FrameRate; stVencChnAttr.stRcAttr.stH264Vbr.fr32DstFrameRate = u32FrameRate; } else { printf("-----333333333333333333333333\n"); stVencChnAttr.stRcAttr.stH264Vbr.fr32DstFrameRate = u32FrameRate; } stVencChnAttr.stRcAttr.stH264Vbr.u32MaxBitRate = u32BitRate; } else { printf("-----4444444444444444444444444444\n"); stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264VBR; stVencChnAttr.stRcAttr.stH264Vbr.u32Gop = u32Gop; if(u32FrameRate > stVencChnAttr.stRcAttr.stH264Vbr.u32SrcFrameRate) { printf("-----5555555555555555555555555\n"); stVencChnAttr.stRcAttr.stH264Vbr.u32SrcFrameRate = u32FrameRate; stVencChnAttr.stRcAttr.stH264Vbr.fr32DstFrameRate = u32FrameRate; } else { printf("-----66666666666666666666666666\n"); stVencChnAttr.stRcAttr.stH264Vbr.fr32DstFrameRate = u32FrameRate; } stVencChnAttr.stRcAttr.stH264Vbr.u32MaxBitRate = u32BitRate; } } break; default: SAMPLE_PRT("cann't support this enType (%d) in this version!\n",enType); return HI_ERR_VENC_NOT_SUPPORT; } #endif usleep(10000); s32Ret = HI_MPI_VENC_SetChnAttr(VencChn, &stVencChnAttr); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VENC_SetChn[%d]Attr faild with %#x! ===\n", \ VencChn, s32Ret); return s32Ret; } s32Ret = HI_MPI_VENC_GetChnAttr(VencChn,&stVencChnAttr); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VENC_GetChnATTR[%d] failed with %#x!\n", \ VencChn, s32Ret); return s32Ret; } if(flag == 1) { int i= 0; for ( i = 0; i < 8; i++) { s32Ret = HI_MPI_RGN_AttachToChn(20+(VencChn%3)*10+i, &stSrcChn, &g_stChnAttr[VencChn%3][i]); if (s32Ret != HI_SUCCESS) { SAMPLE_PRT("HI_MPI_RGN_AttachToChn failed! region = %d s32Ret: 0x%x.\n", i, s32Ret); return s32Ret; } } stRecvParam.s32RecvPicNum = -1; s32Ret = HI_MPI_VENC_StartRecvFrame(VencChn, &stRecvParam); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VENC_StartRecvPic faild with%#x! \n", s32Ret); return s32Ret; } } printf("CONFIG_VENC_CHN_ATTR is success!!!\n"); return s32Ret; }
11-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值