Class: ADSP::Stream::Raw::NativeCompressor

Inherits:
Object
  • Object
show all
Defined in:
lib/adsp/stream/raw/native_compressor.rb

Overview

ADSP::Stream::Raw::NativeCompressor class.

Instance Method Summary collapse

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(options)
  raise NotImplementedError
end

Instance Method Details

#closeObject

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

#finishObject

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

#flushObject

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_resultObject

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:

  1. number of bytes written from source.

  2. 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