Class: ADSP::Stream::Raw::NativeCompressor
- Inherits:
-
Object
- Object
- ADSP::Stream::Raw::NativeCompressor
- Defined in:
- lib/adsp/stream/raw/native_compressor.rb
Overview
ADSP::Stream::Raw::NativeCompressor class.
Instance Method Summary collapse
-
#close ⇒ Object
Closes compressor and cleans up internal resources.
-
#finish ⇒ Object
Finishes compressor and prepares result for
read_result
. -
#flush ⇒ Object
Flushes internal buffers and prepares result for
read_result
. -
#initialize(options) ⇒ NativeCompressor
constructor
Initializes native compressor.
-
#read_result ⇒ Object
Provides next part of unread result.
-
#write(source) ⇒ Object
Writes part of
source
string.
Constructor Details
#initialize(options) ⇒ NativeCompressor
Initializes native compressor. Option: :destination_buffer_length
destination buffer length.
15 16 17 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 15 def initialize() raise NotImplementedError end |
Instance Method Details
#close ⇒ Object
Closes compressor and cleans up internal resources. Raises UsedAfterCloseError
when used after close.
50 51 52 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 50 def close raise NotImplementedError end |
#finish ⇒ Object
Finishes compressor and prepares result for read_result
. Returns boolean that can be named as “need more destination”. User needs to call read_result
if “need more destination” is true.
44 45 46 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 44 def finish raise NotImplementedError end |
#flush ⇒ Object
Flushes internal buffers and prepares result for read_result
. Returns boolean that can be named as “need more destination”. User needs to call read_result
if “need more destination” is true.
37 38 39 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 37 def flush raise NotImplementedError end |
#read_result ⇒ Object
Provides next part of unread result. Returns empty string if there is no unread result.
30 31 32 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 30 def read_result raise NotImplementedError end |
#write(source) ⇒ Object
Writes part of source
string. Returns array of 2 values:
-
number of bytes written from
source
. -
boolean that can be named as “need more destination”.
User needs to call read_result
if “need more destination” is true.
24 25 26 |
# File 'lib/adsp/stream/raw/native_compressor.rb', line 24 def write(source) raise NotImplementedError end |