ext/xvid/gstxvidenc.c: Patch to mark outgoing encoded buffers as delta-units (or not).

Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet dot be>
* ext/xvid/gstxvidenc.c: (gst_xvidenc_init), (gst_xvidenc_setup),
(gst_xvidenc_chain):
Patch to mark outgoing encoded buffers as delta-units (or not).
Note that this patch also patches:
- the setting of fincr and fbase in xvid-encoder creation based on
caps framerate
- makes 0, rather than 2, the default max_b_frames, as the current
xvidenc does not seem "fully prepared" to handle b-frame
"effects", such as encoder returning 0 encoded bytes, etc.
Fixes #335585
This commit is contained in:
Mark Nauwelaerts 2006-03-23 09:15:09 +00:00 committed by Wim Taymans
parent a00eb33ece
commit 06e6b4ec67
2 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,18 @@
2006-03-23 Wim Taymans <wim@fluendo.com>
Patch by: Mark Nauwelaerts <manauw at skynet dot be>
* ext/xvid/gstxvidenc.c: (gst_xvidenc_init), (gst_xvidenc_setup),
(gst_xvidenc_chain):
Patch to mark outgoing encoded buffers as delta-units (or not).
Note that this patch also patches:
- the setting of fincr and fbase in xvid-encoder creation based on
caps framerate
- makes 0, rather than 2, the default max_b_frames, as the current
xvidenc does not seem "fully prepared" to handle b-frame
"effects", such as encoder returning 0 encoded bytes, etc.
Fixes #335585
2006-03-22 Tim-Philipp Müller <tim at centricular dot net> 2006-03-22 Tim-Philipp Müller <tim at centricular dot net>
* gst/modplug/libmodplug/Makefile.am: * gst/modplug/libmodplug/Makefile.am:

View file

@ -234,7 +234,7 @@ gst_xvidenc_init (GstXvidEnc * xvidenc)
xvidenc->width = xvidenc->height = xvidenc->csp = xvidenc->stride = -1; xvidenc->width = xvidenc->height = xvidenc->csp = xvidenc->stride = -1;
xvidenc->profile = XVID_PROFILE_S_L0; xvidenc->profile = XVID_PROFILE_S_L0;
xvidenc->bitrate = 512; xvidenc->bitrate = 512;
xvidenc->max_b_frames = 2; xvidenc->max_b_frames = 0;
xvidenc->max_key_interval = -1; /* default - 2*fps */ xvidenc->max_key_interval = -1; /* default - 2*fps */
xvidenc->buffer_size = 512; xvidenc->buffer_size = 512;
@ -259,8 +259,9 @@ gst_xvidenc_setup (GstXvidEnc * xvidenc)
xenc.max_bframes = xvidenc->max_b_frames; xenc.max_bframes = xvidenc->max_b_frames;
xenc.global = XVID_GLOBAL_PACKED; xenc.global = XVID_GLOBAL_PACKED;
xenc.fbase = 1000000; /* frame duration = fincr/fbase, is inverse of framerate */
xenc.fincr = (int) (xenc.fbase / xvidenc->fps_n / xvidenc->fps_d); /* FIX? */ xenc.fincr = xvidenc->fps_d;
xenc.fbase = xvidenc->fps_n;
xenc.max_key_interval = (xvidenc->max_key_interval == -1) ? xenc.max_key_interval = (xvidenc->max_key_interval == -1) ?
(2 * xenc.fbase / xenc.fincr) : xvidenc->max_key_interval; (2 * xenc.fbase / xenc.fincr) : xvidenc->max_key_interval;
xenc.handle = NULL; xenc.handle = NULL;
@ -340,6 +341,10 @@ gst_xvidenc_chain (GstPad * pad, GstBuffer * buf)
GST_BUFFER_SIZE (outbuf) = xstats.length; GST_BUFFER_SIZE (outbuf) = xstats.length;
/* mark whether key-frame = !delta-unit or not */
if (!(xframe.out_flags & XVID_KEYFRAME))
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
/* go out, multiply! */ /* go out, multiply! */
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (xvidenc->srcpad)); gst_buffer_set_caps (outbuf, GST_PAD_CAPS (xvidenc->srcpad));
ret = gst_pad_push (xvidenc->srcpad, outbuf); ret = gst_pad_push (xvidenc->srcpad, outbuf);