Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
H2V
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王国涛-悦动
H2V
Commits
1e65d165
Commit
1e65d165
authored
Feb 21, 2024
by
wangguotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.modify audio channel list of sdk support values 2.add check ndi audio buffer size
parent
eb0862e1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
11 deletions
+22
-11
MomentaMedia/include/NDI/NDIOutputThread.h
+1
-0
MomentaMedia/src/MomentaMedia.cpp
+10
-8
MomentaMedia/src/NDI/NDIOutputThread.cpp
+10
-2
x64/Release/settings.ini
+1
-1
x64/Release/高清裁切引擎.exe
+0
-0
x64/Release/高清裁切引擎.ilk
+0
-0
x64/Release/高清裁切引擎.pdb
+0
-0
No files found.
MomentaMedia/include/NDI/NDIOutputThread.h
View file @
1e65d165
...
...
@@ -58,6 +58,7 @@ private:
NDIlib_send_instance_t
Instance
;
NDIlib_video_frame_v2_t
Frame
;
NDIlib_audio_frame_v3_t
AudioFrame
;
uint32_t
audio_size
{
0
};
std
::
shared_ptr
<
AudioConvert
>
AudioCvtPtr
;
std
::
thread
audio_thread
;
...
...
MomentaMedia/src/MomentaMedia.cpp
View file @
1e65d165
...
...
@@ -32,7 +32,7 @@ bool HaveBlackDataFlag = true;
int
main_ver
=
2
;
int
mid_ver
=
0
;
int
small_ver
=
4
;
int
small_ver
=
5
;
bool
scale_enable
=
true
;
std
::
atomic_bool
bk_flag
=
false
;
...
...
@@ -40,7 +40,7 @@ cv::Mat bk_mat;
namespace
{
const
std
::
vector
<
QString
>
AudioChannels
=
{
"
1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
};
const
std
::
vector
<
QString
>
AudioChannels
=
{
"
2"
,
"8"
,
"16"
,
"32"
,
"64"
};
}
MomentaMedia
::
MomentaMedia
(
QWidget
*
parent
)
...
...
@@ -133,12 +133,14 @@ MomentaMedia::MomentaMedia(QWidget *parent)
//OutputModeCheck->setChecked(mode);
for
(
auto
channel
:
AudioChannels
)
{
AudioChannelCombo
->
addItem
(
channel
);
int
ch_index
=
0
;
for
(
int
i
=
0
;
i
<
AudioChannels
.
size
();
i
++
)
{
auto
str
=
AudioChannels
[
i
];
if
(
str
==
QString
::
number
(
channel
))
ch_index
=
i
;
AudioChannelCombo
->
addItem
(
str
);
}
AudioChannelCombo
->
setCurrentIndex
(
ch
annel
-
1
);
AudioChannelCombo
->
setCurrentIndex
(
ch
_index
);
connect
(
AudioChannelCombo
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
MomentaMedia
::
AudioChannelChanged
);
OutputModeCombo
->
addItem
(
QString
::
fromWCharArray
(
L"跟随输入格式"
));
...
...
@@ -743,7 +745,7 @@ void MomentaMedia::ReadSettings()
else if (BlackBottomHeight > 480) BlackBottomHeight = 480;*/
AudioChannel
=
settings
.
value
(
"AUDIO_CHANNEL"
).
toInt
();
if
(
AudioChannel
<=
0
||
AudioChannel
>
20
)
AudioChannel
=
2
;
if
(
AudioChannel
<=
0
)
AudioChannel
=
2
;
//PrvwFlag = settings.value("PRVW_FLAG", "").toInt();
...
...
MomentaMedia/src/NDI/NDIOutputThread.cpp
View file @
1e65d165
...
...
@@ -11,7 +11,7 @@ extern qint64 StartTimeStamp;
extern
int
AudioChannel
;
extern
int
FrameRate
;
#define SAMPLE
24
00
#define SAMPLE
96
00
#define SAMPLERATE 48000
NDIOutputThread
::
NDIOutputThread
(
const
QString
&
Name
,
int
w
,
int
h
,
qint32
deleyTime
)
:
NDISenderName
(
Name
),
width
(
w
),
height
(
h
),
deleyTime_
(
deleyTime
),
isSending
(
false
),
Instance
(
nullptr
),
cropFlag
(
false
),
AudioCvtPtr
(
nullptr
)
...
...
@@ -96,7 +96,8 @@ bool NDIOutputThread::Init()
AudioFrame
.
FourCC
=
NDIlib_FourCC_audio_type_FLTP
;
AudioFrame
.
no_channels
=
AudioChannel
;
AudioFrame
.
sample_rate
=
SAMPLERATE
;
AudioFrame
.
p_data
=
(
uint8_t
*
)
malloc
(
AudioChannel
*
SAMPLE
*
sizeof
(
float
));
audio_size
=
AudioChannel
*
SAMPLE
*
sizeof
(
float
);
AudioFrame
.
p_data
=
(
uint8_t
*
)
malloc
(
audio_size
);
AudioCvtPtr
=
std
::
make_shared
<
AudioConvert
>
(
AudioFrame
.
no_channels
,
bmdAudioSampleType32bitInteger
);
}
...
...
@@ -116,6 +117,13 @@ void NDIOutputThread::SendAudioFunc()
auto
audio_tm
=
frame
->
frame_time_stamp
;
auto
dst_data
=
AudioFrame
.
p_data
;
if
(
audio_size
<
size
)
{
if
(
AudioFrame
.
p_data
)
free
(
AudioFrame
.
p_data
);
audio_size
=
size
;
AudioFrame
.
p_data
=
(
uint8_t
*
)
malloc
(
audio_size
);
}
if
(
AudioCvtPtr
)
{
AudioCvtPtr
->
SetParams
(
frame
->
channel
,
bmdAudioSampleType32bitInteger
);
...
...
x64/Release/settings.ini
View file @
1e65d165
...
...
@@ -4,7 +4,7 @@ FRAME_RATE=50
PRVW_FLAG
=
0
OUTPUT_PLAY_MODE
=
0
BLACK_BOTTOM_HEIGHT
=
0
AUDIO_CHANNEL
=
1
AUDIO_CHANNEL
=
8
ASPEC_DEN
=
9
ASPEC_NUM
=
16
SCALE_MODE
=
0
...
...
x64/Release/高清裁切引擎.exe
View file @
1e65d165
No preview for this file type
x64/Release/高清裁切引擎.ilk
View file @
1e65d165
No preview for this file type
x64/Release/高清裁切引擎.pdb
View file @
1e65d165
No preview for this file type
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