mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
Simplify.
This commit is contained in:
parent
fe35801572
commit
5851086b92
1 changed files with 2 additions and 24 deletions
|
@ -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)",
|
||||||
|
|
Loading…
Reference in a new issue