class CodecBuffer

Defined at line 37 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_buffer.h

TODO(dustingreen): Support BufferCollection buffers.

These are 1:1 with Codec buffers, but not necessarily 1:1 with core codec

buffers.

The const-ness of a CodecBuffer refers to the fields of the CodecBuffer

instance, not to the data pointed at by buffer_base().

Public Methods

uint8_t * base ()

The vaddr of the start of the mapped VMO for this buffer.

This will return nullptr if there's no VMO mapping because CPU access isn't

possible. In that case the vaddr data pointer passed around regarding a

packet will be an offset into the buffer / VMO, and is only meaningful

with respect to a CodecBuffer that's also passed alongside.

Defined at line 32 of file ../../src/media/lib/test/include/lib/media/test/codec_buffer.h

uint64_t lifetime_ordinal ()

This is the same value as buffer_lifetime_ordinal in StreamProcessor FIDL.

Defined at line 40 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_buffer.h

uint32_t index ()

This matches the buffer_index field of fuchsia::media::Packet when the packet refers to this

buffer.

Defined at line 44 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_buffer.h

CodecPort port ()

Defined at line 46 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_buffer.h

bool is_secure ()

Defined at line 48 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_buffer.h

void ~CodecBuffer ()
std::unique_ptr<CodecBuffer> CreateFromVmo (uint32_t buffer_index, zx::vmo vmo, uint32_t vmo_usable_start, uint32_t vmo_usable_size, bool need_write, bool is_physically_contiguous)

Defined at line 61 of file ../../src/media/lib/test/codec_buffer.cc

bool GetDupVmo (bool is_for_write, zx::vmo * out_vmo)

Each successful call to this method dups the VMO handle, with basic rights

+ read + optional write depending on is_for_write.

Defined at line 26 of file ../../src/media/lib/test/codec_buffer.cc

uint32_t buffer_index ()

In buffer-per-packet mode this is equal to the corresponding packet index,

for purposes of mapping from packet_index to buffer_index.

Defined at line 14 of file ../../src/media/lib/test/codec_buffer.cc

size_t size_bytes ()

Defined at line 33 of file ../../src/media/lib/test/include/lib/media/test/codec_buffer.h

bool is_known_contiguous ()

Defined at line 84 of file ../../src/media/lib/codec_impl/codec_buffer.cc

zx_paddr_t physical_base ()

This will ZX_PANIC() if the buffer hasn't been pinned yet, or if !is_known_contiguous().

Defined at line 86 of file ../../src/media/lib/codec_impl/codec_buffer.cc

size_t size ()

Defined at line 95 of file ../../src/media/lib/codec_impl/codec_buffer.cc

const zx::vmo & vmo ()

The main VMO.

Defined at line 35 of file ../../src/media/lib/test/include/lib/media/test/codec_buffer.h

uint64_t vmo_offset ()

The offset within the main VMO where data of this CodecBuffer starts. The vmo_offset() is not

required to be divisible by page size.

Defined at line 36 of file ../../src/media/lib/test/include/lib/media/test/codec_buffer.h

bool is_physically_contiguous ()

For testing.

Defined at line 39 of file ../../src/media/lib/test/include/lib/media/test/codec_buffer.h

void SetVideoFrame (std::weak_ptr<VideoFrame> video_frame)

The use of weak_ptr

<

> here is to emphasize that we don't need shared_ptr

<

>

to keep the VideoFrame(s) alive. We'd use a raw pointer here if it weren't

for needing to convert to a shared_ptr

<

> to call certain methods that

expect shared_ptr

<

>.

This is marked const because it only mutates a mutable field, which is

considered mutable because it's about establishing an association between

video_frame and CodecBuffer after CodecBuffer has been constructed.

Defined at line 101 of file ../../src/media/lib/codec_impl/codec_buffer.cc

std::weak_ptr<VideoFrame> video_frame ()

Defined at line 105 of file ../../src/media/lib/codec_impl/codec_buffer.cc

zx_status_t Pin ()

Unpin is automatic during ~CodecBuffer.

Defined at line 107 of file ../../src/media/lib/codec_impl/codec_buffer.cc

bool is_pinned ()

Defined at line 149 of file ../../src/media/lib/codec_impl/codec_buffer.cc

void CacheFlush (uint32_t flush_offset, uint32_t length)

Defined at line 151 of file ../../src/media/lib/codec_impl/codec_buffer.cc

void CacheFlushAndInvalidate (uint32_t flush_offset, uint32_t length)

Defined at line 155 of file ../../src/media/lib/codec_impl/codec_buffer.cc

Friends

class CodecBufferForTest
class default_delete
class unique_ptr
class CodecImpl