[vlc-commits] mediacodec: always call hxxx pf_process_block

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:28:02 
2017 +0200| [4f924a68469ee8d2de33a304d8e4fc673341562c] | committer: Thomas 
Guillem

mediacodec: always call hxxx pf_process_block

And don't ask to parse NALs if the decoder supports adaptive.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f924a68469ee8d2de33a304d8e4fc673341562c
---

 modules/codec/omxil/mediacodec.c | 22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 574382b2e0..3658dee8bf 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -286,11 +286,8 @@ static int ParseVideoExtraH264(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 return i_ret;
 assert(hh->pf_process_block != NULL);
 
-if (!hh->b_is_xvcC && p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_ADAPTIVE)
-{
+if (p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_ADAPTIVE)
 p_sys->b_adaptive = true;
-return VLC_SUCCESS;
-}
 
 p_sys->pf_on_new_block = VideoHXXX_OnNewBlock;
 
@@ -309,16 +306,8 @@ static int ParseVideoExtraHEVC(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 return i_ret;
 assert(hh->pf_process_block != NULL);
 
-if (!hh->b_is_xvcC)
-{
-if (p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_ADAPTIVE)
-{
-p_sys->b_adaptive = true;
-return VLC_SUCCESS;
-}
-else /* TODO */
-return VLC_EGENERIC;
-}
+if (p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_ADAPTIVE)
+p_sys->b_adaptive = true;
 
 p_sys->pf_on_new_block = VideoHXXX_OnNewBlock;
 
@@ -1501,9 +1490,10 @@ static int VideoHXXX_OnNewBlock(decoder_t *p_dec, 
block_t **pp_block)
 {
 decoder_sys_t *p_sys = p_dec->p_sys;
 struct hxxx_helper *hh = _sys->video.hh;
-bool b_config_changed;
+bool b_config_changed = false;
+bool *p_config_changed = p_sys->b_adaptive ? NULL : _config_changed;
 
-*pp_block = hh->pf_process_block(hh, *pp_block, _config_changed);
+*pp_block = hh->pf_process_block(hh, *pp_block, p_config_changed);
 if (!*pp_block)
 return 0;
 if (b_config_changed)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] mediacodec: fix deadlock when drain times out

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 13:46:13 
2017 +0200| [c114f4211f03a2899827b6598738200f91a75a29] | committer: Thomas 
Guillem

mediacodec: fix deadlock when drain times out

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c114f4211f03a2899827b6598738200f91a75a29
---

 modules/codec/omxil/mediacodec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index fde5cea190..922719c538 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1351,7 +1351,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t 
*p_in_block,
 if (!p_sys->b_drained)
 {
 msg_Err(p_dec, "OutThread timed out");
-p_sys->b_aborted = true;
+AbortDecoderLocked(p_dec);
 }
 p_sys->b_drained = false;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vout/android: clear surfaces only when needed

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 14:29:21 
2017 +0200| [1e9030d2f39138c666506e755fbe25d658f01ef0] | committer: Thomas 
Guillem

vout/android: clear surfaces only when needed

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e9030d2f39138c666506e755fbe25d658f01ef0
---

 modules/video_output/android/display.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/android/display.c 
b/modules/video_output/android/display.c
index 8161f6e1c3..635617a913 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -127,6 +127,7 @@ struct vout_display_sys_t
 android_window *p_window;
 android_window *p_sub_window;
 
+bool b_displayed;
 bool b_sub_invalid;
 filter_t *p_spu_blend;
 picture_t *p_sub_pic;
@@ -857,7 +858,8 @@ static void Close(vlc_object_t *p_this)
 
 if (sys->p_window)
 {
-ClearSurface(vd);
+if (sys->b_displayed)
+ClearSurface(vd);
 AndroidWindow_Destroy(vd, sys->p_window);
 }
 
@@ -1159,6 +1161,8 @@ static void Display(vout_display_t *vd, picture_t 
*picture,
 
 if (subpicture)
 subpicture_Delete(subpicture);
+
+sys->b_displayed = true;
 }
 
 static void CopySourceAspect(video_format_t *p_dest,

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] mediacodec: increase drain max delay

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 13:45:49 
2017 +0200| [2fe2f7268f5048c86c92c5cfcc210d7a594a0d28] | committer: Thomas 
Guillem

mediacodec: increase drain max delay

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2fe2f7268f5048c86c92c5cfcc210d7a594a0d28
---

 modules/codec/omxil/mediacodec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 3658dee8bf..fde5cea190 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1344,7 +1344,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t 
*p_in_block,
 /* Wait for the OutThread to stop (and process all remaining output
  * frames. Use a timeout here since we can't know if all decoders will
  * behave correctly. */
-mtime_t deadline = mdate() + INT64_C(100);
+mtime_t deadline = mdate() + INT64_C(300);
 while (!p_sys->b_aborted && !p_sys->b_drained
 && vlc_cond_timedwait(_sys->dec_cond, _sys->lock, deadline) == 
0);
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: refactor

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 14:08:38 
2017 +0200| [0a5dabd030631fdcc6e22388d9975a16ebf7065b] | committer: Thomas 
Guillem

codec: hxxx: refactor

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0a5dabd030631fdcc6e22388d9975a16ebf7065b
---

 modules/codec/hxxx_helper.c | 44 +++-
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 16479bcdae..fe241d2c6c 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -418,32 +418,42 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void 
*p_extra,
 if (i_ret != VLC_SUCCESS)
 return i_ret;
 
-if (hh->b_is_xvcC)
-{
-if (hh->b_need_xvcC)
-hh->pf_process_block = helper_process_block_dummy;
-else
-hh->pf_process_block = helper_process_block_xvcc2annexb;
-}
-else
+switch (hh->i_codec)
 {
-switch (hh->i_codec)
-{
-case VLC_CODEC_H264:
+case VLC_CODEC_H264:
+if (hh->b_is_xvcC)
+{
+if (hh->b_need_xvcC)
+hh->pf_process_block = helper_process_block_dummy;
+else
+hh->pf_process_block = helper_process_block_xvcc2annexb;
+}
+else /* AnnexB */
+{
 if (hh->b_need_xvcC)
 hh->pf_process_block = 
helper_process_block_h264_annexb2avcc;
 else
 hh->pf_process_block = helper_process_block_h264_annexb;
-break;
-case VLC_CODEC_HEVC:
+}
+break;
+case VLC_CODEC_HEVC:
+if (hh->b_is_xvcC)
+{
+if (hh->b_need_xvcC)
+hh->pf_process_block = helper_process_block_dummy;
+else
+hh->pf_process_block = helper_process_block_xvcc2annexb;
+}
+else /* AnnexB */
+{
 if (hh->b_need_xvcC)
 return VLC_EGENERIC; /* TODO */
 else
 hh->pf_process_block = helper_process_block_dummy;
-break;
-default:
-vlc_assert_unreachable();
-}
+}
+break;
+default:
+vlc_assert_unreachable();
 }
 return VLC_SUCCESS;;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] mediacodec: remove late opening

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:07:37 
2017 +0200| [11b80a543d7aae3e24e76e980481000ab199f5af] | committer: Thomas 
Guillem

mediacodec: remove late opening

Since packetizers will trigger a decoder reload when the size is finally valid.
We can open MediaCodec without having any CSDs since we can send them later
with the queueInput() method.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11b80a543d7aae3e24e76e980481000ab199f5af
---

 modules/codec/omxil/mediacodec.c | 51 +++-
 1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 9a557b6aa6..574382b2e0 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -428,23 +428,9 @@ static int UpdateVout(decoder_t *p_dec)
_dec->fmt_out.video);
 }
 
