GNOME Bugzilla – Bug 343627
Add QoS to mpeg2dec
Last modified: 2006-06-07 16:16:35 UTC
I ve added a patch to mpeg2dec that adds QoS to it. Ive already tested it without receiving QoS events and works fine. Please I would like one to have a look in it and tell me if is OK. Also to give ideias how to test it to get QoS events.
Created attachment 66622 [details] [review] gstmpeg2dec.[ch]
Some remarks: To convert a QoS timestamp t running time, use: qostime = gst_segment_to_running_time (&dec->segment, GST_FORMAT_TIME, outtime); Also, mpeg2 normally has B and P frames that can be skipped. I'm working on an alternative patch that fixes some other issues with mpeg2dec (like crashing and leaking memory).
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_base_init), (gst_mpeg2dec_class_init), (gst_mpeg2dec_init), (gst_mpeg2dec_finalize), (gst_mpeg2dec_reset), (gst_mpeg2dec_qos_reset), (gst_mpeg2dec_alloc_buffer), (gst_mpeg2dec_negotiate_format), (init_dummybuf), (handle_sequence), (handle_picture), (handle_slice), (gst_mpeg2dec_chain), (gst_mpeg2dec_sink_event), (gst_mpeg2dec_src_event), (gst_mpeg2dec_change_state): * ext/mpeg2dec/gstmpeg2dec.h: Fix padtemplate as we can now do fractional framerates. Small cleanups. Use GstSegment. Add simple frame dropping QoS. Precalc buffer output sizes and UV offsets. Always give libmpeg2 a valid fbuf when it wants one. don't trust libmpeg to discard our buffers but manage it ourselves. Fixes #343627, #327350, #335288