Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
e4334971
Commit
e4334971
authored
7 years ago
by
Marton Balint
Browse files
Options
Downloads
Patches
Plain Diff
avdevice/decklink_dec: set field order via codecpar
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
8b2cd8e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavdevice/decklink_dec.cpp
+13
-7
13 additions, 7 deletions
libavdevice/decklink_dec.cpp
with
13 additions
and
7 deletions
libavdevice/decklink_dec.cpp
+
13
−
7
View file @
e4334971
...
...
@@ -731,6 +731,19 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
st
->
codecpar
->
bit_rate
=
av_rescale
(
ctx
->
bmd_width
*
ctx
->
bmd_height
*
16
,
st
->
time_base
.
den
,
st
->
time_base
.
num
);
}
switch
(
ctx
->
bmd_field_dominance
)
{
case
bmdUpperFieldFirst
:
st
->
codecpar
->
field_order
=
AV_FIELD_TT
;
break
;
case
bmdLowerFieldFirst
:
st
->
codecpar
->
field_order
=
AV_FIELD_BB
;
break
;
case
bmdProgressiveFrame
:
case
bmdProgressiveSegmentedFrame
:
st
->
codecpar
->
field_order
=
AV_FIELD_PROGRESSIVE
;
break
;
}
avpriv_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
ctx
->
video_st
=
st
;
...
...
@@ -788,15 +801,8 @@ int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
struct
decklink_cctx
*
cctx
=
(
struct
decklink_cctx
*
)
avctx
->
priv_data
;
struct
decklink_ctx
*
ctx
=
(
struct
decklink_ctx
*
)
cctx
->
ctx
;
AVFrame
*
frame
=
ctx
->
video_st
->
codec
->
coded_frame
;
avpacket_queue_get
(
&
ctx
->
queue
,
pkt
,
1
);
if
(
frame
&&
(
ctx
->
bmd_field_dominance
==
bmdUpperFieldFirst
||
ctx
->
bmd_field_dominance
==
bmdLowerFieldFirst
))
{
frame
->
interlaced_frame
=
1
;
if
(
ctx
->
bmd_field_dominance
==
bmdUpperFieldFirst
)
{
frame
->
top_field_first
=
1
;
}
}
return
0
;
}
...
...
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