qc project
This commit is contained in:
parent
a4708d0c00
commit
4d72075d60
|
@ -0,0 +1 @@
|
||||||
|
.qtc_clangd
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Created by and for Qt Creator This file was created for editing the project sources only.
|
||||||
|
# You may attempt to use it for building too, by modifying this file here.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
project(hkstreamer)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
include
|
||||||
|
)
|
||||||
|
|
||||||
|
set (SRCS
|
||||||
|
include/DataType.h
|
||||||
|
include/DecodeCardSdk.h
|
||||||
|
include/HCNetSDK.h
|
||||||
|
include/HkStreamer.h
|
||||||
|
include/plaympeg4.h
|
||||||
|
HkStreamer.cpp
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_executable(${CMAKE_PROJECT_NAME} ${SRCS})
|
||||||
|
|
BIN
HkStreamer.o
BIN
HkStreamer.o
Binary file not shown.
BIN
_obj/_cgo_.o
BIN
_obj/_cgo_.o
Binary file not shown.
19
cwrapper.go
19
cwrapper.go
|
@ -1,19 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
/*
|
|
||||||
#
|
|
||||||
#include "include/HkStreamer.h"
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
// type HkLoginInfo C.LoginInfo
|
|
||||||
// type StreamDate C.StreamDate
|
|
||||||
// type StreamCon C.StreamCon
|
|
||||||
|
|
||||||
func makeLoginInfo(deviceAddr string, user string, password string) C.LoginInfo {
|
|
||||||
ret := C.LoginInfo{}
|
|
||||||
ret.sDeviceAddress = C.CString(deviceAddr)
|
|
||||||
ret.sUser = C.CString(user)
|
|
||||||
ret.sPassword = C.CString(password)
|
|
||||||
return ret
|
|
||||||
}
|
|
BIN
hkstreamer
BIN
hkstreamer
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
-std=c17
|
|
@ -0,0 +1,2 @@
|
||||||
|
// Add predefined macros for your project here. For example:
|
||||||
|
// #define THE_ANSWER 42
|
|
@ -0,0 +1 @@
|
||||||
|
[General]
|
|
@ -0,0 +1,175 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE QtCreatorProject>
|
||||||
|
<!-- Written by QtCreator 10.0.0, 2023-03-30T18:35:13. -->
|
||||||
|
<qtcreator>
|
||||||
|
<data>
|
||||||
|
<variable>EnvironmentId</variable>
|
||||||
|
<value type="QByteArray">{b1d6c31c-e354-4f9b-a89f-0f02a67ed6d1}</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
<value type="qlonglong">0</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||||
|
<value type="QString" key="language">Cpp</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||||
|
<value type="QString" key="language">QmlJS</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||||
|
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||||
|
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||||
|
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||||
|
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||||
|
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="ClangTools">
|
||||||
|
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||||
|
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||||
|
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||||
|
<value type="int" key="ClangTools.ParallelJobs">4</value>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||||
|
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="QString" key="DeviceType">Desktop</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop (x86-darwin-generic-mach_o-32bit)</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop (x86-darwin-generic-mach_o-32bit)</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ea69aa4c-9f65-4091-af6f-c8dca7313cfe}</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/chengguang/code/hkstreamer</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">
|
||||||
|
<value type="QString">all</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericMakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">
|
||||||
|
<value type="QString">clean</value>
|
||||||
|
</valuelist>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericMakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">默认</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericBuildConfiguration</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
|
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||||
|
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||||
|
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||||
|
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||||
|
<value type="qlonglong">1</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>Version</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
</qtcreator>
|
|
@ -0,0 +1 @@
|
||||||
|
-std=c++17
|
|
@ -0,0 +1,33 @@
|
||||||
|
CMakeLists.txt
|
||||||
|
HkStreamer.cpp
|
||||||
|
include/DataType.h
|
||||||
|
include/DecodeCardSdk.h
|
||||||
|
include/HCNetSDK.h
|
||||||
|
include/HkStreamer.h
|
||||||
|
include/plaympeg4.h
|
||||||
|
lib/HCNetSDKCom/libAudioIntercom.so
|
||||||
|
lib/HCNetSDKCom/libHCAlarm.so
|
||||||
|
lib/HCNetSDKCom/libHCCoreDevCfg.so
|
||||||
|
lib/HCNetSDKCom/libHCDisplay.so
|
||||||
|
lib/HCNetSDKCom/libHCGeneralCfgMgr.so
|
||||||
|
lib/HCNetSDKCom/libHCIndustry.so
|
||||||
|
lib/HCNetSDKCom/libHCPlayBack.so
|
||||||
|
lib/HCNetSDKCom/libHCPreview.so
|
||||||
|
lib/HCNetSDKCom/libHCVoiceTalk.so
|
||||||
|
lib/HCNetSDKCom/libStreamTransClient.so
|
||||||
|
lib/HCNetSDKCom/libSystemTransform.so
|
||||||
|
lib/HCNetSDKCom/libanalyzedata.so
|
||||||
|
lib/HCNetSDKCom/libiconv2.so
|
||||||
|
lib/HCNetSDK_Log_Switch.xml
|
||||||
|
lib/libAudioRender.so
|
||||||
|
lib/libHCCore.so
|
||||||
|
lib/libNPQos.so
|
||||||
|
lib/libPlayCtrl.so
|
||||||
|
lib/libSuperRender.so
|
||||||
|
lib/libcrypto.so.1.1
|
||||||
|
lib/libhcnetsdk.so
|
||||||
|
lib/libhpr.so
|
||||||
|
lib/libopenal.so.1
|
||||||
|
lib/libssl.so.1.1
|
||||||
|
lib/libz.so
|
||||||
|
main.cpp
|
|
@ -0,0 +1 @@
|
||||||
|
include
|
199
hkstreamer.rs
199
hkstreamer.rs
|
@ -1,199 +0,0 @@
|
||||||
/* automatically generated by rust-bindgen 0.64.0 */
|
|
||||||
|
|
||||||
pub const HPR_OK: u32 = 0;
|
|
||||||
pub const HPR_ERROR: i32 = -1;
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
|
||||||
pub struct LoginInfo {
|
|
||||||
pub sDeviceAddress: [::std::os::raw::c_char; 129usize],
|
|
||||||
pub sUserName: [::std::os::raw::c_char; 64usize],
|
|
||||||
pub sPassword: [::std::os::raw::c_char; 64usize],
|
|
||||||
}
|
|
||||||
#[test]
|
|
||||||
fn bindgen_test_layout_LoginInfo() {
|
|
||||||
const UNINIT: ::std::mem::MaybeUninit<LoginInfo> = ::std::mem::MaybeUninit::uninit();
|
|
||||||
let ptr = UNINIT.as_ptr();
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::size_of::<LoginInfo>(),
|
|
||||||
257usize,
|
|
||||||
concat!("Size of: ", stringify!(LoginInfo))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::align_of::<LoginInfo>(),
|
|
||||||
1usize,
|
|
||||||
concat!("Alignment of ", stringify!(LoginInfo))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).sDeviceAddress) as usize - ptr as usize },
|
|
||||||
0usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(LoginInfo),
|
|
||||||
"::",
|
|
||||||
stringify!(sDeviceAddress)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).sUserName) as usize - ptr as usize },
|
|
||||||
129usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(LoginInfo),
|
|
||||||
"::",
|
|
||||||
stringify!(sUserName)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).sPassword) as usize - ptr as usize },
|
|
||||||
193usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(LoginInfo),
|
|
||||||
"::",
|
|
||||||
stringify!(sPassword)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
pub type LPLoginInfo = *mut LoginInfo;
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
|
||||||
pub struct StreamDate {
|
|
||||||
pub dwYear: ::std::os::raw::c_ulong,
|
|
||||||
pub dwMonth: ::std::os::raw::c_ulong,
|
|
||||||
pub dwDay: ::std::os::raw::c_ulong,
|
|
||||||
pub dwHour: ::std::os::raw::c_ulong,
|
|
||||||
pub dwMinute: ::std::os::raw::c_ulong,
|
|
||||||
pub dwSecond: ::std::os::raw::c_ulong,
|
|
||||||
}
|
|
||||||
#[test]
|
|
||||||
fn bindgen_test_layout_StreamDate() {
|
|
||||||
const UNINIT: ::std::mem::MaybeUninit<StreamDate> = ::std::mem::MaybeUninit::uninit();
|
|
||||||
let ptr = UNINIT.as_ptr();
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::size_of::<StreamDate>(),
|
|
||||||
48usize,
|
|
||||||
concat!("Size of: ", stringify!(StreamDate))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::align_of::<StreamDate>(),
|
|
||||||
8usize,
|
|
||||||
concat!("Alignment of ", stringify!(StreamDate))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwYear) as usize - ptr as usize },
|
|
||||||
0usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwYear)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwMonth) as usize - ptr as usize },
|
|
||||||
8usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwMonth)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwDay) as usize - ptr as usize },
|
|
||||||
16usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwDay)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwHour) as usize - ptr as usize },
|
|
||||||
24usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwHour)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwMinute) as usize - ptr as usize },
|
|
||||||
32usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwMinute)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).dwSecond) as usize - ptr as usize },
|
|
||||||
40usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamDate),
|
|
||||||
"::",
|
|
||||||
stringify!(dwSecond)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
pub type LStreamDate = *mut StreamDate;
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
|
||||||
pub struct StreamCon {
|
|
||||||
pub lChannel: ::std::os::raw::c_ulong,
|
|
||||||
pub start: StreamDate,
|
|
||||||
pub end: StreamDate,
|
|
||||||
}
|
|
||||||
#[test]
|
|
||||||
fn bindgen_test_layout_StreamCon() {
|
|
||||||
const UNINIT: ::std::mem::MaybeUninit<StreamCon> = ::std::mem::MaybeUninit::uninit();
|
|
||||||
let ptr = UNINIT.as_ptr();
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::size_of::<StreamCon>(),
|
|
||||||
104usize,
|
|
||||||
concat!("Size of: ", stringify!(StreamCon))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
::std::mem::align_of::<StreamCon>(),
|
|
||||||
8usize,
|
|
||||||
concat!("Alignment of ", stringify!(StreamCon))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).lChannel) as usize - ptr as usize },
|
|
||||||
0usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamCon),
|
|
||||||
"::",
|
|
||||||
stringify!(lChannel)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
|
|
||||||
8usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamCon),
|
|
||||||
"::",
|
|
||||||
stringify!(start)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize },
|
|
||||||
56usize,
|
|
||||||
concat!(
|
|
||||||
"Offset of field: ",
|
|
||||||
stringify!(StreamCon),
|
|
||||||
"::",
|
|
||||||
stringify!(end)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
pub type LPStream = *mut StreamCon;
|
|
||||||
extern "C" {
|
|
||||||
pub fn playback(loginInfo: LPLoginInfo, stream: LPStream) -> ::std::os::raw::c_int;
|
|
||||||
}
|
|
2
main.cpp
2
main.cpp
|
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
|
||||||
error("Must set device address");
|
error("Must set device address");
|
||||||
}
|
}
|
||||||
LoginInfo loginInfo = {0};
|
LoginInfo loginInfo = {0};
|
||||||
strcpy(loginInfo.sDeviceAddress, pMap.at("d").c_str());
|
strlcpy(loginInfo.sDeviceAddress, pMap.at("d").c_str(), sizeof(pMap.at("d").c_str()));
|
||||||
strcpy(loginInfo.sUserName, pMap.at("u").c_str());
|
strcpy(loginInfo.sUserName, pMap.at("u").c_str());
|
||||||
strcpy(loginInfo.sPassword, pMap.at("p").c_str());
|
strcpy(loginInfo.sPassword, pMap.at("p").c_str());
|
||||||
if (cmd == "playback")
|
if (cmd == "playback")
|
||||||
|
|
Loading…
Reference in New Issue