class CodecAdapterEvents

Defined at line 21 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_adapter_events.h

We use an abstract base class here instead of letting CodecAdapter

sub-classes directly call CodecImpl, just to make sure the CodecAdapter uses

the intended interface to the CodecImpl.

Public Methods

void onCoreCodecFailCodec (const char * format)

If the core codec needs to fail the whole CodecImpl, such as when/if new

FormatDetails are different than the initial FormatDetails and

the core codec doesn't support switching from the old to the new input

format details (for example due to needing different input buffer config).

void onCoreCodecFailStream (fuchsia::media::StreamError error)

The core codec should only call this method at times when there is a

current stream, not between streams.

void onCoreCodecResetStreamAfterCurrentFrame ()

The core codec should only call this method at times when there is a

current stream, not between streams. If the core codec calls this method,

the core codec must also override CoreCodecResetStreamAfterCurrentFrame(),

which _may_ be called async from the StreamControl thread, if the client

hasn't already moved onto a new stream by then.

This call requests a call to CoreCodecResetStreamAfterCurrentFrame() on the

StreamControl thread (async with respect to this method call), if the

current stream isn't obsoleted first.

void onCoreCodecMidStreamOutputConstraintsChange (bool output_re_config_required)

"Mid-stream" can mean at the start of a stream also - it's just required

that a stream be active currently. The core codec must ensure that this

call is propertly ordered with respect to onCoreCodecOutputPacket() and

onCoreCodecOutputEndOfStream() calls.

A call to onCoreCodecMidStreamOutputConstraintsChange(true) must not be

followed by any more output (including EndOfStream) until the associated

output re-config is completed by a call to

CoreCodecMidStreamOutputBufferReConfigFinish().

void onCoreCodecOutputFormatChange ()

When the core codec calls this method, the CodecImpl will note that the

format has changed, and on next onCoreCodecOutputPacket(), the CodecImpl

will ask the core codec for the format and generate and send an

OnOutputformat() message before that output packet. This way, the core

codec is free to call onCoreCodecOutputFormat() repeatedly without any

packet in between, with CodecImpl collapsing these into one

OnOutputFormat() to avoid the extra message (so it doesn't have to be sent

and doesn't have to be handled by clients).

void onCoreCodecInputPacketDone (CodecPacket * packet)
void onCoreCodecOutputPacket (CodecPacket * packet, bool error_detected_before, bool error_detected_during)
void onCoreCodecOutputEndOfStream (bool error_detected_before)
void onCoreCodecLogEvent (media_metrics::StreamProcessorEvents2MigratedMetricDimensionEvent event_code)

If the CodecAdapter sub-class ever calls this method, the CodecAdapter sub-class must also

overide CoreCodecMetricsImplementation(), and not return std::nullopt from that method.