Closed Bug 1372080 Opened 7 years ago Closed 7 years ago

[EME] Reorder frames coming out of Widevine CDM

Categories

(Core :: Audio/Video: GMP, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

Details

Attachments

(1 file)

The next version of the Widevine CDM (970) has a new H.264 decoder, and it doesn't reorder frames it decodes. So we need to reorder manually.
Comment on attachment 8876575 [details]
Bug 1372080 - Reorder frames decoded by Widevine CDM.

https://reviewboard.mozilla.org/r/147910/#review152276

::: dom/media/gmp/ChromiumCDMParent.h:19
(Diff revision 1)
>  #include "mozilla/RefPtr.h"
>  #include "nsDataHashtable.h"
>  #include "PlatformDecoderModule.h"
>  #include "ImageContainer.h"
>  #include "mozilla/Span.h"
> +#include "ReorderQueue.h"

those includes should be in alhabetical order...

::: dom/media/gmp/ChromiumCDMParent.h:132
(Diff revision 1)
>    ipc::IPCResult RecvResetVideoDecoderComplete() override;
>    ipc::IPCResult RecvDrainComplete() override;
>    void ActorDestroy(ActorDestroyReason aWhy) override;
>    bool SendBufferToCDM(uint32_t aSizeInBytes);
>  
> +  void ReorderAndReturnOutput(RefPtr<VideoData> aFrame);

You call ReorderAndReturnOutput(Move(v)) so make this take a rvalue RefPtr<VideoData>&&

Otherwise, the move is wasted.

::: dom/media/gmp/ChromiumCDMParent.cpp:745
(Diff revision 1)
>  
>  ipc::IPCResult
>  ChromiumCDMParent::RecvDecodedShmem(const CDMVideoFrame& aFrame,
>                                      ipc::Shmem&& aShmem)
>  {
> -  GMP_LOG("ChromiumCDMParent::RecvDecodedShmem(this=%p)", this);
> +  GMP_LOG("ChromiumCDMParent::RecvDecodedShmem(this=%p) t=%lld d=%lld",

that's going to do warning as error on some build, need to use PRId64 etc...

::: dom/media/gmp/ChromiumCDMParent.cpp:789
(Diff revision 1)
>  
>    return IPC_OK();
>  }
>  
> +void
> +ChromiumCDMParent::ReorderAndReturnOutput(RefPtr<VideoData> aFrame)

RefPtr<VideoData>&& aFrame

::: dom/media/gmp/ChromiumCDMParent.cpp:791
(Diff revision 1)
>  }
>  
> +void
> +ChromiumCDMParent::ReorderAndReturnOutput(RefPtr<VideoData> aFrame)
> +{
> +  if (mMaxRefFrames > 0) {

Personally, I would drop one level with something like:

if (mMaxRefFrames == 0) {
  ResolveIfExists(...)
  return;
}

....
Attachment #8876575 - Flags: review?(jyavenard) → review+
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0690e322191e
Reorder frames decoded by Widevine CDM. r=jya
https://hg.mozilla.org/mozilla-central/rev/0690e322191e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
This bug may lead to the normal I-frame can not decode play it?
This bug caused the frame output by the Widevine CDM to be played in the wrong order. The frames were decoded correctly, but were not reordered into the correct display order.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: