Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Issue 955253002: Add metadata to media::VideoFrame and plumb it through IPC/MediaStream. (Closed)

Created:
5 years, 10 months ago by miu
Modified:
5 years, 9 months ago
CC:
avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, hclam+watch_chromium.org, hguihot+watch_chromium.org, hubbe+watch_chromium.org, imcheng+watch_chromium.org, jam, jasonroberts+watch_google.com, mcasas+watch_chromium.org, mikhal+watch_chromium.org, miu+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, pwestin+watch_google.com, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add metadata to media::VideoFrame and plumb it through IPC/MediaStream. This change has three main goals: First, to be able to pass extra information associated with each VideoFrame from the capture source to the downstream consumers (see bugs for details). Second, to eliminate redundancies in the current MediaStreamVideoSink API; specifically, media::VideoFrame contains most of the same properties as media::VideoCaptureFormat. Third, to fully support the separate VideoFrame concepts of "coded size" versus "visible size" in the capture pipeline, rather than force all producers/consumers to deal with packed data. (Using packed frame sizes can be suboptimal for performance in some use cases.) The metadata is stored in a base::DictionaryValue owned by media::VideoFrame to allow for structured data passing. DictionaryValue is a great choice since an efficient IPC (de)serialization implementation already exists, and the metadata can be easily pretty-printed for logging where needed. Also, it's logical for VideoFrame to own the metadata, as both need to be passed/shared together across threads without copying. Finally, this change includes one new use of the metadata as a motivation for its existence: The tab/desktop capture code now includes capture timing information, which will allow Cast streaming sessions to be analyzed for user experience improvements. In the future, some of the special-use-case data members in VideoFrame should be moved into the metadata. BUG=461116, 462101 Committed: https://crrev.com/78807dc7968c9a397326aef113435cbca486f96c Cr-Commit-Position: refs/heads/master@{#318954}

Patch Set 1 : #

Patch Set 2 : Fix Windows compile errors. #

Total comments: 2

Patch Set 3 : Style fix: Declare captureXXXTimeTicks string constants separately. #

Patch Set 4 : Move metadata key definitions into video_frame_metadata_keys.h #

Patch Set 5 : Metadata keys centralized, enums only. #

Total comments: 4

Patch Set 6 : Addressed Dale's comments. #

Patch Set 7 : rebase #

Patch Set 8 : Fix compile error caused by last rebase. #

Total comments: 4

