Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
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
Linshizhi
ffmpeg.wasm-core
Commits
fc93eca1
Commit
fc93eca1
authored
Jan 15, 2018
by
Vishwanath Dixit
Committed by
Marton Balint
Jan 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/decklink: addition of absolute wallclock option for pts source
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
dfa2523b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
7 deletions
+19
-7
indevs.texi
doc/indevs.texi
+4
-2
decklink_common_c.h
libavdevice/decklink_common_c.h
+1
-0
decklink_dec.cpp
libavdevice/decklink_dec.cpp
+12
-4
decklink_dec_c.c
libavdevice/decklink_dec_c.c
+1
-0
version.h
libavdevice/version.h
+1
-1
No files found.
doc/indevs.texi
View file @
fc93eca1
...
...
@@ -298,11 +298,13 @@ Sets the audio input source. Must be @samp{unset}, @samp{embedded},
@item video_pts
Sets the video packet timestamp source. Must be @samp{video}, @samp{audio},
@samp{reference} or @samp{wallclock}. Defaults to @samp{video}.
@samp{reference}, @samp{wallclock} or @samp{abs_wallclock}.
Defaults to @samp{video}.
@item audio_pts
Sets the audio packet timestamp source. Must be @samp{video}, @samp{audio},
@samp{reference} or @samp{wallclock}. Defaults to @samp{audio}.
@samp{reference}, @samp{wallclock} or @samp{abs_wallclock}.
Defaults to @samp{audio}.
@item draw_bars
If set to @samp{true}, color bars are drawn in the event of a signal loss.
...
...
libavdevice/decklink_common_c.h
View file @
fc93eca1
...
...
@@ -28,6 +28,7 @@ typedef enum DecklinkPtsSource {
PTS_SRC_VIDEO
=
2
,
PTS_SRC_REFERENCE
=
3
,
PTS_SRC_WALLCLOCK
=
4
,
PTS_SRC_ABS_WALLCLOCK
=
5
,
PTS_SRC_NB
}
DecklinkPtsSource
;
...
...
libavdevice/decklink_dec.cpp
View file @
fc93eca1
...
...
@@ -585,6 +585,7 @@ ULONG decklink_input_callback::Release(void)
static
int64_t
get_pkt_pts
(
IDeckLinkVideoInputFrame
*
videoFrame
,
IDeckLinkAudioInputPacket
*
audioFrame
,
int64_t
wallclock
,
int64_t
abs_wallclock
,
DecklinkPtsSource
pts_src
,
AVRational
time_base
,
int64_t
*
initial_pts
,
int
copyts
)
...
...
@@ -607,13 +608,18 @@ static int64_t get_pkt_pts(IDeckLinkVideoInputFrame *videoFrame,
res
=
videoFrame
->
GetHardwareReferenceTimestamp
(
time_base
.
den
,
&
bmd_pts
,
&
bmd_duration
);
break
;
case
PTS_SRC_WALLCLOCK
:
/* fall through */
case
PTS_SRC_ABS_WALLCLOCK
:
{
/* MSVC does not support compound literals like AV_TIME_BASE_Q
* in C++ code (compiler error C4576) */
AVRational
timebase
;
timebase
.
num
=
1
;
timebase
.
den
=
AV_TIME_BASE
;
pts
=
av_rescale_q
(
wallclock
,
timebase
,
time_base
);
if
(
pts_src
==
PTS_SRC_WALLCLOCK
)
pts
=
av_rescale_q
(
wallclock
,
timebase
,
time_base
);
else
pts
=
av_rescale_q
(
abs_wallclock
,
timebase
,
time_base
);
break
;
}
}
...
...
@@ -637,7 +643,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
void
*
audioFrameBytes
;
BMDTimeValue
frameTime
;
BMDTimeValue
frameDuration
;
int64_t
wallclock
=
0
;
int64_t
wallclock
=
0
,
abs_wallclock
=
0
;
struct
decklink_cctx
*
cctx
=
(
struct
decklink_cctx
*
)
avctx
->
priv_data
;
if
(
ctx
->
autodetect
)
{
...
...
@@ -652,6 +658,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
ctx
->
frameCount
++
;
if
(
ctx
->
audio_pts_source
==
PTS_SRC_WALLCLOCK
||
ctx
->
video_pts_source
==
PTS_SRC_WALLCLOCK
)
wallclock
=
av_gettime_relative
();
if
(
ctx
->
audio_pts_source
==
PTS_SRC_ABS_WALLCLOCK
||
ctx
->
video_pts_source
==
PTS_SRC_ABS_WALLCLOCK
)
abs_wallclock
=
av_gettime
();
// Handle Video Frame
if
(
videoFrame
)
{
...
...
@@ -698,7 +706,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
no_video
=
0
;
}
pkt
.
pts
=
get_pkt_pts
(
videoFrame
,
audioFrame
,
wallclock
,
ctx
->
video_pts_source
,
ctx
->
video_st
->
time_base
,
&
initial_video_pts
,
cctx
->
copyts
);
pkt
.
pts
=
get_pkt_pts
(
videoFrame
,
audioFrame
,
wallclock
,
abs_wallclock
,
ctx
->
video_pts_source
,
ctx
->
video_st
->
time_base
,
&
initial_video_pts
,
cctx
->
copyts
);
pkt
.
dts
=
pkt
.
pts
;
pkt
.
duration
=
frameDuration
;
...
...
@@ -789,7 +797,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
pkt
.
size
=
audioFrame
->
GetSampleFrameCount
()
*
ctx
->
audio_st
->
codecpar
->
channels
*
(
ctx
->
audio_depth
/
8
);
audioFrame
->
GetBytes
(
&
audioFrameBytes
);
audioFrame
->
GetPacketTime
(
&
audio_pts
,
ctx
->
audio_st
->
time_base
.
den
);
pkt
.
pts
=
get_pkt_pts
(
videoFrame
,
audioFrame
,
wallclock
,
ctx
->
audio_pts_source
,
ctx
->
audio_st
->
time_base
,
&
initial_audio_pts
,
cctx
->
copyts
);
pkt
.
pts
=
get_pkt_pts
(
videoFrame
,
audioFrame
,
wallclock
,
abs_wallclock
,
ctx
->
audio_pts_source
,
ctx
->
audio_st
->
time_base
,
&
initial_audio_pts
,
cctx
->
copyts
);
pkt
.
dts
=
pkt
.
pts
;
//fprintf(stderr,"Audio Frame size %d ts %d\n", pkt.size, pkt.pts);
...
...
libavdevice/decklink_dec_c.c
View file @
fc93eca1
...
...
@@ -70,6 +70,7 @@ static const AVOption options[] = {
{
"video"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
PTS_SRC_VIDEO
},
0
,
0
,
DEC
,
"pts_source"
},
{
"reference"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
PTS_SRC_REFERENCE
},
0
,
0
,
DEC
,
"pts_source"
},
{
"wallclock"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
PTS_SRC_WALLCLOCK
},
0
,
0
,
DEC
,
"pts_source"
},
{
"abs_wallclock"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
PTS_SRC_ABS_WALLCLOCK
},
0
,
0
,
DEC
,
"pts_source"
},
{
"draw_bars"
,
"draw bars on signal loss"
,
OFFSET
(
draw_bars
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
1
},
0
,
1
,
DEC
},
{
"queue_size"
,
"input queue buffer size"
,
OFFSET
(
queue_size
),
AV_OPT_TYPE_INT64
,
{
.
i64
=
(
1024
*
1024
*
1024
)},
0
,
INT64_MAX
,
DEC
},
{
"audio_depth"
,
"audio bitdepth (16 or 32)"
,
OFFSET
(
audio_depth
),
AV_OPT_TYPE_INT
,
{
.
i64
=
16
},
16
,
32
,
DEC
},
...
...
libavdevice/version.h
View file @
fc93eca1
...
...
@@ -29,7 +29,7 @@
#define LIBAVDEVICE_VERSION_MAJOR 58
#define LIBAVDEVICE_VERSION_MINOR 0
#define LIBAVDEVICE_VERSION_MICRO 10
0
#define LIBAVDEVICE_VERSION_MICRO 10
1
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
...
...
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