mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
basevideo: remove compatibility code
This commit is contained in:
parent
da14b6e292
commit
b67706b584
1 changed files with 0 additions and 112 deletions
|
@ -165,115 +165,3 @@ gst_video_state_get_timestamp (const GstVideoState * state,
|
|||
}
|
||||
}
|
||||
|
||||
/* gst adapter */
|
||||
|
||||
static GSList *
|
||||
get_chunk (GstAdapter * adapter, int offset, int *skip)
|
||||
{
|
||||
GSList *g;
|
||||
|
||||
#if 1
|
||||
if (skip)
|
||||
*skip = 0;
|
||||
#endif
|
||||
|
||||
g_return_val_if_fail (offset >= 0, NULL);
|
||||
g_return_val_if_fail (offset < adapter->size, NULL);
|
||||
|
||||
offset += adapter->skip;
|
||||
g = adapter->buflist;
|
||||
while (g) {
|
||||
if (offset < GST_BUFFER_SIZE (GST_BUFFER_CAST (g->data))) {
|
||||
if (skip)
|
||||
*skip = offset;
|
||||
return g;
|
||||
}
|
||||
offset -= GST_BUFFER_SIZE (GST_BUFFER_CAST (g->data));
|
||||
g = g->next;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static int
|
||||
scan_fast (guint8 * data, guint32 pattern, guint32 mask, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
pattern &= mask;
|
||||
for (i = 0; i < n; i++) {
|
||||
if ((GST_READ_UINT32_BE (data + i) & mask) == pattern) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
scan_slow (GstAdapter * adapter, GSList * g, int skip, guint32 pattern,
|
||||
guint32 mask)
|
||||
{
|
||||
guint8 tmp[4];
|
||||
int j;
|
||||
|
||||
pattern &= mask;
|
||||
for (j = 0; j < 4; j++) {
|
||||
tmp[j] = ((guint8 *) GST_BUFFER_DATA (GST_BUFFER_CAST (g->data)))[skip];
|
||||
skip++;
|
||||
if (skip >= GST_BUFFER_SIZE (GST_BUFFER_CAST (g->data))) {
|
||||
g = g->next;
|
||||
skip = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ((GST_READ_UINT32_BE (tmp) & mask) == pattern);
|
||||
}
|
||||
|
||||
int
|
||||
gst_adapter_masked_scan_uint32_compat (GstAdapter * adapter, guint32 mask,
|
||||
guint32 pattern, guint offset, guint n)
|
||||
{
|
||||
GSList *g;
|
||||
int j;
|
||||
int k;
|
||||
int skip;
|
||||
int m;
|
||||
|
||||
g_return_val_if_fail (n >= 0, -1);
|
||||
g_return_val_if_fail (offset >= 0, -1);
|
||||
g_return_val_if_fail (offset + n + 4 <= adapter->size, -1);
|
||||
|
||||
g = get_chunk (adapter, offset, &skip);
|
||||
j = 0;
|
||||
while (j < n) {
|
||||
m = MIN (GST_BUFFER_SIZE (GST_BUFFER_CAST (g->data)) - skip - 4, 0);
|
||||
if (m > 0) {
|
||||
k = scan_fast (GST_BUFFER_DATA (GST_BUFFER_CAST (g->data)) + skip,
|
||||
pattern, mask, m);
|
||||
if (k < m) {
|
||||
return offset + j + k;
|
||||
}
|
||||
j += m;
|
||||
skip += m;
|
||||
} else {
|
||||
if (scan_slow (adapter, g, skip, pattern, mask)) {
|
||||
return offset + j;
|
||||
}
|
||||
j++;
|
||||
skip++;
|
||||
}
|
||||
if (skip >= GST_BUFFER_SIZE (GST_BUFFER_CAST (g->data))) {
|
||||
g = g->next;
|
||||
skip = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
GstBuffer *
|
||||
gst_adapter_get_buffer (GstAdapter * adapter)
|
||||
{
|
||||
return gst_buffer_ref (GST_BUFFER_CAST (adapter->buflist->data));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue