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

Issue 768317 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Add VideoRotation to VideoDecoderConfig

Project Member Reported by julien.isorce@chromium.org, Sep 25 2017

Issue description

I am suggesting to add VideoOrientation to VideoDecoderConfig.
Currently VideoRotation is a bit floating evreywhere and get from media/base/demuxer_stream.h::video_rotation()

For ffmpeg it is parsed here: https://chromium.googlesource.com/chromium/src/+/master/media/filters/ffmpeg_demuxer.cc#328 .

Instead it could be done like other metadata and added to the VideoDecoderConfig here https://chromium.googlesource.com/chromium/src/+/master/media/ffmpeg/ffmpeg_common.cc#515 like done for pixel format.


For original CL that introduced VideoRotation see 
 https://codereview.chromium.org/363813002/

 
Cc: chcunningham@chromium.org xhw...@chromium.org
I think this sounds reasonable. +xhwang, chcunningham for thoughts.
Cc: sande...@chromium.org
No objection. 

This reminds me that we have things to decoder configs that will trigger decoder flush/reset when the decoder itself really doesn't care. That's been true for a while (with addition of HDR and color space info). Any objection to detecting that condition upon config changes in DecoderStream and doing only a "soft" config change for things like rotation?

+sandersd

Comment 3 by xhw...@chromium.org, Sep 25 2017

Cc: hubbe@chromium.org
julien.isorce: Thank you for looking into this and propose the solution!

The fundamental question I have here is that: should VideoDecoderConfig contain only configs that the "decoder" needs, or should we put all video configs in this struct, e.g. those only needed to render the video correctly?

If the former, then we probably should not put video_ratation() in VideoDecoderConfig. Otherwise, we'll pass it all the way down to the decoder, and it'll simply be ignored. 

The other option is to put all video related configs in VideoDecoderConfig, and use it everywhere, including in the decoders, as well as in the rendering path. This way it's more convenient for developers, but we are encapsulating less. Also, if we do so, VideoDecoderConfig should probably be renamed to VideoConfig.
Cc: wolenetz@chromium.org
Thx for the feedbacks. 

@chcunningham: sure, could you point me to a particular unit test ?

@xhwang: I have the feeling that VideoDecoderConfig purpose has evolved from its initial purpose and should probably be renamed to VideoConfig. Btw, is VideoDecoderConfig supposed to change in the middle of the stream ? Or is it constant for one instance of DemuxerStream ?

I submitted https://chromium-review.googlesource.com/c/chromium/src/+/684740 . I think it makes it easier to comment on pros and cons. Please have a look, thx.

#5: VideoDecoderConfig can change at MSE segment boundaries, and results in VideoDecoder::Initialize() being called again. Typically this corresponds to a resolution change.
#6: oh good then the change will still allow "dynamic rotation change" if needed in the future. Speaking about MSE, note that currenty ChunkDemuxerStream::video_rotation() always return VIDEO_ROTATION_0.
> @chcunningham: sure, could you point me to a particular unit test ?

No unit tests demonstrate this AFAIK. For your CL (at least for the initial CL), I wouldn't worry with it. 

In a separate CL, perhaps we can do the rename xhwang@ mentioned. At that time, we could introduce a new DecodeConfigMatches() function that would be used in decoder stream [0] to decide whether a full reset/flush is really necessary (it wouldn't be for just a rotation change). 

But my proposal needs some buy in from xhwang/sandersd

[0] https://cs.chromium.org/chromium/src/media/filters/decoder_stream.cc?rcl=02b7e5fa7bc98300eebfb88192e66d1f1d2d0ba7&l=633
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 12 2017

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

commit 6c83d8de501b554f57128b285c5f91275b85ab08
Author: Julien Isorce <julien.isorce@chromium.org>
Date: Thu Oct 12 13:11:29 2017

Move VideoRotation from DemuxerStream to VideoDecoderConfig

Currently VideoRotation is floating everywhere compared to
other video properties. This CL removes this exception.

For history see https://codereview.chromium.org/363813002/

Bug:  768317 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: If84db2811b5caa55c8cdd23dfaea9df6df5b3874
Reviewed-on: https://chromium-review.googlesource.com/684740
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508328}
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/chromecast/media/cma/base/demuxer_stream_for_test.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/chromecast/media/cma/base/demuxer_stream_for_test.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/chromecast/media/cma/test/mock_frame_provider.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/content/renderer/pepper/video_decoder_shim.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/BUILD.gn
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/demuxer_stream.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/fake_demuxer_stream.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/fake_demuxer_stream.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/fake_text_track_stream.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/fake_text_track_stream.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/ipc/media_param_traits_macros.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/mock_filters.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/mock_filters.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/pipeline_impl.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/pipeline_metadata.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/pipeline_metadata.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/test_helpers.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/test_helpers.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/video_decoder_config.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/video_decoder_config.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/video_decoder_config_unittest.cc
[add] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/video_rotation.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/base/video_rotation.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/blink/video_decode_stats_reporter_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/cast/sender/h264_vt_encoder_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/ffmpeg/ffmpeg_common.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/chunk_demuxer.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/chunk_demuxer.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/decrypting_demuxer_stream.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/decrypting_demuxer_stream.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/ffmpeg_demuxer.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/ffmpeg_demuxer.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/ffmpeg_demuxer_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/ffmpeg_video_decoder_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/source_buffer_state_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/filters/vpx_video_decoder_fuzzertest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/formats/mp2t/es_adapter_video_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/formats/mp2t/es_parser_h264.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/formats/mp4/mp4_stream_parser.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/formats/webm/webm_video_client.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/gpu/video_encode_accelerator_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/interfaces/media_types.mojom
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/interfaces/media_types.typemap
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/interfaces/video_decoder_config_struct_traits.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/interfaces/video_decoder_config_struct_traits.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/interfaces/video_decoder_config_struct_traits_unittest.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/services/mojo_demuxer_stream_adapter.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/mojo/services/mojo_demuxer_stream_adapter.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/remoting/fake_media_resource.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/remoting/fake_media_resource.h
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/remoting/proto_utils.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/remoting/stream_provider.cc
[modify] https://crrev.com/6c83d8de501b554f57128b285c5f91275b85ab08/media/test/pipeline_integration_test.cc

Status: Fixed (was: Assigned)

Sign in to add a comment