-bool b_invalid_size = !p_dec->fmt_out.video.i_width
-  && !p_dec->fmt_out.video.i_height;
-if (b_invalid_size)
-{
-if (p_dec->fmt_out.i_codec != VLC_CODEC_ANDROID_OPAQUE)
-return VLC_EGENERIC;
-/* The correct video size will come from MediaCodec, setup a dummy
- * one in order to get the surface */
-p_dec->fmt_out.video.i_width = p_dec->fmt_out.video.i_height = 1;
-}
-
 if (decoder_UpdateVideoFormat(p_dec) != 0)
 return VLC_EGENERIC;
 
-if (b_invalid_size)
-p_dec->fmt_out.video.i_width = p_dec->fmt_out.video.i_height = 0;
-
 if (p_dec->fmt_out.i_codec != VLC_CODEC_ANDROID_OPAQUE)
 return VLC_SUCCESS;
 
@@ -471,15 +457,8 @@ static int StartMediaCodec(decoder_t *p_dec)
 decoder_sys_t *p_sys = p_dec->p_sys;
 union mc_api_args args;
 
-if ((p_sys->api.i_quirks & MC_API_QUIRKS_NEED_CSD) && !p_sys->i_csd_count
- && !p_sys->b_adaptive)
-return VLC_ENOOBJ;
-
 if (p_dec->fmt_in.i_cat == VIDEO_ES)
 {
-if (!p_sys->b_adaptive
- && (!p_dec->fmt_out.video.i_width || !p_dec->fmt_out.video.i_height))
-return VLC_ENOOBJ;
 args.video.i_width = p_dec->fmt_out.video.i_width;
 args.video.i_height = p_dec->fmt_out.video.i_height;
 args.video.i_angle = p_sys->video.i_angle;
@@ -540,6 +519,12 @@ static int OpenDecoder(vlc_object_t *p_this, 
pf_MediaCodecApi_init pf_init)
 
 if (p_dec->fmt_in.i_cat == VIDEO_ES)
 {
+/* Not all mediacodec versions can handle a size of 0. Hopefully, the
+ * packetizer will trigger a decoder restart when a new video size is
+ * found. */
+if (!p_dec->fmt_in.video.i_width || !p_dec->fmt_in.video.i_height)
+return VLC_EGENERIC;
+
 switch (p_dec->fmt_in.i_codec) {
 case VLC_CODEC_HEVC: mime = "video/hevc"; break;
 case VLC_CODEC_H264: mime = "video/avc"; break;
@@ -717,26 +702,24 @@ static int OpenDecoder(vlc_object_t *p_this, 
pf_MediaCodecApi_init pf_init)
 if (ParseExtra(p_dec) != VLC_SUCCESS)
 goto bailout;
 
-i_ret = StartMediaCodec(p_dec);
-switch (i_ret)
+if ((p_sys->api.i_quirks & MC_API_QUIRKS_NEED_CSD) && !p_sys->i_csd_count
+ && !p_sys->b_adaptive)
 {
-case VLC_SUCCESS:
-break;
-case VLC_ENOOBJ:
 switch (p_dec->fmt_in.i_codec)
 {
 case VLC_CODEC_H264:
 case VLC_CODEC_HEVC:
-msg_Warn(p_dec, "late opening for codec %4.4s",
- (const char *)_dec->fmt_in.i_codec);
-break;
+break; /* CSDs will come from hxxx_helper */
 default:
-msg_Warn(p_dec, "late opening with %4.4s not handled",
+msg_Warn(p_dec, "Not CSD found for %4.4s",
  (const char *) _dec->fmt_in.i_codec);
 goto bailout;
 }
-break;
-default:
+}
+
+i_ret = StartMediaCodec(p_dec);
+if (i_ret != VLC_SUCCESS)
+{
 msg_Err(p_dec, "StartMediaCodec failed");
 goto bailout;
 }
@@ -1269,6 +1252,10 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t 
*p_in_block,
 
 assert(p_sys->api.b_started);
 
+if ((p_sys->api.i_quirks & MC_API_QUIRKS_NEED_CSD) && !p_sys->i_csd_count
+ && !p_sys->b_adaptive)
+return VLC_EGENERIC; /* Wait for CSDs */
+
 /* Queue CSD blocks and input blocks */
 while (b_drain || (p_block = GetNextBlock(p_sys, p_in_block)))
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: parse nal only when asked for

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:10:04 
2017 +0200| [e727f85933f55279543aa1241ca4b60365a2a361] | committer: Thomas 
Guillem

codec: hxxx: parse nal only when asked for

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e727f85933f55279543aa1241ca4b60365a2a361
---

 modules/codec/hxxx_helper.c | 16 ++--
 modules/codec/hxxx_helper.h |  4 
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 8e907db46a..a7571e2b5f 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -358,7 +358,8 @@ helper_process_block_xvcc2annexb(struct hxxx_helper *hh, 
block_t *p_block,
  bool *p_config_changed)
 {
 assert(helper_nal_length_valid(hh));
-*p_config_changed = false;
+if (p_config_changed != NULL)
+*p_config_changed = false;
 h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
hh->i_nal_length_size);
 return p_block;
@@ -368,12 +369,15 @@ static block_t *
 helper_process_block_h264_annexb(struct hxxx_helper *hh, block_t *p_block,
  bool *p_config_changed)
 {
-int i_ret = h264_helper_parse_nal(hh, p_block->p_buffer, p_block->i_buffer,
-  0, p_config_changed);
-if (i_ret != VLC_SUCCESS)
+if (p_config_changed != NULL)
 {
-block_Release(p_block);
-return NULL;
+int i_ret = h264_helper_parse_nal(hh, p_block->p_buffer,
+  p_block->i_buffer, 0, 
p_config_changed);
+if (i_ret != VLC_SUCCESS)
+{
+block_Release(p_block);
+return NULL;
+}
 }
 return p_block;
 }
diff --git a/modules/codec/hxxx_helper.h b/modules/codec/hxxx_helper.h
index a83f45535d..44bb57a12d 100644
--- a/modules/codec/hxxx_helper.h
+++ b/modules/codec/hxxx_helper.h
@@ -59,6 +59,10 @@ struct hxxx_helper
 size_t i_annexb_config_nal;
 } hevc;
 };
+
+/* Process the block: do the AnnexB <-> xvcC conversion if needed. If
+ * p_config_changed is not NULL, parse nals to detect a SPS/PPS or a video
+ * size change. */
 block_t * (*pf_process_block)(struct hxxx_helper *hh, block_t *p_block,
   bool *p_config_changed);
 };

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: also parse avcC for SPS/PPS change

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:30:01 
2017 +0200| [6c4fb6618432051b126d9b6b60b2cef4046280d0] | committer: Thomas 
Guillem

codec: hxxx: also parse avcC for SPS/PPS change

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c4fb6618432051b126d9b6b60b2cef4046280d0
---

 modules/codec/hxxx_helper.c  | 25 +
 modules/codec/videotoolbox.m |  2 +-
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index fe241d2c6c..f2b69c52eb 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -375,11 +375,9 @@ helper_process_block_xvcc2annexb(struct hxxx_helper *hh, 
block_t *p_block,
  bool *p_config_changed)
 {
 assert(helper_nal_length_valid(hh));
-if (p_config_changed != NULL)
-*p_config_changed = false;
 h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
hh->i_nal_length_size);
-return p_block;
+return helper_process_block_h264_annexb(hh, p_block, p_config_changed);
 }
 
 static block_t *
