void gst_audio_parse_update_frame_size (GstAudioParse * ap) { gint framesize, width; switch (ap->format) { case GST_AUDIO_PARSE_FORMAT_ALAW: case GST_AUDIO_PARSE_FORMAT_MULAW: width = 8; break; case GST_AUDIO_PARSE_FORMAT_RAW: default: { GstAudioInfo info; gst_audio_info_init (&info); /* rate, etc do not really matter here */ gst_audio_info_set_format (&info, ap->raw_format, 44100, ap->channels, NULL); width = GST_AUDIO_INFO_WIDTH (&info); break; } } framesize = (width / 8) * ap->channels; gst_raw_parse_set_framesize (GST_RAW_PARSE (ap), framesize); }
void gst_video_parse_update_frame_size (GstVideoParse * vp) { gint framesize; GstVideoInfo info; gst_video_info_init (&info); gst_video_info_set_format (&info, vp->format, vp->width, vp->height); framesize = GST_VIDEO_INFO_SIZE (&info); gst_raw_parse_set_framesize (GST_RAW_PARSE (vp), framesize); }