class CodecAdapterEvents
Defined at line 24 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)
Deprecated; use onCoreCodecMidStreamOutputConstraintsChange2 instead.
Passing false for output_re_config_required is deprecated (and has been for
a long time) and passing false will terminate the current process in
release builds as well as debug builds. The old meaning of false is now
communicated using onCoreCodecOutputFormatChange instead.
void onCoreCodecMidStreamOutputConstraintsChange2 (uint64_t constraints_version)
"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 properly ordered with respect to onCoreCodecOutputPacket() and
onCoreCodecOutputEndOfStream() calls.
When not using dynamic buffers, a call to
onCoreCodecMidStreamOutputConstraintsChange2 must not be followed by any
more output (including EndOfStream) until the associated output re-config
is completed by a call to CoreCodecMidStreamOutputBufferReConfigFinish().
When using dynamic buffers there is no such restriction - the core codec is
free to output a packet or EOS using any currently-added buffer (see also
EnableSameOutputBufferConcurrentlyInFlight).
The constraints_version value is in the same sequence as
CoreCodecGetBufferCollectionConstraints3Result.constraints_version.
Defined at line 63 of file ../../src/media/lib/codec_impl/include/lib/media/codec_impl/codec_adapter_events.h
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,boolerror_detected_before,boolerror_detected_during)
CodecAdapter(s) should take care to call onCoreCodecOutputPacket
referencing a buffer before any dropping of any CodecAdapter(s) handle(s)
to the referenced buffer.
void onCoreCodecOutputTimestampHasNoOutput (uint64_t timestamp_ish)
This must only be called between onCorecodecInputPacketDone and onCoreCodecOutputEndOfStream.
This does not need to be called if CoreCodecStopStream is called before a timestamp_ish value
has been resolved as to whether it would have generated output.
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.