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
c356b686
Commit
c356b686
authored
Apr 27, 2016
by
Rick Kern
Committed by
wm4
May 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/videotoolboxenc: Support pixel aspect ratio
Signed-off-by:
Rick Kern
<
kernrj@gmail.com
>
parent
9d8a38d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
videotoolboxenc.c
libavcodec/videotoolboxenc.c
+63
-0
No files found.
libavcodec/videotoolboxenc.c
View file @
c356b686
...
...
@@ -748,6 +748,69 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
}
}
if
(
avctx
->
sample_aspect_ratio
.
num
!=
0
)
{
CFNumberRef
num
;
CFNumberRef
den
;
CFMutableDictionaryRef
par
;
AVRational
*
avpar
=
&
avctx
->
sample_aspect_ratio
;
av_reduce
(
&
avpar
->
num
,
&
avpar
->
den
,
avpar
->
num
,
avpar
->
den
,
0xFFFFFFFF
);
num
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberIntType
,
&
avpar
->
num
);
den
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberIntType
,
&
avpar
->
den
);
par
=
CFDictionaryCreateMutable
(
kCFAllocatorDefault
,
2
,
&
kCFCopyStringDictionaryKeyCallBacks
,
&
kCFTypeDictionaryValueCallBacks
);
if
(
!
par
||
!
num
||
!
den
)
{
if
(
par
)
CFRelease
(
par
);
if
(
num
)
CFRelease
(
num
);
if
(
den
)
CFRelease
(
den
);
return
AVERROR
(
ENOMEM
);
}
CFDictionarySetValue
(
par
,
kCMFormatDescriptionKey_PixelAspectRatioHorizontalSpacing
,
num
);
CFDictionarySetValue
(
par
,
kCMFormatDescriptionKey_PixelAspectRatioVerticalSpacing
,
den
);
status
=
VTSessionSetProperty
(
vtctx
->
session
,
kVTCompressionPropertyKey_PixelAspectRatio
,
par
);
CFRelease
(
par
);
CFRelease
(
num
);
CFRelease
(
den
);
if
(
status
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error setting pixel aspect ratio to %d:%d: %d.
\n
"
,
avctx
->
sample_aspect_ratio
.
num
,
avctx
->
sample_aspect_ratio
.
den
,
status
);
return
AVERROR_EXTERNAL
;
}
}
if
(
!
vtctx
->
has_b_frames
)
{
status
=
VTSessionSetProperty
(
vtctx
->
session
,
kVTCompressionPropertyKey_AllowFrameReordering
,
...
...
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