[vlc-commits] codec: VideoToolbox: flag pic num fields/order
Francois Cartegnie
git at videolan.org
Tue Apr 4 15:19:07 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 4 15:15:39 2017 +0200| [61a44105c49de24422f8405676b08689ab472d49] | committer: Francois Cartegnie
codec: VideoToolbox: flag pic num fields/order
required for pulldown and correct deinterlacing
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=61a44105c49de24422f8405676b08689ab472d49
---
modules/codec/videotoolbox.m | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 2db14ba..330d590 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -113,6 +113,7 @@ struct frame_info_t
bool b_flush;
bool b_field;
bool b_progressive;
+ bool b_top_field_first;
uint8_t i_num_ts;
unsigned i_length;
frame_info_t *p_next;
@@ -251,6 +252,9 @@ static bool ParseH264NAL(decoder_t *p_dec,
p_info->i_num_ts = h264_get_num_ts(p_sps, &slice, sei.i_pic_struct,
p_info->i_foc, bFOC);
+ if(!p_info->b_progressive)
+ p_info->b_top_field_first = (sei.i_pic_struct % 2 == 1);
+
/* Set frame rate for timings in case of missing rate */
if( !p_dec->fmt_in.video.i_frame_rate_base &&
p_sps->vui.i_time_scale && p_sps->vui.i_num_units_in_tick )
@@ -1562,6 +1566,11 @@ static void DecoderCallback(void *decompressionOutputRefCon,
p_pic->date = pts.value;
p_pic->b_progressive = p_info->b_progressive;
+ if(!p_pic->b_progressive)
+ {
+ p_pic->i_nb_fields = p_info->i_num_ts;
+ p_pic->b_top_field_first = p_info->b_top_field_first;
+ }
vlc_mutex_lock(&p_sys->lock);
OnDecodedFrame( p_dec, p_info );
More information about the vlc-commits
mailing list