Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MomentaMedia
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
景炳强
MomentaMedia
Commits
10de5c3b
Commit
10de5c3b
authored
Dec 05, 2022
by
景炳强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.解决黑闪屏问题 2.解决开机第一次启动不能输出问题
parent
02accdae
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
5 deletions
+27
-5
MomentaMedia/MomentaMedia.log
+0
-0
MomentaMedia/MomentaMedia.vcxproj
+1
-1
MomentaMedia/include/BlackMagicDesign/DeckLinkInputDevice.h
+1
-0
MomentaMedia/include/BlackMagicDesign/DeckLinkOutputDevice.h
+1
-0
MomentaMedia/src/BlackMagicDesign/DeckLinkInputDevice.cpp
+19
-1
MomentaMedia/src/BlackMagicDesign/DeckLinkOutputDevice.cpp
+4
-2
MomentaMedia/src/MomentaMedia.cpp
+1
-1
No files found.
MomentaMedia/MomentaMedia.log
View file @
10de5c3b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
MomentaMedia/MomentaMedia.vcxproj
View file @
10de5c3b
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
<Link>
<Link>
<AdditionalLibraryDirectories>.\ThirdParty\libyuv\lib;.\ThirdParty\OpenCV\x64\vc15\lib;.\ThirdParty\NewTek\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>.\ThirdParty\libyuv\lib;.\ThirdParty\OpenCV\x64\vc15\lib;.\ThirdParty\NewTek\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Processing.NDI.Lib.Advanced.x64.lib;opencv_world460.lib;yuv.lib;jpeg.lib;%(AdditionalDependencies);$(Qt_LIBS_)</AdditionalDependencies>
<AdditionalDependencies>Processing.NDI.Lib.Advanced.x64.lib;opencv_world460.lib;yuv.lib;jpeg.lib;%(AdditionalDependencies);$(Qt_LIBS_)</AdditionalDependencies>
<UACExecutionLevel>
RequireAdministrato
r</UACExecutionLevel>
<UACExecutionLevel>
AsInvoke
r</UACExecutionLevel>
</Link>
</Link>
</ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
...
...
MomentaMedia/include/BlackMagicDesign/DeckLinkInputDevice.h
View file @
10de5c3b
...
@@ -85,6 +85,7 @@ private:
...
@@ -85,6 +85,7 @@ private:
//std::thread thd;
//std::thread thd;
int
Index
;
int
Index
;
bool
PrevInputSignalAbsent
;
};
};
...
...
MomentaMedia/include/BlackMagicDesign/DeckLinkOutputDevice.h
View file @
10de5c3b
...
@@ -105,4 +105,5 @@ private:
...
@@ -105,4 +105,5 @@ private:
qint32
Device_id
;
qint32
Device_id
;
qint32
output_deley_ms
;
//
qint32
output_deley_ms
;
//
qint32
audio_max_size
;
qint32
audio_max_size
;
BMDDisplayMode
outputDisplayMode
;
};
};
MomentaMedia/src/BlackMagicDesign/DeckLinkInputDevice.cpp
View file @
10de5c3b
...
@@ -20,7 +20,8 @@ DeckLinkInputDevice::DeckLinkInputDevice(QObject* parent, ComPtr<IDeckLink>& dev
...
@@ -20,7 +20,8 @@ DeckLinkInputDevice::DeckLinkInputDevice(QObject* parent, ComPtr<IDeckLink>& dev
bLastValidFrameStatus
(
false
),
bLastValidFrameStatus
(
false
),
SupportedInputConnections
(
bmdVideoConnectionUnspecified
),
SupportedInputConnections
(
bmdVideoConnectionUnspecified
),
SelectedInputConnection
(
bmdVideoConnectionUnspecified
),
SelectedInputConnection
(
bmdVideoConnectionUnspecified
),
Index
(
index
)
Index
(
index
),
PrevInputSignalAbsent
(
false
)
{
{
//thd = std::thread(&DeckLinkInputDevice::ForwardThread, this);
//thd = std::thread(&DeckLinkInputDevice::ForwardThread, this);
}
}
...
@@ -83,11 +84,28 @@ HRESULT DeckLinkInputDevice::VideoInputFrameArrived(IDeckLinkVideoInputFrame* vi
...
@@ -83,11 +84,28 @@ HRESULT DeckLinkInputDevice::VideoInputFrameArrived(IDeckLinkVideoInputFrame* vi
//emit ArrivedFrame(frame);
//emit ArrivedFrame(frame);
if
(
videoFrame
&&
Capture
)
{
if
(
videoFrame
&&
Capture
)
{
unsigned
flags
=
videoFrame
->
GetFlags
();
unsigned
flags
=
videoFrame
->
GetFlags
();
bool
noInputSourceFlag
=
false
;
if
(
flags
&
bmdFrameHasNoInputSource
)
if
(
flags
&
bmdFrameHasNoInputSource
)
{
qDebug
()
<<
GetCurrDateTimeStr
()
<<
"index: "
<<
Index
<<
" DeckLinkInputDevice get video frame No input source "
<<
hex
<<
flags
<<
" ------------
\n
"
;
qDebug
()
<<
GetCurrDateTimeStr
()
<<
"index: "
<<
Index
<<
" DeckLinkInputDevice get video frame No input source "
<<
hex
<<
flags
<<
" ------------
\n
"
;
noInputSourceFlag
=
true
;
}
bool
restartStream
=
!
noInputSourceFlag
&&
PrevInputSignalAbsent
;
if
(
restartStream
)
{
DeckLinkInput
->
StopStreams
();
DeckLinkInput
->
FlushStreams
();
DeckLinkInput
->
StartStreams
();
}
PrevInputSignalAbsent
=
noInputSourceFlag
;
if
(
!
noInputSourceFlag
)
{
auto
cur_time
=
QDateTime
::
currentMSecsSinceEpoch
();
auto
cur_time
=
QDateTime
::
currentMSecsSinceEpoch
();
Capture
->
AddFrame
(
frame
,
cur_time
);
Capture
->
AddFrame
(
frame
,
cur_time
);
}
}
}
if
(
audioPacket
)
if
(
audioPacket
)
{
{
//qDebug() << "DeckLinkInputDevice get audio packet--------------" << "\n";
//qDebug() << "DeckLinkInputDevice get audio packet--------------" << "\n";
...
...
MomentaMedia/src/BlackMagicDesign/DeckLinkOutputDevice.cpp
View file @
10de5c3b
...
@@ -129,7 +129,7 @@ HRESULT DeckLinkOutputDevice::ScheduledPlaybackHasStopped()
...
@@ -129,7 +129,7 @@ HRESULT DeckLinkOutputDevice::ScheduledPlaybackHasStopped()
bool
DeckLinkOutputDevice
::
StartPlayback
(
BMDDisplayMode
displayMode
,
bool
enable3D
,
BMDPixelFormat
pixelFormat
,
bool
requireReferenceLocked
,
IDeckLinkScreenPreviewCallback
*
screenPreviewCallback
)
bool
DeckLinkOutputDevice
::
StartPlayback
(
BMDDisplayMode
displayMode
,
bool
enable3D
,
BMDPixelFormat
pixelFormat
,
bool
requireReferenceLocked
,
IDeckLinkScreenPreviewCallback
*
screenPreviewCallback
)
{
{
BMDDisplayMode
outputDisplayMode
;
//
BMDDisplayMode outputDisplayMode;
#if OUTPUT_1080
#if OUTPUT_1080
switch
(
OutputPlayMode
)
switch
(
OutputPlayMode
)
...
@@ -353,7 +353,7 @@ bool DeckLinkOutputDevice::getReferenceSignalMode(BMDDisplayMode* mode)
...
@@ -353,7 +353,7 @@ bool DeckLinkOutputDevice::getReferenceSignalMode(BMDDisplayMode* mode)
//std::lock_guard<std::mutex> locker(mutex);
//std::lock_guard<std::mutex> locker(mutex);
current_video_time
=
outputImage
->
getInputFrameCurTimeStamp
();
current_video_time
=
outputImage
->
getInputFrameCurTimeStamp
();
ComPtr
<
DeckLinkOutputVideoFrame
>
videoFrame
=
MakeComPtr
<
DeckLinkOutputVideoFrame
>
(
outputImage
);
ComPtr
<
DeckLinkOutputVideoFrame
>
videoFrame
=
MakeComPtr
<
DeckLinkOutputVideoFrame
>
(
outputImage
);
videoFrame
->
GetFlags
();
// Record the stream time of the first frame, so we can start playing from the point
// Record the stream time of the first frame, so we can start playing from the point
//if(!seenFirstVideoFrame)
//if(!seenFirstVideoFrame)
//{
//{
...
@@ -378,6 +378,8 @@ bool DeckLinkOutputDevice::getReferenceSignalMode(BMDDisplayMode* mode)
...
@@ -378,6 +378,8 @@ bool DeckLinkOutputDevice::getReferenceSignalMode(BMDDisplayMode* mode)
else
if
(
ret
==
E_FAIL
)
else
if
(
ret
==
E_FAIL
)
{
{
qDebug
()
<<
"Failure."
<<
"
\n
"
;
qDebug
()
<<
"Failure."
<<
"
\n
"
;
deckLinkOutput
->
DisableVideoOutput
();
deckLinkOutput
->
EnableVideoOutput
(
outputDisplayMode
,
bmdVideoOutputFlagDefault
);
}
}
else
else
{
{
...
...
MomentaMedia/src/MomentaMedia.cpp
View file @
10de5c3b
...
@@ -26,7 +26,7 @@ std::map<qint32, qint32> map_scale_mode;
...
@@ -26,7 +26,7 @@ std::map<qint32, qint32> map_scale_mode;
int
main_ver
=
1
;
int
main_ver
=
1
;
int
mid_ver
=
0
;
int
mid_ver
=
0
;
int
small_ver
=
2
;
int
small_ver
=
4
;
MomentaMedia
::
MomentaMedia
(
QWidget
*
parent
)
MomentaMedia
::
MomentaMedia
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
:
QMainWindow
(
parent
)
...
...
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