New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 678339 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Feature



Sign in to add a comment

Report media::PipelineMetadata when Video/AudioDecoderConfig changes

Project Member Reported by x...@chromium.org, Jan 4 2017

Issue description

media::PipelineMetadata is currently only reported once after Demuxer is initialized. https://cs.chromium.org/chromium/src/media/base/pipeline_impl.cc?rcl=1483532378&l=246

This metadata is used by Media Remoting to switch between default and remoting renderers, and to scale the remoting interstitial. It should be reported when Video/AudioDecoderConfig changes.

Solution:
1. Add callback to DemuxerStream to inform Demuxer when config changes.
2. Notify PipelineImpl::RendererWrapper through the DemuxerHost interface.
3. Call PipelineImpl::RendererWrapper::ReportMetadata() to report the metadata.

sandersd@ and xhwang@: sgty?
 
What metadata do you need exactly?

Natural size, for example, is part of the metadata, but is also reported via. OnVideoNaturalSizeChanged(). Perhaps we should just be hooking up callbacks for each of the additional things that you need.

Comment 2 by x...@chromium.org, Jan 4 2017

Currently we need to know the change on natural size and codec. But we may need more (or add more) in Audio/VideoDecoderConfig, for example, fps, profile, to check whether it matches receiver's capability. 

I do see some of the config changes are reported via OnVideoNatrualSizeChanged() and OnVideoOpacityChange() by Renderer. Since either the natural size or the video opacity can only be changed when config changes, can we just call OnMetaData() to report the new config to WMPI when config config changes (instead checking in VideoRendererImpl::CheckForMetadataChanges())? Currently the natural size is reported both through OnMetaData() and OnVideoNaturalSizeChanged() in WMPI.

It seems that both Renderer and DemuxerStream can know when config changes. Is there any preference on who should report the change? 

Comment 3 by x...@chromium.org, Jan 6 2017

CL is out for review: https://codereview.chromium.org/2620433002/, which directly inform MediaObserver with updated meta data when OnVideoNaturalSizeChanged(). 

Comment 4 by x...@chromium.org, Jan 6 2017

Another issue is to estimate the frame rate and report changes. 
For non-mse sources, the "r_frame_rate" field in AVStream is the estimated frame rate (https://cs.chromium.org/chromium/src/third_party/ffmpeg/libavformat/avformat.h?rcl=0&l=1094). But for mse sources, no frame rate is estimated. 
I tried estimate it in VideoRendererImpl::FrameReady() using the following logic:
fps = 1000.0 / (frame->timestamp()-last_frame_ready_).InMillisecondsF();
It seems work pretty well for both local sources and mse sources (YouTube, Vimeo). The estimate is also stable (almost constant). 
And then we can report any changes by adding a callback (similar to that for the natural size change). sg?
I don't expect this computation to be very stable; in particular blackness is often encoded with extra long frames; you probably want the maximum frame rate over a window.

What exactly are you using the frame rate for? Perhaps the requirements you have are different from what I imagine.
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/516ef6d9c0c19352fb80ecaa4e635e60501125fb

commit 516ef6d9c0c19352fb80ecaa4e635e60501125fb
Author: xjz <xjz@chromium.org>
Date: Sat Jan 07 00:23:06 2017

Inform MediaObserver when video natural size changes.

BUG= 678339 

Review-Url: https://codereview.chromium.org/2620433002
Cr-Commit-Position: refs/heads/master@{#442107}

[modify] https://crrev.com/516ef6d9c0c19352fb80ecaa4e635e60501125fb/media/blink/webmediaplayer_impl.cc

Comment 7 by x...@chromium.org, Jan 12 2017

Status: Fixed (was: Started)

Sign in to add a comment