Shaka Packager SDK
packager
media
base
offset_byte_queue.h
1
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef PACKAGER_MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
6
#define PACKAGER_MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
7
8
#include <stdint.h>
9
10
#include "packager/media/base/byte_queue.h"
11
12
namespace
shaka
{
13
namespace
media {
14
19
class
OffsetByteQueue
{
20
public
:
21
OffsetByteQueue
();
22
~
OffsetByteQueue
();
23
26
void
Reset();
27
void
Push(
const
uint8_t* buf,
int
size);
28
void
Peek(
const
uint8_t** buf,
int
* size);
29
void
Pop(
int
count);
31
38
void
PeekAt
(int64_t offset,
const
uint8_t** buf,
int
* size);
39
49
bool
Trim
(int64_t max_offset);
50
52
int64_t
head
() {
return
head_; }
55
int64_t
tail
() {
return
head_ + size_; }
56
57
private
:
58
// Synchronize |buf_| and |size_| with |queue_|.
59
void
Sync();
60
61
ByteQueue
queue_;
62
const
uint8_t* buf_;
63
int
size_;
64
int64_t head_;
65
66
DISALLOW_COPY_AND_ASSIGN(
OffsetByteQueue
);
67
};
68
69
}
// namespace media
70
}
// namespace shaka
71
72
#endif // PACKAGER_MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
shaka::media::OffsetByteQueue::Trim
bool Trim(int64_t max_offset)
Definition:
offset_byte_queue.cc:51
shaka::media::OffsetByteQueue::tail
int64_t tail()
Definition:
offset_byte_queue.h:55
shaka
All the methods that are virtual are virtual for mocking.
Definition:
gflags_hex_bytes.cc:11
shaka::media::OffsetByteQueue::PeekAt
void PeekAt(int64_t offset, const uint8_t **buf, int *size)
Definition:
offset_byte_queue.cc:41
shaka::media::OffsetByteQueue::head
int64_t head()
Definition:
offset_byte_queue.h:52
shaka::media::ByteQueue
Definition:
byte_queue.h:22
shaka::media::OffsetByteQueue
Definition:
offset_byte_queue.h:19
Generated on Tue Jun 22 2021 00:16:04 for Shaka Packager SDK by
1.8.17