Simplify.

This commit is contained in:
gb 2010-05-03 21:25:46 +00:00 committed by Gwenole Beauchesne
parent fe35801572
commit 5851086b92

View file

@ -48,29 +48,6 @@ enum {
PROP_HEIGHT, PROP_HEIGHT,
}; };
static inline void
init_buffer(GstBuffer *buffer, const guchar *buf, guint buf_size)
{
GST_BUFFER_DATA(buffer) = (guint8 *)buf;
GST_BUFFER_SIZE(buffer) = buf_size;
GST_BUFFER_TIMESTAMP(buffer) = GST_CLOCK_TIME_NONE;
GST_BUFFER_DURATION(buffer) = GST_CLOCK_TIME_NONE;
}
static inline GstBuffer *
create_eos_buffer(void)
{
GstBuffer *buffer;
buffer = gst_buffer_new();
if (!buffer)
return NULL;
init_buffer(buffer, NULL, 0);
GST_BUFFER_FLAG_SET(buffer, GST_BUFFER_FLAG_EOS);
return buffer;
}
static void static void
destroy_buffer(GstBuffer *buffer) destroy_buffer(GstBuffer *buffer)
{ {
@ -83,9 +60,10 @@ push_buffer(GstVaapiDecoder *decoder, GstBuffer *buffer)
GstVaapiDecoderPrivate * const priv = decoder->priv; GstVaapiDecoderPrivate * const priv = decoder->priv;
if (!buffer) { if (!buffer) {
buffer = create_eos_buffer(); buffer = gst_buffer_new();
if (!buffer) if (!buffer)
return FALSE; return FALSE;
GST_BUFFER_FLAG_SET(buffer, GST_BUFFER_FLAG_EOS);
} }
GST_DEBUG("queue encoded data buffer %p (%d bytes)", GST_DEBUG("queue encoded data buffer %p (%d bytes)",