Re: [chromium-dev] why the AndroidOverlay created by self is not shown on top of contentviewsuface?

54 views
Skip to first unread message

Dale Curtis

unread,
Jun 29, 2020, 5:40:23 PM6/29/20
to xke...@gmail.com, Frank Liberato, media-dev
bcc:chromium-dev, +media-dev +Frank Liberato 

- dale

On Mon, Jun 29, 2020 at 1:56 PM 尹超 <xke...@gmail.com> wrote:
Hi, chromium guys!

I used mojomediaservie to create one androidoverlay in M[73], just like what the media/gpu/android/media_codec_video_decoder does.

I passed the surface of androidoverlay to media player that integrated gstreamer. I can see the video when i close the browser app, and i can see the surface with android debug tools too.

How can i show the overlay on the top of contentviewsurface ?

Thanks in advance.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/2fcf2ea1-e68a-495c-90d9-29316bc8e1d3n%40chromium.org.

Frank Liberato

unread,
Jun 29, 2020, 9:41:58 PM6/29/20
to Dale Curtis, xke...@gmail.com, media-dev
DialogOverlayCore sets the z-order.  Normally it moves it under the compositor's output surface, because that's how chrome's overlay system expects it.  There is a magic flag |mAsPanel| that's used for tests that overrides it, and moves it higher.

However, it's one of those unsupported, use-at-your-own-risk kind of things.

Hope it helps.

thanks
-fl

尹超

unread,
Jun 29, 2020, 10:24:05 PM6/29/20
to media-dev, Frank Liberato
Hi Liberato,

How the mediacodecvideodecoder show the video if the dialog overlay  is under  the compositor's output surface?

尹超

unread,
Jun 29, 2020, 10:37:31 PM6/29/20
to media-dev, 尹超, Frank Liberato
Did i need to set the part of  compositor's output surface to transparent.

Frank Liberato

unread,
Jun 30, 2020, 1:44:20 AM6/30/20
to 尹超, media-dev
There are a few parts to making an underlay visible:
  • add an alpha channel to the compositor's output surface (CompositorSurfaceManager does this now, i think)
  • draw a transparent rectangle (overlay_strategy_underlay.cc does this now)
  • if the video is embedded in a scrollable page, move both the surface and and transparent rectangle in response to the scrolling.
    • this isn't ever quite synchronized, so there are some visible artifacts
i'd also mention that we don't use AndroidOverlay in favor of SurfaceControl, for android Q and later.

You might want to take a look at MediaPlayerRenderer for another approach.  It attaches MediaPlayer to a surface created by SurfaceTexture or ImageReader, which is then drawn by chrome's compositor as a gl texture.  It is likely to integrate more cleanly with chrome, though has some disadvantages too:
  • one additional texture copy per frame, in the compositor
  • only approximately frame accurate; chrome might miss a frame, i suppose.
I don't know if it's a better or worse fit for you, since I don't know what you're trying to do.

thanks
-fl

尹超

unread,
Jun 30, 2020, 2:42:44 AM6/30/20
to media-dev, Frank Liberato, media-dev, 尹超
In some cases, we would not use webmediaplayerimpl and mediapipeline for video playback.      
I have read the part of mediaplayerrender, but i have not fully  understand the logic of  compositor and  do not know the way to use surfacetexture and compositor without webmediaplayerimpl. 
SurfaceTexture  maybe not good for me, because our  browser runs on devices with poor performance, and i will do more performance test.
Reply all
Reply to author
Forward
0 new messages