<div dir="ltr"><div><div><div>First, I want to commend the great work done by the Gstreamer team on the IOS SDK.  Very good work!<br><br></div>I'm having a problem using the vtdec (Video Toolbox decoder) element to decode an H.264 stream with the IOS Simulator.<br><br></div><div>What I've done is taken Tutorial 3 for IOS and substituted a new launch string for the pipeline, which works for the libav decoder:<br></div><br>rtspsrc location=rtsp://<a href="http://192.168.0.170:8554/camera">192.168.0.170:8554/camera</a> ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink name=video-sink<br><br></div>If I use the vtdec element instead of the avdec_h264 element, the program breaks on a divide by zero error in vtdec.c in the function compute_h264_decode_picture_buffer_length():<br><br>static gboolean<br>compute_h264_decode_picture_buffer_length (GstVtdec * vtdec,<br>    GstBuffer * codec_data, int *length)<br>{<br>  int profile, level;<br>  int dpb_mb_size = 16;<br>  int max_dpb_size_frames = 16;<br>  int max_dpb_mb_s = -1;<br>  int width_in_mb_s = vtdec->video_info.width / dpb_mb_size;<br>  int height_in_mb_s = vtdec->video_info.height / dpb_mb_size;<br><br>  *length = 0;<br><br>  if (!parse_h264_profile_and_level_from_codec_data (vtdec, codec_data,<br>          &profile, &level))<br>    return FALSE;<br><br>  max_dpb_mb_s = get_dpb_max_mb_s_from_level (vtdec, level);<br>  if (max_dpb_mb_s == -1) {<br>    GST_ELEMENT_ERROR (vtdec, STREAM, DECODE, (NULL),<br>        ("invalid level in codec_data, could not compute max_dpb_mb_s"));<br>    return FALSE;<br>  }<br><br>  /* this formula is specified in sections A.3.1.h and A.3.2.f of the 2009<br>   * edition of the standard */<br>  *length = MIN (floor (max_dpb_mb_s / (width_in_mb_s * height_in_mb_s)),  <---  This is the line that breaks<br>      max_dpb_size_frames);<br>  return TRUE;<br>}<br><div><br><div><div><div><div>The variable width_in_mb_s is 0 in the as shown the the debugger.    However I can't probe some of the other variables because of possible optimization?<br><br></div><div>Anyway, here is the call trace:<br></div><div><br>#0    0x0000000107703fbc in compute_h264_decode_picture_buffer_length [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-bad-1.0-static-1.5/sys/applemedia/vtdec.c:747<br>#1    0x0000000107703e6c in gst_vtdec_compute_reorder_queue_length [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-bad-1.0-static-1.5/sys/applemedia/vtdec.c:710<br>#2    0x0000000107703e6c in gst_vtdec_set_format at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-bad-1.0-static-1.5/sys/applemedia/vtdec.c:216<br>#3    0x0000000108553b6b in gst_video_decoder_setcaps [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-base-1.0-1.5/gst-libs/gst/video/gstvideodecoder.c:788<br>#4    0x0000000108553b42 in gst_video_decoder_sink_event_default at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-base-1.0-1.5/gst-libs/gst/video/gstvideodecoder.c:1056<br>#5    0x0000000108499ea9 in gst_pad_send_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:5155<br>#6    0x0000000108499722 in gst_pad_push_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4842<br>#7    0x000000010849b377 in push_sticky at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443<br>#8    0x00000001084957bc in events_foreach at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570<br>#9    0x000000010849948e in check_sticky [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499<br>#10    0x0000000108499463 in gst_pad_push_event at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4967<br>#11    0x0000000107a13797 in gst_pad_set_caps [inlined] at /Users/rjohnweber/cerbero/dist/ios_universal/include/gstreamer-1.0/gst/gstcompat.h:55<br>#12    0x0000000107a13747 in gst_rtp_h264_set_src_caps at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtp/gstrtph264depay.c:395<br>#13    0x0000000107a12f13 in gst_rtp_h264_depay_setcaps at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtp/gstrtph264depay.c:626<br>#14    0x000000010850ac06 in gst_rtp_base_depayload_setcaps [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-base-1.0-1.5/gst-libs/gst/rtp/gstrtpbasedepayload.c:310<br>#15    0x000000010850aa78 in gst_rtp_base_depayload_handle_event at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-base-1.0-1.5/gst-libs/gst/rtp/gstrtpbasedepayload.c:497<br>#16    0x0000000108499ea9 in gst_pad_send_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:5155<br>#17    0x0000000108499722 in gst_pad_push_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4842<br>#18    0x000000010849b377 in push_sticky at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443<br>#19    0x00000001084957bc in events_foreach at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570<br>#20    0x000000010849948e in check_sticky [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499<br>#21    0x0000000108499463 in gst_pad_push_event at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4967<br>#22    0x0000000108494d92 in event_forward_func at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2842<br>#23    0x0000000108494b13 in gst_pad_forward at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2796<br>#24    0x0000000108494cc5 in gst_pad_event_default at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2893<br>#25    0x0000000108499ea9 in gst_pad_send_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:5155<br>#26    0x0000000108499722 in gst_pad_push_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4842<br>#27    0x000000010849b377 in push_sticky at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443<br>#28    0x00000001084957bc in events_foreach at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570<br>#29    0x000000010849948e in check_sticky [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499<br>#30    0x0000000108499463 in gst_pad_push_event at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4967<br>#31    0x0000000108494d92 in event_forward_func at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2842<br>#32    0x0000000108494b13 in gst_pad_forward at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2796<br>#33    0x0000000108494cc5 in gst_pad_event_default at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2893<br>#34    0x0000000108499ea9 in gst_pad_send_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:5155<br>#35    0x0000000108499722 in gst_pad_push_event_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4842<br>#36    0x000000010849b377 in push_sticky at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443<br>#37    0x00000001084957bc in events_foreach at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570<br>#38    0x00000001084974a3 in check_sticky [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499<br>#39    0x0000000108497476 in gst_pad_push_data at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4048<br>#40    0x0000000107a6ca41 in gst_rtp_pt_demux_chain at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtpmanager/gstrtpptdemux.c:442<br>#41    0x00000001084969f8 in gst_pad_chain_data_unchecked at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3836<br>#42    0x0000000108497346 in gst_pad_push_data at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:4069<br>#43    0x0000000107a63f99 in pop_and_push_next [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtpmanager/gstrtpjitterbuffer.c:2585<br>#44    0x0000000107a63f62 in handle_next_buffer [inlined] at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtpmanager/gstrtpjitterbuffer.c:2677<br>#45    0x0000000107a63c0a in gst_rtp_jitter_buffer_loop at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gst-plugins-good-1.0-static-1.5/gst/rtpmanager/gstrtpjitterbuffer.c:3095<br>#46    0x00000001084ae33a in gst_task_func at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gsttask.c:317<br>#47    0x000000010830e536 in g_thread_pool_thread_proxy at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/glib-2.42.0/glib/gthreadpool.c:307<br>#48    0x00000001083123ff in g_thread_proxy at /Users/rjohnweber/cerbero/sources/ios_universal/x86_64/glib-2.42.0/glib/gthread.c:764<br><br></div><div>Thanks for any assistance!<br></div><div>John<br></div></div></div></div></div></div>