#include "gstvaapidecoder_priv.h"
#include "gstvaapidisplay_priv.h"
#include "gstvaapiobject_priv.h"
-#include "gstvaapiutils_tsb.h"
#define DEBUG 1
#include "gstvaapidebug.h"
GstVaapiPicture *current_picture;
GstVaapiPicture *next_picture;
GstVaapiPicture *prev_picture;
- GstVaapiTSB *tsb;
+ GstAdapter *adapter;
GstBuffer *sub_buffer;
guint mb_y;
guint mb_height;
priv->sub_buffer = NULL;
}
- if (priv->tsb) {
- gst_vaapi_tsb_destroy(priv->tsb);
- priv->tsb = NULL;
+ if (priv->adapter) {
+ gst_adapter_clear(priv->adapter);
+ g_object_unref(priv->adapter);
+ priv->adapter = NULL;
}
}
gst_vaapi_decoder_mpeg2_close(decoder);
- priv->tsb = gst_vaapi_tsb_new();
- if (!priv->tsb)
- return FALSE;
+ priv->adapter = gst_adapter_new();
+ if (!priv->adapter)
+ return FALSE;
return TRUE;
}
priv->fps_d = seq_hdr->fps_d;
gst_vaapi_decoder_set_framerate(base_decoder, priv->fps_n, priv->fps_d);
- priv->seq_pts = gst_vaapi_tsb_get_timestamp(priv->tsb);
+ priv->seq_pts = gst_adapter_prev_timestamp(priv->adapter, NULL);
priv->width = seq_hdr->width;
priv->height = seq_hdr->height;
break;
ofs = tos->offset - pos + tos->size;
- gst_vaapi_tsb_pop(priv->tsb, ofs);
+ if (gst_adapter_available(priv->adapter) >= ofs)
+ gst_adapter_flush(priv->adapter, ofs);
pos += ofs;
switch (tos->type) {
if (!buf && buf_size == 0)
return decode_sequence_end(decoder);
- gst_vaapi_tsb_push(priv->tsb, buffer);
-
+ gst_buffer_ref(buffer);
+ gst_adapter_push(priv->adapter, buffer);
if (priv->sub_buffer) {
buffer = gst_buffer_merge(priv->sub_buffer, buffer);
if (!buffer)
priv->current_picture = NULL;
priv->next_picture = NULL;
priv->prev_picture = NULL;
- priv->tsb = NULL;
+ priv->adapter = NULL;
priv->sub_buffer = NULL;
priv->mb_y = 0;
priv->mb_height = 0;