From f7998dd665996654eab118153ff0503d1a9f144b Mon Sep 17 00:00:00 2001 From: hari22yuva <56021398+hari22yuva@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:49:24 +0000 Subject: [PATCH 1/6] gh #358 signalEOS() description update --- .../current/com/rdk/hal/audiodecoder/FrameMetadata.aidl | 6 ++++-- .../com/rdk/hal/audiodecoder/IAudioDecoderController.aidl | 6 ++++-- .../current/com/rdk/hal/videodecoder/FrameMetadata.aidl | 4 +++- .../com/rdk/hal/videodecoder/IVideoDecoderController.aidl | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl index b12f5dc4..1e8e0cdd 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl @@ -46,7 +46,7 @@ parcelable FrameMetadata { * The buffer contains Dolby Atmos audio and metadata. */ boolean isDolbyAtmos; - + /** * Audio trimming to use on presentation. */ @@ -59,7 +59,9 @@ parcelable FrameMetadata { boolean lowLatency; /** - * End of stream indicator. + * End of stream flag for decoder output. + * Set to true on the final frame output callback after signalEOS(), once all queued frames have been output. + * This may correspond to an end of stream marker in the audio bitstream, when present. */ boolean endOfStream; diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl index d93f8ad6..2aaa9977 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl @@ -109,7 +109,8 @@ interface IAudioDecoderController { * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called + * and the decoder has not been flushed or restarted. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE @@ -156,7 +157,8 @@ interface IAudioDecoderController { * The audio decoder must be in a state of `STARTED`. * Any frames held by the decoder should continue to be decoded and output. * No more audio buffers are expected to be delivered to the audio decoder after - * `signalEOS()` has been called unless the decoder is first flushed or stopped and started again. + * `signalEOS()` has been called unless the decoder is first flushed or stopped and started again. + * Any subsequent `decodeBuffer()` call in this state shall return false. * * An `IAudioDecoderControllerListener.onFrameOutput()` callback with `FrameMetadata.endOfStream` * must be set to true after all audio frames have been output. diff --git a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl index 0cbe3c5f..7015cac8 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl @@ -104,7 +104,9 @@ parcelable FrameMetadata { int frameRateDenominator; /** - * End of stream marker found in the video bitstream. + * End of stream flag for decoder output. + * Set to true on the final frame output callback after signalEOS(), once all queued frames have been output. + * This may correspond to an end of stream marker in the video bitstream, when present. */ boolean endOfStream; diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl index 7a22e5ad..bc7f5fad 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl @@ -107,7 +107,8 @@ interface IVideoDecoderController * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called + * and the decoder has not been flushed or restarted. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE @@ -158,6 +159,7 @@ interface IVideoDecoderController * * No more AV buffers are expected to be delivered to the Video Decoder after * `signalEOS()` has been called unless the decoder is first flushed or stopped and started again. + * Any subsequent `decodeBuffer()` call in this state shall return false. * * An `IVideoDecoderControllerListener.onFrameOutput()` callback with `FrameMetadata.endOfStream` * must be set to true after all video frames have been output. From d5e2847d4b74429ee2652e9c800773d9e7e38e21 Mon Sep 17 00:00:00 2001 From: Ulrond <131959864+Ulrond@users.noreply.github.com> Date: Thu, 19 Mar 2026 16:07:03 +0000 Subject: [PATCH 2/6] Apply suggestions from code review sensible changes Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../current/com/rdk/hal/audiodecoder/FrameMetadata.aidl | 2 +- .../com/rdk/hal/audiodecoder/IAudioDecoderController.aidl | 2 +- .../current/com/rdk/hal/videodecoder/FrameMetadata.aidl | 2 +- .../com/rdk/hal/videodecoder/IVideoDecoderController.aidl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl index 1e8e0cdd..5916a41e 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl @@ -60,7 +60,7 @@ parcelable FrameMetadata { /** * End of stream flag for decoder output. - * Set to true on the final frame output callback after signalEOS(), once all queued frames have been output. + * Set to true on the final frame output callback after IAudioDecoderController.signalEOS() has been invoked, once all queued frames have been output. * This may correspond to an end of stream marker in the audio bitstream, when present. */ boolean endOfStream; diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl index 2aaa9977..08623f82 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl @@ -110,7 +110,7 @@ interface IAudioDecoderController { * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called - * and the decoder has not been flushed or restarted. Buffer ownership remains with caller. + * and the decoder has not been flushed or stopped and started again. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE diff --git a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl index 7015cac8..2931f38b 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl @@ -105,7 +105,7 @@ parcelable FrameMetadata { /** * End of stream flag for decoder output. - * Set to true on the final frame output callback after signalEOS(), once all queued frames have been output. + * Set to true on the final frame output callback after IVideoDecoderController.signalEOS(), once all queued frames have been output. * This may correspond to an end of stream marker in the video bitstream, when present. */ boolean endOfStream; diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl index bc7f5fad..244f031f 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl @@ -108,7 +108,7 @@ interface IVideoDecoderController * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called - * and the decoder has not been flushed or restarted. Buffer ownership remains with caller. + * and the decoder has not been flushed or stopped and started again. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE From a22f4cfa576787063e666b83ba6b9ced40ed3481 Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 9 Apr 2026 09:05:18 +0100 Subject: [PATCH 3/6] gh #358 Updated EOS metadata information in framemetadata --- .../current/com/rdk/hal/audiodecoder/FrameMetadata.aidl | 3 ++- .../current/com/rdk/hal/videodecoder/FrameMetadata.aidl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl index 5916a41e..036cb674 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/FrameMetadata.aidl @@ -61,7 +61,8 @@ parcelable FrameMetadata { /** * End of stream flag for decoder output. * Set to true on the final frame output callback after IAudioDecoderController.signalEOS() has been invoked, once all queued frames have been output. - * This may correspond to an end of stream marker in the audio bitstream, when present. + * On an EOS-only callback (where the frame buffer handle is invalid), only this field is guaranteed to be meaningful. + * All other metadata fields are undefined and must not be interpreted by the client on such a callback. */ boolean endOfStream; diff --git a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl index 2931f38b..8e339d36 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl @@ -106,7 +106,8 @@ parcelable FrameMetadata { /** * End of stream flag for decoder output. * Set to true on the final frame output callback after IVideoDecoderController.signalEOS(), once all queued frames have been output. - * This may correspond to an end of stream marker in the video bitstream, when present. + * On an EOS-only callback (where the frame buffer handle is invalid), only this field is guaranteed to be meaningful. + * All other metadata fields are undefined and must not be interpreted by the client on such a callback. */ boolean endOfStream; From 50ddfcfb4a34c36e439337f146eddc59e28fe461 Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 9 Apr 2026 09:09:20 +0100 Subject: [PATCH 4/6] gh #258 added EOS-only callback details in the spec --- .../hal/audiodecoder/IAudioDecoderControllerListener.aidl | 5 +++++ .../hal/videodecoder/IVideoDecoderControllerListener.aidl | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl index 1b46f50d..bee62bb1 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl @@ -37,6 +37,11 @@ oneway interface IAudioDecoderControllerListener { * and `metadata` is non-null for the first frame after `State::START` or `State::FLUSHING`, * or whenever stream metadata changes. Metadata may be null if unchanged since the last callback. * + * On an EOS-only callback (after IAudioDecoderController.signalEOS(), where frameAVBufferHandle is -1 + * and FrameMetadata.endOfStream is true), metadata must be non-null but only the endOfStream field is + * guaranteed to be meaningful. All other metadata fields are undefined and must not be interpreted by + * the client. The client must not call IAVBuffer.free() as the handle is invalid. + * * Ownership semantics for `frameAVBufferHandle`: * - The client receives ownership of the AVBuffer handle when this callback is invoked. * - The client is responsible for managing the handle's lifecycle: either passing it to the next diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl index 639adae2..c1f2d416 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl @@ -35,6 +35,11 @@ oneway interface IVideoDecoderControllerListener { * when the metadata changes in the stream. * It can only be null if the contents have not changed since the last callback. * + * On an EOS-only callback (after IVideoDecoderController.signalEOS(), where frameAVBufferHandle is -1 + * and FrameMetadata.endOfStream is true), metadata must be non-null but only the endOfStream field is + * guaranteed to be meaningful. All other metadata fields are undefined and must not be interpreted by + * the client. The client must not call IAVBuffer.free() as the handle is invalid. + * * Ownership semantics for `frameAVBufferHandle`: * - The client receives ownership of the AVBuffer handle when this callback is invoked. * - The client is responsible for managing the handle's lifecycle: either passing it to the next From d93c3c756e93e1f82e631fd84fbe0217cb05e095 Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:42:10 +0100 Subject: [PATCH 5/6] gh #358 corrected the review points --- .../com/rdk/hal/audiodecoder/IAudioDecoderController.aidl | 3 +-- .../hal/audiodecoder/IAudioDecoderControllerListener.aidl | 5 ----- .../current/com/rdk/hal/videodecoder/FrameMetadata.aidl | 1 + .../com/rdk/hal/videodecoder/IVideoDecoderController.aidl | 3 +-- .../hal/videodecoder/IVideoDecoderControllerListener.aidl | 5 ----- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl index 08623f82..a6b69d89 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl @@ -109,8 +109,7 @@ interface IAudioDecoderController { * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called - * and the decoder has not been flushed or stopped and started again. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl index bee62bb1..1b46f50d 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderControllerListener.aidl @@ -37,11 +37,6 @@ oneway interface IAudioDecoderControllerListener { * and `metadata` is non-null for the first frame after `State::START` or `State::FLUSHING`, * or whenever stream metadata changes. Metadata may be null if unchanged since the last callback. * - * On an EOS-only callback (after IAudioDecoderController.signalEOS(), where frameAVBufferHandle is -1 - * and FrameMetadata.endOfStream is true), metadata must be non-null but only the endOfStream field is - * guaranteed to be meaningful. All other metadata fields are undefined and must not be interpreted by - * the client. The client must not call IAVBuffer.free() as the handle is invalid. - * * Ownership semantics for `frameAVBufferHandle`: * - The client receives ownership of the AVBuffer handle when this callback is invoked. * - The client is responsible for managing the handle's lifecycle: either passing it to the next diff --git a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl index 8e339d36..5f3fb4bd 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/FrameMetadata.aidl @@ -105,6 +105,7 @@ parcelable FrameMetadata { /** * End of stream flag for decoder output. + * Set to true on the onFrameOutput() callback when an EOS marker is detected in the video bitstream; the frame buffer handle is valid and all metadata fields are meaningful. * Set to true on the final frame output callback after IVideoDecoderController.signalEOS(), once all queued frames have been output. * On an EOS-only callback (where the frame buffer handle is invalid), only this field is guaranteed to be meaningful. * All other metadata fields are undefined and must not be interpreted by the client on such a callback. diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl index 244f031f..c8548391 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl @@ -107,8 +107,7 @@ interface IVideoDecoderController * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full, or `signalEOS()` has already been called - * and the decoder has not been flushed or stopped and started again. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl index c1f2d416..639adae2 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderControllerListener.aidl @@ -35,11 +35,6 @@ oneway interface IVideoDecoderControllerListener { * when the metadata changes in the stream. * It can only be null if the contents have not changed since the last callback. * - * On an EOS-only callback (after IVideoDecoderController.signalEOS(), where frameAVBufferHandle is -1 - * and FrameMetadata.endOfStream is true), metadata must be non-null but only the endOfStream field is - * guaranteed to be meaningful. All other metadata fields are undefined and must not be interpreted by - * the client. The client must not call IAVBuffer.free() as the handle is invalid. - * * Ownership semantics for `frameAVBufferHandle`: * - The client receives ownership of the AVBuffer handle when this callback is invoked. * - The client is responsible for managing the handle's lifecycle: either passing it to the next From 08b1b55195b7c906624e0ed9dcaafd9fdfea9f35 Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:54:01 +0100 Subject: [PATCH 6/6] gh #358 Corrected review comments --- .../com/rdk/hal/audiodecoder/IAudioDecoderController.aidl | 2 +- .../com/rdk/hal/videodecoder/IVideoDecoderController.aidl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl index a6b69d89..87e40c31 100644 --- a/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl +++ b/audiodecoder/current/com/rdk/hal/audiodecoder/IAudioDecoderController.aidl @@ -109,7 +109,7 @@ interface IAudioDecoderController { * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full or signalEOS is called. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE diff --git a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl index c8548391..8e6dfcf1 100644 --- a/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl +++ b/videodecoder/current/com/rdk/hal/videodecoder/IVideoDecoderController.aidl @@ -107,7 +107,7 @@ interface IVideoDecoderController * * @returns boolean * @retval true Buffer successfully queued for decoding. Buffer ownership transfers to HAL. - * @retval false Internal decode buffer queue is full. Buffer ownership remains with caller. + * @retval false Internal decode buffer queue is full or signalEOS is called. Buffer ownership remains with caller. * * @exception binder::Status::Exception::EX_NONE for success * @exception binder::Status::Exception::EX_ILLEGAL_STATE