class SimpleCodecServer
Defined at line 31 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
This class provides an implementation of the audio codec protocol to be subclassed by codec
drivers. The subclass must implement all the virtual methods and use Create() for construction.
Public Methods
template <typename T, typename... ConstructorSignature>
zx_status_t CreateAndAddToDdk (ConstructorSignature &&... args)
Create
A general method which handles the construction/initialization of
SimpleCodecServer implementation. Given an implementation called
'MyCodec', invocation should look something like..
auto codec = SimpleCodecServer::Create
<MyCodec
>(arg1, arg2, ...);
Defined at line 43 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
void ~SimpleCodecServer ()
Defined at line 57 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
void DdkRelease ()
Defined at line 58 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
void Connect (ConnectRequestView request, ConnectCompleter::Sync & completer)
|fuchsia.hardware.audio.CodecConnector| implementation.
Defined at line 66 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
bool SupportsSignalProcessing ()
Default only used for gain, mute and AGC support, override for custom signal processing API
usage.
Defined at line 100 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
async_dispatcher_t * dispatcher ()
The dispatcher's loop is guaranteed to be shutdown before "this" is deleted.
Defined at line 107 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
zx_status_t CodecConnect (zx::channel channel)
Defined at line 117 of file ../../src/media/audio/lib/simple-codec/simple-codec-server.cc
zx::result<DriverIds> Initialize ()
Called during Create(), it must return DriverIds or an error. Any resources allocated here must
be released before destruction, for instance in the Shutdown hook or the class destructor.
zx_status_t Shutdown ()
Called right before deallocation of the driver in DdkRelease() and also if there is an error
during creation in Create().
zx_status_t Reset ()
Protocol methods to be implemented by the driver, for descriptions see
//docs/concepts/drivers/driver_interfaces/audio_codec.md
Methods are simplified to use standard C++ types (see simple-codec-types.h) and also:
- Only allow standard frame formats (DaiFrameFormatStandard, see
//sdk/fidl/fuchsia.hardware.audio/dai_format.fidl).
- GetDaiFormats returns one DaiSupportedFormats instead of a vector (still allows supported
formats with multiple frame rates, number of channels, etc. just not overly complex ones).
- No need to implement WatchGainState, gain must only be changed by SetGainState.
- No need to implement WatchPlugState, the library always advertises "hardwired".
Info GetInfo ()
zx_status_t Stop ()
zx_status_t Start ()
DaiSupportedFormats GetDaiFormats ()
zx::result<CodecFormatInfo> SetDaiFormat (const DaiFormat & format)
GainFormat GetGainFormat ()
GainState GetGainState ()
void SetGainState (GainState state)
void SignalProcessingConnect (fidl::InterfaceRequest<fuchsia::hardware::audio::signalprocessing::SignalProcessing> signal_processing)
Defined at line 121 of file ../../src/media/audio/lib/simple-codec/simple-codec-server.cc
Protected Methods
void SimpleCodecServer (zx_device_t * parent)
Defined at line 110 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
inspect::Inspector & inspect ()
Defined at line 115 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
uint64_t GetTopologyId ()
Defined at line 116 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
uint64_t GetGainPeId ()
Defined at line 117 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
uint64_t GetMutePeId ()
Defined at line 118 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
uint64_t GetAgcPeId ()
Defined at line 119 of file ../../src/media/audio/lib/simple-codec/include/lib/simple-codec/simple-codec-server.h
Friends
class SimpleCodecServerInternal
class default_delete