@@ -391,6 +389,25 @@ helper_process_block_h264_annexb2avcc(struct hxxx_helper 
*hh, block_t *p_block,
 }
 
 static block_t *
+helper_process_block_h264_avcc(struct hxxx_helper *hh, block_t *p_block,
+   bool *p_config_changed)
+{
+if (p_config_changed != NULL)
+{
+int i_ret = h264_helper_parse_nal(hh, p_block->p_buffer,
+  p_block->i_buffer,
+  hh->i_nal_length_size,
+  p_config_changed);
+if (i_ret != VLC_SUCCESS)
+{
+block_Release(p_block);
+return NULL;
+}
+}
+return p_block;
+}
+
+static block_t *
 helper_process_block_dummy(struct hxxx_helper *hh, block_t *p_block,
bool *p_config_changed)
 {
@@ -424,7 +441,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void 
*p_extra,
 if (hh->b_is_xvcC)
 {
 if (hh->b_need_xvcC)
-hh->pf_process_block = helper_process_block_dummy;
+hh->pf_process_block = helper_process_block_h264_avcc;
 else
 hh->pf_process_block = helper_process_block_xvcc2annexb;
 }
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 4cffee2d89..dd5b8c8609 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1296,7 +1296,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
 {
 /* decoding didn't start yet, which is ok for H264, let's see
  * if we can use this block to get going */
-assert(p_sys->codec == kCMVideoCodecType_H264 && !p_sys->hh.b_is_xvcC);
+assert(p_sys->codec == kCMVideoCodecType_H264);
 if (p_sys->session)
 {
 msg_Dbg(p_dec, "SPS/PPS changed: draining H264 decoder");

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: pf_process_block is now mandatory

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:06:03 
2017 +0200| [3d1b34a35ec6292cfa74d4772b8dc4e2786f22e9] | committer: Thomas 
Guillem

codec: hxxx: pf_process_block is now mandatory

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3d1b34a35ec6292cfa74d4772b8dc4e2786f22e9
---

 modules/codec/hxxx_helper.c  | 13 +++--
 modules/codec/omxil/mediacodec.c |  4 ++--
 modules/codec/videotoolbox.m |  3 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 134d4bd442..8e907db46a 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -386,6 +386,15 @@ helper_process_block_h264_annexb2avcc(struct hxxx_helper 
*hh, block_t *p_block,
 return p_block ? hxxx_AnnexB_to_xVC(p_block, hh->i_nal_length_size) : NULL;
 }
 
+static block_t *
+helper_process_block_dummy(struct hxxx_helper *hh, block_t *p_block,
+   bool *p_config_changed)
+{
+(void) hh;
+(void) p_config_changed;
+return p_block;
+}
+
 int
 hxxx_helper_set_extra(struct hxxx_helper *hh, const void *p_extra,
   size_t i_extra)
@@ -408,7 +417,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void 
*p_extra,
 if (hh->b_is_xvcC)
 {
 if (hh->b_need_xvcC)
-hh->pf_process_block = NULL;
+hh->pf_process_block = helper_process_block_dummy;
 else
 hh->pf_process_block = helper_process_block_xvcc2annexb;
 }
@@ -426,7 +435,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const void 
*p_extra,
 if (hh->b_need_xvcC)
 return VLC_EGENERIC; /* TODO */
 else
-hh->pf_process_block = NULL;
+hh->pf_process_block = helper_process_block_dummy;
 break;
 default:
 vlc_assert_unreachable();
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index c67278a2cf..9a557b6aa6 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -284,6 +284,7 @@ static int ParseVideoExtraH264(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 int i_ret = hxxx_helper_set_extra(hh, p_extra, i_extra);
 if (i_ret != VLC_SUCCESS)
 return i_ret;
+assert(hh->pf_process_block != NULL);
 
 if (!hh->b_is_xvcC && p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_ADAPTIVE)
 {
@@ -291,7 +292,6 @@ static int ParseVideoExtraH264(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 return VLC_SUCCESS;
 }
 
-assert(hh->pf_process_block != NULL);
 p_sys->pf_on_new_block = VideoHXXX_OnNewBlock;
 
 if (hh->h264.i_sps_count > 0 || hh->h264.i_pps_count > 0)
@@ -307,6 +307,7 @@ static int ParseVideoExtraHEVC(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 int i_ret = hxxx_helper_set_extra(hh, p_extra, i_extra);
 if (i_ret != VLC_SUCCESS)
 return i_ret;
+assert(hh->pf_process_block != NULL);
 
 if (!hh->b_is_xvcC)
 {
@@ -319,7 +320,6 @@ static int ParseVideoExtraHEVC(decoder_t *p_dec, uint8_t 
*p_extra, int i_extra)
 return VLC_EGENERIC;
 }
 
-assert(hh->pf_process_block != NULL);
 p_sys->pf_on_new_block = VideoHXXX_OnNewBlock;
 
 if (hh->hevc.i_annexb_config_nal > 0)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 69f7530865..4cffee2d89 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -789,6 +789,7 @@ static int SetupDecoderExtradata(decoder_t *p_dec)
   p_dec->fmt_in.i_extra);
 if (i_ret != VLC_SUCCESS)
 return i_ret;
+assert(p_sys->hh.pf_process_block != NULL);
 
 if (p_dec->fmt_in.p_extra)
 {
@@ -1284,7 +1285,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
 }
 
 bool b_config_changed = false;
-if (p_sys->codec == kCMVideoCodecType_H264 && p_sys->hh.pf_process_block)
+if (p_sys->codec == kCMVideoCodecType_H264)
 {
 p_block = p_sys->hh.pf_process_block(_sys->hh, p_block, 
_config_changed);
 if (!p_block)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: fix log

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:25:38 
2017 +0200| [46701f81b485dec489fb263fa576163197d945fa] | committer: Thomas 
Guillem

codec: hxxx: fix log

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=46701f81b485dec489fb263fa576163197d945fa
---

 modules/codec/hxxx_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index a7571e2b5f..606f5e6327 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -205,7 +205,7 @@ h264_helper_parse_nal(struct hxxx_helper *hh, const uint8_t 
*p_buf, size_t i_buf
 
 hnal->h264_pps = p_pps;
 *p_config_changed = true;
-msg_Dbg(hh->p_obj, "new  PPS parsed: %u\n", p_pps->i_id);
+msg_Dbg(hh->p_obj, "new PPS parsed: %u\n", p_pps->i_id);
 }
 else if (i_nal_type <= H264_NAL_SLICE_IDR
   && i_nal_type != H264_NAL_UNKNOWN)

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] codec: hxxx: move code

2017-04-20 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Apr 20 11:29:31 
2017 +0200| [254015dd0a6fe3cd7fa1cc8042ee216dd1ae00b9] | committer: Thomas 
Guillem

codec: hxxx: move code

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=254015dd0a6fe3cd7fa1cc8042ee216dd1ae00b9
---

 modules/codec/hxxx_helper.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
index 606f5e6327..16479bcdae 100644
--- a/modules/codec/hxxx_helper.c
+++ b/modules/codec/hxxx_helper.c
@@ -354,18 +354,6 @@ hevc_helper_set_extra(struct hxxx_helper *hh, const void 
*p_extra,
 }
 
 static block_t *
-helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
- bool *p_config_changed)
-{
-assert(helper_nal_length_valid(hh));
-if (p_config_changed != NULL)
-*p_config_changed = false;
-h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
-   hh->i_nal_length_size);
-return p_block;
-}
-
-static block_t *
 helper_process_block_h264_annexb(struct hxxx_helper *hh, block_t *p_block,
  bool *p_config_changed)
 {
@@ -383,6 +371,18 @@ helper_process_block_h264_annexb(struct hxxx_helper *hh, 
block_t *p_block,
 }
 
 static block_t *
+helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t *p_block,
+ bool *p_config_changed)
+{
+assert(helper_nal_length_valid(hh));
+if (p_config_changed != NULL)
+*p_config_changed = false;
+h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
+   hh->i_nal_length_size);
+return p_block;
+}
+
+static block_t *
 helper_process_block_h264_annexb2avcc(struct hxxx_helper *hh, block_t *p_block,
   bool *p_config_changed)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits