海康威视的sdk中java版本Demo的Bug

来源:互联网 发布:html5 微场景源码 编辑:程序博客网 时间:2024/05/29 16:27

最近用海康威视的sdk二次开发,发现其官方提供的java版本的demo存在bug:

在按文件回放那里,搜索录像机上的录像文件,无论如何都搜索不到,是因为那个下拉框选择录像类型和文件属性那里有错误;

选全部,应该传0xff,可他传的是0,当然什么都搜索不到了;

另外,通道号是从33开始的!

附上代码:JDialogPlayBack类中jButtonSearchActionPerformed方法修改

m_strFilecond.struStopTime.dwSecond = Integer.parseInt(jTextFieldeSecond.getText());m_strFilecond.lChannel = new NativeLong(Integer.parseInt(jTextFieldChannelNumber.getText()));// 通道号int selectedIndex = jComboBoxFlieType.getSelectedIndex();// 录像类型if (selectedIndex == 0) {selectedIndex = 0xff;}m_strFilecond.dwFileType = selectedIndex;int selectedIndex2 = jComboBoxRecodType.getSelectedIndex();// 是否枷锁if (selectedIndex2 == 0) {selectedIndex2 = 0xff;}m_strFilecond.dwIsLocked = selectedIndex2;m_strFilecond.dwUseCardNo = jRadioButtonByCardNumber.isSelected() ? 1 : 0; // 是否使用卡号if (m_strFilecond.dwUseCardNo == 1) {m_strFilecond.sCardNumber = jTextFieldCardNumber.getText().getBytes();// 卡号System.out.printf("卡号%s", m_strFilecond.sCardNumber);}


ok。


0 0