Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
offcntools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李维杰
offcntools
Commits
e133208f
Commit
e133208f
authored
Apr 14, 2023
by
李维杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将mqtt地址放到配置文件里
parent
7ac30709
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
14 deletions
+27
-14
cmd_transport_mqtt.cpp
thirdparty/mqtt/cmd_transport_mqtt.cpp
+4
-4
cmd_transport_mqtt.h
thirdparty/mqtt/cmd_transport_mqtt.h
+3
-1
global_data.h
wb_rebuild/global_data.h
+4
-0
rebuild_manager.cpp
wb_rebuild/rebuild_manager.cpp
+2
-2
wb_rebuild.cpp
wb_rebuild/wb_rebuild.cpp
+2
-2
wb_rebuild.vcxproj
wb_rebuild/wb_rebuild.vcxproj
+1
-1
wb_rebuild_config.ini
wb_rebuild/wb_rebuild_config.ini
+5
-3
读我.txt
wb_rebuild/读我.txt
+6
-1
No files found.
thirdparty/mqtt/cmd_transport_mqtt.cpp
View file @
e133208f
#include "cmd_transport_mqtt.h"
static
const
std
::
string
kMqttUrl
=
"mqq-large.offcncloud.com"
;
//"47.95.181.254";
//static const std::string kMqttUrl = "mqq-large-cdn.offcncloud.com";//"mqq-large.offcncloud.com";//"47.95.181.254";
static
const
std
::
string
kUseName
=
"admin"
;
static
const
std
::
string
kPassWord
=
"admin"
;
static
const
std
::
string
kTopicServer
=
"whiteboard/c50d86590070538228fdfa19978a87e3/liweijieisvip_309485708"
;
//"rtc_server";
//static const std::string kTopicServer = "whiteboard/c50d86590070538228fdfa19978a87e3/liweijieisvip_309485708";//"rtc_server";
static
struct
Options
{
...
...
@@ -22,11 +22,11 @@ CmdTransportMqtt::CmdTransportMqtt(std::string uu_id, std::string room_id, Trans
{
mqtt_client_
=
NULL
;
}
bool
CmdTransportMqtt
::
ConnectServer
(
)
bool
CmdTransportMqtt
::
ConnectServer
(
std
::
string
mqtt
)
{
options
.
connection
=
(
char
*
)
malloc
(
128
);
memset
(
options
.
connection
,
0
,
128
);
memcpy
(
options
.
connection
,
kMqttUrl
.
c_str
(),
kMqttUrl
.
size
());
memcpy
(
options
.
connection
,
mqtt
.
c_str
(),
mqtt
.
size
());
options
.
verbose
=
0
;
options
.
test_no
=
-
1
;
...
...
thirdparty/mqtt/cmd_transport_mqtt.h
View file @
e133208f
...
...
@@ -17,7 +17,7 @@ public:
CmdTransportMqtt
(
std
::
string
uu_id
,
std
::
string
room_id
,
TransportObserver
*
observer
);
public
:
bool
ConnectServer
(
);
bool
ConnectServer
(
std
::
string
mqtt
);
bool
SendRequest
(
std
::
string
req
);
void
DisConnectServer
();
...
...
@@ -40,6 +40,7 @@ private:
TransportObserver
*
observer_
;
private
:
std
::
string
mqtt_url_
;
std
::
string
uu_id_
;
std
::
string
room_id_
;
};
\ No newline at end of file
wb_rebuild/global_data.h
View file @
e133208f
...
...
@@ -3,6 +3,7 @@
#include <string>
#include "json/json.h"
const
std
::
string
kMqttUrl
=
"mqtt_url"
;
const
std
::
string
kRoomId
=
"roomid"
;
const
std
::
string
kUuId
=
"uuid"
;
const
std
::
string
kFilePath
=
"filepath"
;
...
...
@@ -76,6 +77,7 @@ public:
return
false
;
}
m_sMqttUrl
=
root
[
kMqttUrl
].
asString
();
m_sRoomId
=
root
[
kRoomId
].
asString
();
m_sUuId
=
root
[
kUuId
].
asString
();
m_sFilePath
=
root
[
kFilePath
].
asString
();
...
...
@@ -88,12 +90,14 @@ public:
return
true
;
}
std
::
string
MqttUrl
()
{
return
m_sMqttUrl
;
}
std
::
string
RoomId
()
{
return
m_sRoomId
;
}
std
::
string
UuId
()
{
return
m_sUuId
;
}
std
::
string
FilePath
()
{
return
m_sFilePath
;
}
std
::
string
MediaKey
()
{
return
m_sMediaKey
;
}
private
:
std
::
string
m_sMqttUrl
;
std
::
string
m_sRoomId
;
std
::
string
m_sUuId
;
std
::
string
m_sFilePath
;
...
...
wb_rebuild/rebuild_manager.cpp
View file @
e133208f
...
...
@@ -29,7 +29,7 @@ bool RebuildManager::Init()
bool
RebuildManager
::
ConnectMqttServer
()
{
if
(
!
m_pMqtt
)
return
false
;
if
(
!
m_pMqtt
->
ConnectServer
(
))
return
false
;
if
(
!
m_pMqtt
->
ConnectServer
(
m_configData
.
MqttUrl
()))
return
false
;
return
true
;
}
...
...
@@ -76,7 +76,7 @@ void RebuildManager::DoRunning()
int
nRet
=
m_fileReader
.
ReadFile
(
pkt
);
if
(
nRet
==
-
1
)
{
printf
(
"
End of media file ...
\n
"
);
printf
(
"
end of media file ...
\n
"
);
m_fileReader
.
SetEof
(
true
);
}
else
...
...
wb_rebuild/wb_rebuild.cpp
View file @
e133208f
...
...
@@ -54,12 +54,12 @@ int main()
manager
->
CloseMediaFile
();
manager
->
DisConnectMqttServer
();
printf
(
"
Mission completed ...!"
);
printf
(
"
mission completed ...!"
);
Error
:
delete
manager
;
printf
(
"
Press enter key to exit ...
\n
"
);
printf
(
"
press enter key to exit ...
\n
"
);
getchar
();
return
0
;
}
wb_rebuild/wb_rebuild.vcxproj
View file @
e133208f
...
...
@@ -23,7 +23,7 @@
<ProjectGuid>
{ACEF3A8B-D0B7-4F9B-A37B-1546D99A6BCA}
</ProjectGuid>
<Keyword>
Win32Proj
</Keyword>
<RootNamespace>
wbrebuild
</RootNamespace>
<WindowsTargetPlatformVersion>
10.0.
19041.0
</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>
10.0.
22621.0
</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
...
...
wb_rebuild/wb_rebuild_config.ini
View file @
e133208f
{
"roomid":"3ae42ba21356a02a9535092b0c6b777b",
"mqtt_url":"mqq-large.offcncloud.com",
"roomid":"b9d36b0a22268130643765deca9a03b2",
"uuid":"liweijieisvip_309",
"filepath":"https://vod-live.offcncloud.com/vod/20211109037879836/vod/47a480ebd9a2c46912ac21836aaeb22e/index.m3u8",
"key":"
7b539939e9103688"
"filepath":"https://live-record-offcncloud.bj.bcebos.com/bd-play.offcncloud.com/pro/2023040373900774/record/index_t.m3u8"
"key":"
ts加密key"
}
\ No newline at end of file
wb_rebuild/读我.txt
View file @
e133208f
1 将 w
b_rebuild_config.ini 拷贝到当前目录
1 将 w
b_rebuild_config.ini 拷贝到当前目录
...
...
@@ -2,3 +2,7 @@
2 修改配置文件内容
3 将thirdparty下的相关dll放到当前目录
4 启动exe
注意:
配置文件中的key为加密的ts文件的key,没有则删掉;
uuid可以随机填写一个
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment