Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
Public Member Functions | List of all members
zep::audio::PcmBufferWriter Class Referencefinal

Writer implementation of PCM buffer. More...

#include <PcmBufferWriter.hpp>

Public Member Functions

 PcmBufferWriter () noexcept
 Construct a PcmBufferWriter object by default with no management target.
 
 PcmBufferWriter (const std::weak_ptr< PcmBufferPoolInterface > &pool_weak, std::int16_t *pointer, std::size_t writable_samples) noexcept
 Construct a PcmBufferWriter object.
 
 PcmBufferWriter (PcmBufferWriter &&other) noexcept
 PcmBufferWriter object move construct.
 
PcmBufferWriteroperator= (PcmBufferWriter &&other) noexcept
 Move assignment of PcmBufferWriter object.
 
 PcmBufferWriter (const PcmBufferWriter &)=delete
 
PcmBufferWriteroperator= (const PcmBufferWriter &)=delete
 
 ~PcmBufferWriter () noexcept
 Destroy PcmBufferWriter object.
 
bool IsValid () const noexcept
 Get whether or not a valid buffer is held.
 
 operator bool () const noexcept
 Get whether or not a valid buffer is held.
 
std::int16_t * GetPointer () const noexcept
 get first pointer to managed buffer.
 
std::size_t GetWritableSamples () const noexcept
 Get the maximum number of samples that can be written.
 
void Finalize (std::size_t written_samples, TimestampInterface::Rep head_timestamp) noexcept
 Notify completion of writing data into buffer.
 
void Cancel () noexcept
 Notify the cancellation of writing data into the buffer.
 
 PcmBufferWriter () noexcept
 PcmBufferWriterオブジェクトを管理対象無しでデフォルト構築する。
 
 PcmBufferWriter (const std::weak_ptr< PcmBufferPoolInterface > &pool_weak, std::int16_t *pointer, std::size_t writable_samples) noexcept
 PcmBufferWriterオブジェクトを構築する。
 
 PcmBufferWriter (PcmBufferWriter &&other) noexcept
 PcmBufferWriterオブジェクトをムーブ構築する。
 
PcmBufferWriteroperator= (PcmBufferWriter &&other) noexcept
 PcmBufferWriterオブジェクトをムーブ代入する。
 
 PcmBufferWriter (const PcmBufferWriter &)=delete
 
PcmBufferWriteroperator= (const PcmBufferWriter &)=delete
 
 ~PcmBufferWriter () noexcept
 PcmBufferWriterオブジェクトを破棄する。
 
bool IsValid () const noexcept
 有効なバッファを保持しているか否かを取得する。
 
 operator bool () const noexcept
 有効なバッファを保持しているか否かを取得する。
 
std::int16_t * GetPointer () const noexcept
 管理対象バッファの先頭ポインタを取得する
 
std::size_t GetWritableSamples () const noexcept
 書き込める最大サンプル数を取得する。
 
void Finalize (std::size_t written_samples, TimestampInterface::Rep head_timestamp) noexcept
 バッファへのデータ書き込み完了を通知する。
 
void Cancel () noexcept
 バッファへのデータ書き込みキャンセルを通知する。
 

Detailed Description

Writer implementation of PCM buffer.

PCMバッファのWriter実装

Note
There is no concept of the number of channels in this buffer.
There is no concept of the number of channels in this buffer, therefore, the capacity and the number of effective elements are the number of samples for the total of all channels.
本バッファにはチャネル数という概念が存在しない。 よって容量や有効要素数は全チャンネル合計分のサンプル数になる。

Constructor & Destructor Documentation

◆ PcmBufferWriter() [1/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( )
inlinenoexcept

Construct a PcmBufferWriter object by default with no management target.

class PcmBufferWriter /**

Postcondition
IsValid() == false

◆ PcmBufferWriter() [2/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( const std::weak_ptr< PcmBufferPoolInterface > &  pool_weak,
std::int16_t *  pointer,
std::size_t  writable_samples 
)
inlinenoexcept

Construct a PcmBufferWriter object.

Parameters
pool_weakPool owned by
pointermanaged buffer
writable_samplesNumber of writable samples

◆ PcmBufferWriter() [3/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( PcmBufferWriter &&  other)
inlinenoexcept

PcmBufferWriter object move construct.

Parameters
otherMove source

◆ PcmBufferWriter() [4/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( )
inlinenoexcept

PcmBufferWriterオブジェクトを管理対象無しでデフォルト構築する。

Postcondition
IsValid() == false

◆ PcmBufferWriter() [5/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( const std::weak_ptr< PcmBufferPoolInterface > &  pool_weak,
std::int16_t *  pointer,
std::size_t  writable_samples 
)
inlinenoexcept

PcmBufferWriterオブジェクトを構築する。

Parameters
pool_weak所有しているプール
pointer管理対象バッファ
writable_samples書き込み可能なサンプル数

◆ PcmBufferWriter() [6/6]

zep::audio::PcmBufferWriter::PcmBufferWriter ( PcmBufferWriter &&  other)
inlinenoexcept

PcmBufferWriterオブジェクトをムーブ構築する。

Parameters
otherムーブ元

Member Function Documentation

◆ Cancel() [1/2]

void zep::audio::PcmBufferWriter::Cancel ( )
inlinenoexcept

Notify the cancellation of writing data into the buffer.

Note
After calling this function, the pointer returned by GetPointer()
After calling this function, the pointer returned by GetPointer() must not be accessed.
Postcondition
IsValid() == false

◆ Cancel() [2/2]

void zep::audio::PcmBufferWriter::Cancel ( )
inlinenoexcept

バッファへのデータ書き込みキャンセルを通知する。

Note
この関数を呼んだ後は、GetPointer()の返すポインタへ アクセスしてはならない。
Postcondition
IsValid() == false

◆ Finalize() [1/2]

void zep::audio::PcmBufferWriter::Finalize ( std::size_t  written_samples,
TimestampInterface::Rep  head_timestamp 
)
inlinenoexcept

Notify completion of writing data into buffer.

Note
After calling this function, the pointer returned by GetPointer() must not be accessed.
Postcondition
IsValid() == false
Parameters
written_samplesNumber of valid samples written. (If 0, it is assumed to be canceled.)
head_timestamptimestamp value of the first sample
Note
if the advance of timestamp is not contiguous with the buffer being accumulated,
if the number of samples written is not a multiple of the number of channels,

◆ Finalize() [2/2]

void zep::audio::PcmBufferWriter::Finalize ( std::size_t  written_samples,
TimestampInterface::Rep  head_timestamp 
)
inlinenoexcept

バッファへのデータ書き込み完了を通知する。

Note
この関数を呼んだ後は、GetPointer()の返すポインタへアクセスしてはならない。
Postcondition
IsValid() == false
Parameters
written_samples書き込まれた有効サンプル数 (0の場合、キャンセルと見なす)
head_timestamp先頭サンプルのタイムスタンプ値
Note
タイムスタンプの進みが蓄積中のバッファと連続しない場合、 または、書き込まれたサンプル数がチャネル数の倍数では無い場合、 データの破棄や0埋めなどの調整処理が行われる可能性がある。

◆ GetPointer() [1/2]

std::int16_t * zep::audio::PcmBufferWriter::GetPointer ( ) const
inlinenoexcept

get first pointer to managed buffer.

Return values
nullptrno managed buffer
non-nullptrFirst pointer to managed buffer

◆ GetPointer() [2/2]

std::int16_t * zep::audio::PcmBufferWriter::GetPointer ( ) const
inlinenoexcept

管理対象バッファの先頭ポインタを取得する

Return values
nullptr管理対象バッファが無い
非nullptr管理対象バッファの先頭ポインタ

◆ GetWritableSamples() [1/2]

std::size_t zep::audio::PcmBufferWriter::GetWritableSamples ( ) const
inlinenoexcept

Get the maximum number of samples that can be written.

Note
The number of samples is the total number of samples for all channels, not for each channel.
The unit is the number of samples, not the number of bytes.
Return values
0No element can be written (including cases where no valid buffer is held).

◆ GetWritableSamples() [2/2]

std::size_t zep::audio::PcmBufferWriter::GetWritableSamples ( ) const
inlinenoexcept

書き込める最大サンプル数を取得する。

Note
チャネル毎ではなく、全チャネル合計のサンプル数となる。
単位はサンプル数であり、バイト数ではない。
Return values
0書き込める要素がない(有効なバッファを保持していない場合も含む)

◆ IsValid() [1/2]

bool zep::audio::PcmBufferWriter::IsValid ( ) const
inlinenoexcept

Get whether or not a valid buffer is held.

Return values
trueholds a valid buffer
falseDoes not hold a valid buffer

◆ IsValid() [2/2]

bool zep::audio::PcmBufferWriter::IsValid ( ) const
inlinenoexcept

有効なバッファを保持しているか否かを取得する。

Return values
true有効なバッファを保持している
false有効なバッファを保持していない

◆ operator bool() [1/2]

zep::audio::PcmBufferWriter::operator bool ( ) const
inlineexplicitnoexcept

Get whether or not a valid buffer is held.

See also
IsValid()
Return values
trueholds a valid buffer
falseDoes not hold a valid buffer

◆ operator bool() [2/2]

zep::audio::PcmBufferWriter::operator bool ( ) const
inlineexplicitnoexcept

有効なバッファを保持しているか否かを取得する。

See also
IsValid()
Return values
true有効なバッファを保持している
false有効なバッファを保持していない

◆ operator=() [1/2]

PcmBufferWriter & zep::audio::PcmBufferWriter::operator= ( PcmBufferWriter &&  other)
inlinenoexcept

Move assignment of PcmBufferWriter object.

Parameters
otherMove source

◆ operator=() [2/2]

PcmBufferWriter & zep::audio::PcmBufferWriter::operator= ( PcmBufferWriter &&  other)
inlinenoexcept

PcmBufferWriterオブジェクトをムーブ代入する。

Parameters
otherムーブ元

The documentation for this class was generated from the following files: