Using Video Toolbox decoder with Cerbero latest

John Weber rjohnweber at gmail.com
Fri Nov 14 07:03:53 PST 2014


First, I want to commend the great work done by the Gstreamer team on the
IOS SDK.  Very good work!

I'm having a problem using the vtdec (Video Toolbox decoder) element to
decode an H.264 stream with the IOS Simulator.

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:

rtspsrc location=rtsp://192.168.0.170:8554/camera ! rtph264depay !
avdec_h264 ! videoconvert ! autovideosink name=video-sink

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():

static gboolean
compute_h264_decode_picture_buffer_length (GstVtdec * vtdec,
    GstBuffer * codec_data, int *length)
{
  int profile, level;
  int dpb_mb_size = 16;
  int max_dpb_size_frames = 16;
  int max_dpb_mb_s = -1;
  int width_in_mb_s = vtdec->video_info.width / dpb_mb_size;
  int height_in_mb_s = vtdec->video_info.height / dpb_mb_size;

  *length = 0;

  if (!parse_h264_profile_and_level_from_codec_data (vtdec, codec_data,
          &profile, &level))
    return FALSE;

  max_dpb_mb_s = get_dpb_max_mb_s_from_level (vtdec, level);
  if (max_dpb_mb_s == -1) {
    GST_ELEMENT_ERROR (vtdec, STREAM, DECODE, (NULL),
        ("invalid level in codec_data, could not compute max_dpb_mb_s"));
    return FALSE;
  }

  /* this formula is specified in sections A.3.1.h and A.3.2.f of the 2009
   * edition of the standard */
  *length = MIN (floor (max_dpb_mb_s / (width_in_mb_s * height_in_mb_s)),
<---  This is the line that breaks
      max_dpb_size_frames);
  return TRUE;
}

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?

Anyway, here is the call trace:

#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
#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
#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
#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
#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
#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
#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
#7    0x000000010849b377 in push_sticky at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443
#8    0x00000001084957bc in events_foreach at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570
#9    0x000000010849948e in check_sticky [inlined] at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499
#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
#11    0x0000000107a13797 in gst_pad_set_caps [inlined] at
/Users/rjohnweber/cerbero/dist/ios_universal/include/gstreamer-1.0/gst/gstcompat.h:55
#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
#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
#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
#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
#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
#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
#18    0x000000010849b377 in push_sticky at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443
#19    0x00000001084957bc in events_foreach at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570
#20    0x000000010849948e in check_sticky [inlined] at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499
#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
#22    0x0000000108494d92 in event_forward_func at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2842
#23    0x0000000108494b13 in gst_pad_forward at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2796
#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
#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
#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
#27    0x000000010849b377 in push_sticky at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443
#28    0x00000001084957bc in events_foreach at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570
#29    0x000000010849948e in check_sticky [inlined] at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499
#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
#31    0x0000000108494d92 in event_forward_func at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2842
#32    0x0000000108494b13 in gst_pad_forward at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:2796
#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
#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
#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
#36    0x000000010849b377 in push_sticky at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3443
#37    0x00000001084957bc in events_foreach at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:570
#38    0x00000001084974a3 in check_sticky [inlined] at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gstpad.c:3499
#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
#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
#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
#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
#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
#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
#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
#46    0x00000001084ae33a in gst_task_func at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/gstreamer-1.0-1.5/gst/gsttask.c:317
#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
#48    0x00000001083123ff in g_thread_proxy at
/Users/rjohnweber/cerbero/sources/ios_universal/x86_64/glib-2.42.0/glib/gthread.c:764

Thanks for any assistance!
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141114/832bbbb3/attachment-0001.html>


More information about the gstreamer-devel mailing list