Patch Set 9 : tommi's nits addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+749 lines, -441 lines) Patch
M chrome/renderer/media/cast_receiver_session_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/media/cast_rtp_stream.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/media/capture/content_video_capture_device_core.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/media/capture/content_video_capture_device_core.cc View 1 2 3 4 5 6 7 5 chunks +15 lines, -8 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_aura_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 2 3 4 5 1 chunk +7 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 9 chunks +36 lines, -18 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.h View 1 2 chunks +13 lines, -7 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 11 chunks +14 lines, -35 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.h View 2 chunks +16 lines, -11 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 5 chunks +37 lines, -16 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host_unittest.cc View 6 chunks +39 lines, -40 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 chunk +14 lines, -10 lines 0 comments Download
M content/common/media/video_capture_messages.h View 2 chunks +22 lines, -12 lines 0 comments Download
M content/renderer/media/media_stream_video_capture_source_unittest.cc View 1 2 3 4 5 2 chunks +19 lines, -8 lines 0 comments Download
M content/renderer/media/media_stream_video_track.cc View 2 chunks +2 lines, -7 lines 0 comments Download
M content/renderer/media/media_stream_video_track_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/mock_media_stream_video_sink.h View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M content/renderer/media/mock_media_stream_video_sink.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/mock_media_stream_video_source.h View 1 chunk +0 lines, -5 lines 0 comments Download
M content/renderer/media/mock_media_stream_video_source.cc View 1 chunk +1 line, -11 lines 0 comments Download
M content/renderer/media/rtc_video_renderer.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/rtc_video_renderer.cc View 2 chunks +1 line, -2 lines 0 comments Download
M content/renderer/media/video_capture_impl.h View 2 chunks +6 lines, -7 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 3 4 5 5 chunks +15 lines, -20 lines 0 comments Download
M content/renderer/media/video_capture_impl_manager_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/media/video_capture_impl_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/media/video_capture_message_filter.h View 3 chunks +16 lines, -16 lines 0 comments Download
M content/renderer/media/video_capture_message_filter.cc View 2 chunks +18 lines, -16 lines 0 comments Download
M content/renderer/media/video_capture_message_filter_unittest.cc View 4 chunks +55 lines, -41 lines 0 comments Download
M content/renderer/media/video_source_handler.cc View 2 chunks +3 lines, -6 lines 0 comments Download
M content/renderer/media/video_track_adapter.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/video_track_adapter.cc View 1 2 3 4 5 6 7 8 6 chunks +12 lines, -16 lines 0 comments Download
M content/renderer/media/webrtc/media_stream_remote_video_source.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -16 lines 0 comments Download
M content/renderer/media/webrtc/video_destination_handler.cc View 4 chunks +7 lines, -16 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_video_track_adapter.cc View 2 chunks +4 lines, -9 lines 0 comments Download
M content/renderer/pepper/pepper_media_stream_video_track_host.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_media_stream_video_track_host.cc View 8 chunks +24 lines, -34 lines 0 comments Download
M content/renderer/pepper/pepper_platform_video_capture.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_platform_video_capture.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/pepper/pepper_video_capture_host.h View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/pepper/pepper_video_capture_host.cc View 1 2 3 4 5 3 chunks +14 lines, -8 lines 0 comments Download
M media/base/BUILD.gn View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M media/base/video_capturer_source.h View 1 chunk +0 lines, -1 line 0 comments Download
M media/base/video_frame.h View 1 2 3 4 5 3 chunks +12 lines, -0 lines 0 comments Download
A media/base/video_frame_metadata.h View 1 2 3 4 1 chunk +70 lines, -0 lines 0 comments Download
A media/base/video_frame_metadata.cc View 1 2 3 4 5 1 chunk +125 lines, -0 lines 0 comments Download
M media/base/video_frame_unittest.cc View 1 2 3 4 1 chunk +79 lines, -0 lines 0 comments Download
M media/cast/sender/video_sender.cc View 1 2 3 4 5 2 chunks +25 lines, -9 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M media/video/capture/video_capture_device_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 40 (10 generated)
miu
hclam: Please read the change description, then start by looking at media/base/video_frame.h, media/base/video_capturer_source.h, and media/cast/sender/video_sender.cc. ...
5 years, 10 months ago (2015-02-26 05:09:51 UTC) #3
Alpha Left Google
I like the idea about adding a dictionary to VideoFrame and use it to pass ...
5 years, 10 months ago (2015-02-26 21:17:23 UTC) #4
miu
> I like the idea about adding a dictionary to VideoFrame and use it to ...
5 years, 10 months ago (2015-02-26 23:25:18 UTC) #5
miu
perkj: PTAL.
5 years, 10 months ago (2015-02-26 23:26:46 UTC) #7
Alpha Left Google
On 2015/02/26 23:25:18, miu wrote: > > I like the idea about adding a dictionary ...
5 years, 10 months ago (2015-02-26 23:28:45 UTC) #8
miu
On 2015/02/26 23:28:45, Alpha wrote: > What about a separate header file that defines these ...
5 years, 10 months ago (2015-02-27 01:23:32 UTC) #9
miu
Remove perkj as reviewer due to leave.
5 years, 10 months ago (2015-02-27 01:24:07 UTC) #11
miu
Adding reviewers for OWNERS approval: bbudge: content/renderer/pepper/* dalecurtis: media/base/* tommi: content/browser/renderer_host/media/* content/common/media/video_capture_messages.h content/renderer/media/*
5 years, 10 months ago (2015-02-27 01:58:37 UTC) #13
DaleCurtis
Hmm, I have mixed thoughts on this. On one hand we get a request for ...
5 years, 9 months ago (2015-02-27 17:38:10 UTC) #14
miu
On 2015/02/27 17:38:10, DaleCurtis wrote: > Hmm, I have mixed thoughts on this. On one ...
5 years, 9 months ago (2015-02-27 19:54:28 UTC) #15
Alpha Left Google
On 2015/02/27 19:54:28, miu wrote: > On 2015/02/27 17:38:10, DaleCurtis wrote: > > Hmm, I ...
5 years, 9 months ago (2015-02-27 19:58:21 UTC) #16
DaleCurtis
I think my concerns would be obviated if the only keys allowed were those in ...
5 years, 9 months ago (2015-02-27 20:18:18 UTC) #17
miu
On 2015/02/27 20:18:18, DaleCurtis wrote: > I think my concerns would be obviated if the ...
5 years, 9 months ago (2015-02-27 21:10:01 UTC) #18
miu
On 2015/02/27 21:10:01, miu wrote: > On 2015/02/27 20:18:18, DaleCurtis wrote: > > I think ...
5 years, 9 months ago (2015-02-27 23:37:41 UTC) #19
mcasas
+1 on streamlining all that zoo of metadata associated to VideoFrame. Feels a bit silly ...
5 years, 9 months ago (2015-02-28 00:56:26 UTC) #21
DaleCurtis
Otherwise this lgtm. https://codereview.chromium.org/955253002/diff/100001/media/base/video_frame.h File media/base/video_frame.h (right): https://codereview.chromium.org/955253002/diff/100001/media/base/video_frame.h#newcode299 media/base/video_frame.h:299: VideoFrameMetadata& metadata() { return metadata_; } ...
5 years, 9 months ago (2015-03-02 23:23:28 UTC) #22
Alpha Left Google
On 2015/03/02 23:23:28, DaleCurtis wrote: > Otherwise this lgtm. > > https://codereview.chromium.org/955253002/diff/100001/media/base/video_frame.h > File media/base/video_frame.h ...
5 years, 9 months ago (2015-03-02 23:26:03 UTC) #23
miu
https://codereview.chromium.org/955253002/diff/100001/media/base/video_frame.h File media/base/video_frame.h (right): https://codereview.chromium.org/955253002/diff/100001/media/base/video_frame.h#newcode299 media/base/video_frame.h:299: VideoFrameMetadata& metadata() { return metadata_; } On 2015/03/02 23:23:28, ...
5 years, 9 months ago (2015-03-03 04:31:05 UTC) #24
miu
nasko: PTAL at content/common/media/video_capture_messages.h for security OWNERS approval.
5 years, 9 months ago (2015-03-03 04:31:22 UTC) #26
bbudge
pepper lgtm
5 years, 9 months ago (2015-03-03 04:43:18 UTC) #27
tommi (sloooow) - chröme
lgtm for */media/* https://codereview.chromium.org/955253002/diff/160001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc (right): https://codereview.chromium.org/955253002/diff/160001/content/renderer/media/video_track_adapter.cc#newcode180 content/renderer/media/video_track_adapter.cc:180: &frame_rate)) nit: {} https://codereview.chromium.org/955253002/diff/160001/content/renderer/media/webrtc/media_stream_remote_video_source.cc File content/renderer/media/webrtc/media_stream_remote_video_source.cc ...
5 years, 9 months ago (2015-03-03 10:06:16 UTC) #28
nasko
I will not be able to get to this review within the next 24 hours. ...
5 years, 9 months ago (2015-03-03 18:30:02 UTC) #29
miu
tsepez: Would you PTAL at content/common/media/video_messages.h for security OWNERS approval?
5 years, 9 months ago (2015-03-03 19:52:31 UTC) #31
Tom Sepez
It's sometimes hard to review the security impact of items passed inside a dictionary; although ...
5 years, 9 months ago (2015-03-03 20:06:20 UTC) #32
miu
On 2015/03/03 20:06:20, Tom Sepez wrote: > It's sometimes hard to review the security impact ...
5 years, 9 months ago (2015-03-03 20:31:01 UTC) #33
Tom Sepez
On 2015/03/03 20:31:01, miu wrote: > On 2015/03/03 20:06:20, Tom Sepez wrote: > > It's ...
5 years, 9 months ago (2015-03-03 20:40:14 UTC) #34
miu
https://codereview.chromium.org/955253002/diff/160001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc (right): https://codereview.chromium.org/955253002/diff/160001/content/renderer/media/video_track_adapter.cc#newcode180 content/renderer/media/video_track_adapter.cc:180: &frame_rate)) On 2015/03/03 10:06:15, tommi wrote: > nit: {} ...
5 years, 9 months ago (2015-03-03 21:31:52 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/955253002/180001
5 years, 9 months ago (2015-03-03 21:32:51 UTC) #38
commit-bot: I haz the power
Committed patchset #9 (id:180001)
5 years, 9 months ago (2015-03-03 23:08:16 UTC) #39
commit-bot: I haz the power
5 years, 9 months ago (2015-03-03 23:09:22 UTC) #40
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/78807dc7968c9a397326aef113435cbca486f96c
Cr-Commit-Position: refs/heads/master@{#318954}

Powered by Google App Engine
This is Rietveld 408576698