Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
456
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
818d4324
Commit
818d4324
authored
5 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
vout: decklink: reuse sdi ancillary code
parent
d9c407e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/video_output/Makefile.am
+2
-0
2 additions, 0 deletions
modules/video_output/Makefile.am
modules/video_output/decklink.cpp
+4
-61
4 additions, 61 deletions
modules/video_output/decklink.cpp
with
6 additions
and
61 deletions
modules/video_output/Makefile.am
+
2
−
0
View file @
818d4324
...
...
@@ -16,6 +16,8 @@ OPENGL_COMMONLIBS = $(LIBPLACEBO_LIBS)
if
HAVE_DECKLINK
libdecklinkoutput_plugin_la_SOURCES
=
video_output/decklink.cpp
\
stream_out/sdi/Ancillary.cpp
\
stream_out/sdi/Ancillary.hpp
\
stream_out/sdi/V210.cpp
\
stream_out/sdi/V210.hpp
libdecklinkoutput_plugin_la_CXXFLAGS
=
$(
AM_CXXFLAGS
)
$(
CPPFLAGS_decklinkoutput
)
...
...
This diff is collapsed.
Click to expand it.
modules/video_output/decklink.cpp
+
4
−
61
View file @
818d4324
...
...
@@ -49,6 +49,7 @@
#include
"../access/vlc_decklink.h"
#include
"../stream_out/sdi/V210.hpp"
#include
"../stream_out/sdi/Ancillary.hpp"
#include
<DeckLinkAPIDispatch.cpp>
#define FRAME_SIZE 1920
...
...
@@ -771,66 +772,6 @@ error:
/*****************************************************************************
* Video
*****************************************************************************/
static
inline
void
put_le32
(
uint8_t
**
p
,
uint32_t
d
)
{
SetDWLE
(
*
p
,
d
);
(
*
p
)
+=
4
;
}
static
void
send_AFD
(
uint8_t
afdcode
,
uint8_t
ar
,
uint8_t
*
buf
)
{
const
size_t
len
=
6
/* vanc header */
+
8
/* AFD data */
+
1
/* csum */
;
const
size_t
s
=
((
len
+
5
)
/
6
)
*
6
;
// align for v210
uint16_t
afd
[
s
];
afd
[
0
]
=
0x000
;
afd
[
1
]
=
0x3ff
;
afd
[
2
]
=
0x3ff
;
afd
[
3
]
=
0x41
;
// DID
afd
[
4
]
=
0x05
;
// SDID
afd
[
5
]
=
8
;
// Data Count
int
bar_data_flags
=
0
;
int
bar_data_val1
=
0
;
int
bar_data_val2
=
0
;
afd
[
6
]
=
((
afdcode
&
0x0F
)
<<
3
)
|
((
ar
&
0x01
)
<<
2
);
/* SMPTE 2016-1 */
afd
[
7
]
=
0
;
// reserved
afd
[
8
]
=
0
;
// reserved
afd
[
9
]
=
bar_data_flags
<<
4
;
afd
[
10
]
=
bar_data_val1
<<
8
;
afd
[
11
]
=
bar_data_val1
&
0xff
;
afd
[
12
]
=
bar_data_val2
<<
8
;
afd
[
13
]
=
bar_data_val2
&
0xff
;
/* parity bit */
for
(
size_t
i
=
3
;
i
<
len
-
1
;
i
++
)
afd
[
i
]
|=
vlc_parity
((
unsigned
)
afd
[
i
])
?
0x100
:
0x200
;
/* vanc checksum */
uint16_t
vanc_sum
=
0
;
for
(
size_t
i
=
3
;
i
<
len
-
1
;
i
++
)
{
vanc_sum
+=
afd
[
i
];
vanc_sum
&=
0x1ff
;
}
afd
[
len
-
1
]
=
vanc_sum
|
((
~
vanc_sum
&
0x100
)
<<
1
);
/* pad */
for
(
size_t
i
=
len
;
i
<
s
;
i
++
)
afd
[
i
]
=
0x040
;
/* convert to v210 and write into VANC */
for
(
size_t
w
=
0
;
w
<
s
/
6
;
w
++
)
{
put_le32
(
&
buf
,
afd
[
w
*
6
+
0
]
<<
10
);
put_le32
(
&
buf
,
afd
[
w
*
6
+
1
]
|
(
afd
[
w
*
6
+
2
]
<<
20
));
put_le32
(
&
buf
,
afd
[
w
*
6
+
3
]
<<
10
);
put_le32
(
&
buf
,
afd
[
w
*
6
+
4
]
|
(
afd
[
w
*
6
+
5
]
<<
20
));
}
}
static
void
PrepareVideo
(
vout_display_t
*
vd
,
picture_t
*
picture
,
subpicture_t
*
,
vlc_tick_t
date
)
{
...
...
@@ -904,7 +845,9 @@ static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
msg_Err
(
vd
,
"Failed to get VBI line %d: %d"
,
line
,
result
);
goto
end
;
}
send_AFD
(
sys
->
video
.
afd
,
sys
->
video
.
ar
,
(
uint8_t
*
)
buf
);
sdi
::
AFD
afd
(
sys
->
video
.
afd
,
sys
->
video
.
ar
);
afd
.
FillBuffer
(
reinterpret_cast
<
uint8_t
*>
(
buf
),
stride
);
sdi
::
V210
::
Convert
(
picture
,
stride
,
frame_bytes
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment