Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steve Lhomme
vlc
Commits
4f4f529c
Commit
4f4f529c
authored
Feb 27, 2018
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codec: videtoolbox: rework cvpx_format
parent
999e487e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
modules/codec/videotoolbox.m
modules/codec/videotoolbox.m
+14
-10
No files found.
modules/codec/videotoolbox.m
View file @
4f4f529c
...
@@ -176,7 +176,8 @@ struct decoder_sys_t
...
@@ -176,7 +176,8 @@ struct decoder_sys_t
enum vtsession_status vtsession_status;
enum vtsession_status vtsession_status;
int i_forced_cvpx_format;
int i_cvpx_format;
bool b_cvpx_format_forced;
h264_poc_context_t h264_pocctx;
h264_poc_context_t h264_pocctx;
hevc_poc_ctx_t hevc_pocctx;
hevc_poc_ctx_t hevc_pocctx;
...
@@ -724,7 +725,7 @@ static bool CodecSupportedHEVC(decoder_t *p_dec)
...
@@ -724,7 +725,7 @@ static bool CodecSupportedHEVC(decoder_t *p_dec)
#if !TARGET_OS_IPHONE
#if !TARGET_OS_IPHONE
decoder_sys_t *p_sys = p_dec->p_sys;
decoder_sys_t *p_sys = p_dec->p_sys;
if (p_sys->i_
forced_
cvpx_format == 0)
if (p_sys->i_cvpx_format == 0)
{
{
/* Force P010 chroma instead of RGBA in order to improve performances. */
/* Force P010 chroma instead of RGBA in order to improve performances. */
uint8_t i_profile, i_level;
uint8_t i_profile, i_level;
...
@@ -732,7 +733,7 @@ static bool CodecSupportedHEVC(decoder_t *p_dec)
...
@@ -732,7 +733,7 @@ static bool CodecSupportedHEVC(decoder_t *p_dec)
&i_level))
&i_level))
return true;
return true;
if (i_profile == HEVC_PROFILE_MAIN_10)
if (i_profile == HEVC_PROFILE_MAIN_10)
p_sys->i_
forced_
cvpx_format = 'x420'; /* kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange */
p_sys->i_cvpx_format = 'x420'; /* kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange */
}
}
#endif
#endif
return true;
return true;
...
@@ -1206,13 +1207,13 @@ static int StartVideoToolbox(decoder_t *p_dec)
...
@@ -1206,13 +1207,13 @@ static int StartVideoToolbox(decoder_t *p_dec)
cfdict_set_int32(destinationPixelBufferAttributes,
cfdict_set_int32(destinationPixelBufferAttributes,
kCVPixelBufferHeightKey, p_dec->fmt_out.video.i_visible_height);
kCVPixelBufferHeightKey, p_dec->fmt_out.video.i_visible_height);
if (p_sys->i_
forced_
cvpx_format != 0)
if (p_sys->i_cvpx_format != 0)
{
{
int chroma = htonl(p_sys->i_
forced_
cvpx_format);
int chroma = htonl(p_sys->i_cvpx_format);
msg_Warn(p_dec, "forcing CVPX format: %4.4s", (const char *) &chroma);
msg_Warn(p_dec, "forcing CVPX format: %4.4s", (const char *) &chroma);
cfdict_set_int32(destinationPixelBufferAttributes,
cfdict_set_int32(destinationPixelBufferAttributes,
kCVPixelBufferPixelFormatTypeKey,
kCVPixelBufferPixelFormatTypeKey,
p_sys->i_
forced_
cvpx_format);
p_sys->i_cvpx_format);
}
}
cfdict_set_int32(destinationPixelBufferAttributes,
cfdict_set_int32(destinationPixelBufferAttributes,
...
@@ -1317,6 +1318,7 @@ static int OpenDecoder(vlc_object_t *p_this)
...
@@ -1317,6 +1318,7 @@ static int OpenDecoder(vlc_object_t *p_this)
p_sys->videoFormatDescription = nil;
p_sys->videoFormatDescription = nil;
p_sys->i_pic_reorder_max = 4;
p_sys->i_pic_reorder_max = 4;
p_sys->vtsession_status = VTSESSION_STATUS_OK;
p_sys->vtsession_status = VTSESSION_STATUS_OK;
p_sys->b_cvpx_format_forced = false;
char *cvpx_chroma = var_InheritString(p_dec, "videotoolbox-cvpx-chroma");
char *cvpx_chroma = var_InheritString(p_dec, "videotoolbox-cvpx-chroma");
if (cvpx_chroma != NULL)
if (cvpx_chroma != NULL)
...
@@ -1328,8 +1330,9 @@ static int OpenDecoder(vlc_object_t *p_this)
...
@@ -1328,8 +1330,9 @@ static int OpenDecoder(vlc_object_t *p_this)
free(p_sys);
free(p_sys);
return VLC_EGENERIC;
return VLC_EGENERIC;
}
}
memcpy(&p_sys->i_forced_cvpx_format, cvpx_chroma, 4);
memcpy(&p_sys->i_cvpx_format, cvpx_chroma, 4);
p_sys->i_forced_cvpx_format = ntohl(p_sys->i_forced_cvpx_format);
p_sys->i_cvpx_format = ntohl(p_sys->i_cvpx_format);
p_sys->b_cvpx_format_forced = true;
free(cvpx_chroma);
free(cvpx_chroma);
}
}
...
@@ -1790,13 +1793,14 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
...
@@ -1790,13 +1793,14 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
"aborting...");
"aborting...");
p_sys->vtsession_status = VTSESSION_STATUS_ABORT;
p_sys->vtsession_status = VTSESSION_STATUS_ABORT;
#else
#else
if (p_sys->i_forced_cvpx_format == 0)
if (!p_sys->b_cvpx_format_forced
&& p_sys->i_cvpx_format != kCVPixelFormatType_420YpCbCr8Planar)
{
{
/* In case of interlaced content, force VT to output I420 since our
/* In case of interlaced content, force VT to output I420 since our
* SW deinterlacer handle this chroma natively. This avoids having
* SW deinterlacer handle this chroma natively. This avoids having
* 2 extra conversions (CVPX->I420 then I420->CVPX). */
* 2 extra conversions (CVPX->I420 then I420->CVPX). */
p_sys->i_
forced_
cvpx_format = kCVPixelFormatType_420YpCbCr8Planar;
p_sys->i_cvpx_format = kCVPixelFormatType_420YpCbCr8Planar;
msg_Warn(p_dec, "Interlaced content: forcing VT to output I420");
msg_Warn(p_dec, "Interlaced content: forcing VT to output I420");
if (p_sys->session != nil && p_sys->vtsession_status == VTSESSION_STATUS_OK)
if (p_sys->session != nil && p_sys->vtsession_status == VTSESSION_STATUS_OK)
{
{
...
...
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