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

Issue 450693006: VideoToolbox encoder for cast senders. (Closed)

Created:
6 years, 4 months ago by jfroy
Modified:
6 years, 1 month ago
CC:
imcheng+watch_chromium.org, hguihot+watch_chromium.org, jasonroberts+watch_google.com, avayvod+watch_chromium.org, pwestin+watch_google.com, miu+watch_chromium.org, hubbe+watch_chromium.org, mikhal+watch_chromium.org, hubbe, DaleCurtis, sandersd (OOO until July 31), chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[cast] VideoToolbox encoder VideoToolbox is the hardware encoding library on iOS and OS X. This patch adds a new VideoEncoder to the cast implementation that will be used when the video codec is H.264. Cast supports "external encoders" via the VideoEncodeAccelerator interface. At first glance it would appear to be a better fit than subclassing VideoEncoder. However, VideoEncodeAccelerator is not a good fit for VideoToolbox, particularly with how IO buffers are managed. Furthermore, such an implementation would require a large portion of the content module, which is largely unnecessary on iOS. BUG=401627 Committed: https://crrev.com/3eb789bc38793698755e8e75d5850989696ff97d Cr-Commit-Position: refs/heads/master@{#305141}

Patch Set 1 #

Total comments: 64

Patch Set 2 : Fix lint and formatting issues. #

Total comments: 10

Patch Set 3 : Remove pragma marks, debug logging. #

Total comments: 19

Patch Set 4 : Remove C++11 features, use proper DCHECK macros, remove __func__ from logs, other review issues. #

Patch Set 5 : Address review feedback from miu. #

Patch Set 6 : Remove scoped CF pointer typedefs, cleanup SetSessionProperty, fix compile errors. #

Total comments: 11

Patch Set 7 : Edit comments per review feedback and for clarity. #

Total comments: 16

Patch Set 8 : Address review feedback. #

Patch Set 9 : Non-keyframes now use the previous frame as their referenced frame ID. #

Patch Set 10 : Add comment explaining the opt-in CVPixelBuffer in a VideoFrame optimization. #

Patch Set 11 : Build file and video_sender changes for the VideoToolbox encoder. #

Patch Set 12 : Rebase #

Patch Set 13 : Fix syntax error in cast.gyp. #

Patch Set 14 : Update to use VideoToolbox glue code, support initialization result callback, build files, integrat… #

Patch Set 15 : Rebase build files on top of media_for_cast_ios component defined in 581803003. #

Total comments: 20

Patch Set 16 : Rebase #

Patch Set 17 : Address review issues. Tests are forthcoming. #

Patch Set 18 : Modernize to C++11 per the rules at http://chromium-cpp.appspot.com/ #

Total comments: 1

Patch Set 19 : Rebase #

Patch Set 20 : Rebase #

Patch Set 21 : Rename capture_time to reference_time to track media/cast. #

Patch Set 22 : Fix the encoder to work with the new cast reference time code. #

Patch Set 23 : Basic unit tests for the encoder, a few more comments and color attachments on buffers wrapping Vid… #

Patch Set 24 : Add the unit tests file to BUILD.gn. #

Patch Set 25 : Fix minor lint issues. #

Patch Set 26 : Let the tests fail gracefully if VT is not available. #

Patch Set 27 : Need to bail out of SetUp if VideoToolbox is not available. #

Patch Set 28 : Implemented video frame factory. Reworked unit tests to be independent. #

Patch Set 29 : Fix unit test link error. #

Total comments: 12

Patch Set 30 : Remove useless include and clean up in unit tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+960 lines, -5 lines) Patch
M media/cast/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 chunks +25 lines, -0 lines 0 comments Download
M media/cast/cast.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +7 lines, -0 lines 0 comments Download
M media/cast/cast_sender_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +0 lines, -2 lines 0 comments Download
M media/cast/cast_testing.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +25 lines, -2 lines 0 comments Download
A media/cast/sender/h264_vt_encoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +86 lines, -0 lines 0 comments Download
A media/cast/sender/h264_vt_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +488 lines, -0 lines 0 comments Download
A media/cast/sender/h264_vt_encoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +310 lines, -0 lines 0 comments Download
M media/cast/sender/video_encoder_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 28 1 chunk +1 line, -0 lines 0 comments Download
M media/cast/sender/video_sender.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +18 lines, -1 line 0 comments Download

Messages

Total messages: 53 (4 generated)
jfroy
6 years, 4 months ago (2014-08-07 18:56:57 UTC) #1
Robert Sesek
https://codereview.chromium.org/450693006/diff/20001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/20001/media/cast/sender/h264_vt_encoder.cc#newcode121 media/cast/sender/h264_vt_encoder.cc:121: #pragma mark - Chrome doesn't typically do this. https://codereview.chromium.org/450693006/diff/20001/media/cast/sender/h264_vt_encoder.cc#newcode125 ...
6 years, 4 months ago (2014-08-07 22:49:23 UTC) #2
jfroy
https://codereview.chromium.org/450693006/diff/20001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/20001/media/cast/sender/h264_vt_encoder.cc#newcode121 media/cast/sender/h264_vt_encoder.cc:121: #pragma mark - On 2014/08/07 22:49:23, rsesek wrote: > ...
6 years, 4 months ago (2014-08-07 23:06:12 UTC) #3
Robert Sesek
https://codereview.chromium.org/450693006/diff/40001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/40001/media/cast/sender/h264_vt_encoder.cc#newcode19 media/cast/sender/h264_vt_encoder.cc:19: bool SetSessionProperty(VTSessionRef session, Mark this static, or remove static ...
6 years, 4 months ago (2014-08-08 17:24:17 UTC) #4
miu
Where are the BUILD file changes? More importantly, where are the unit/functional tests? First round ...
6 years, 4 months ago (2014-08-08 17:53:09 UTC) #5
jfroy
https://codereview.chromium.org/450693006/diff/40001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/40001/media/cast/sender/h264_vt_encoder.cc#newcode19 media/cast/sender/h264_vt_encoder.cc:19: bool SetSessionProperty(VTSessionRef session, On 2014/08/08 17:24:16, rsesek wrote: > ...
6 years, 4 months ago (2014-08-08 22:25:19 UTC) #6
jfroy
https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc#newcode19 media/cast/sender/h264_vt_encoder.cc:19: static const char* GetCVErrorString(CVReturn error) { On 2014/08/08 17:53:06, ...
6 years, 4 months ago (2014-08-08 23:23:26 UTC) #7
jfroy
On 2014/08/08 17:53:09, miu wrote: > Where are the BUILD file changes? More importantly, where ...
6 years, 4 months ago (2014-08-08 23:26:50 UTC) #8
jfroy
https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.h File media/cast/sender/h264_vt_encoder.h (right): https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.h#newcode26 media/cast/sender/h264_vt_encoder.h:26: explicit H264VideoToolboxEncoder( On 2014/08/08 17:53:09, miu wrote: > Don't ...
6 years, 4 months ago (2014-08-11 20:49:13 UTC) #9
jfroy
https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.h File media/cast/sender/h264_vt_encoder.h (right): https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.h#newcode102 media/cast/sender/h264_vt_encoder.h:102: bool using_hardware_; On 2014/08/08 17:53:09, miu wrote: > It ...
6 years, 4 months ago (2014-08-11 20:50:06 UTC) #10
Robert Sesek
Mac-wise, this is in pretty good shape now. I'm not too familiar with the media-related ...
6 years, 4 months ago (2014-08-12 00:06:12 UTC) #11
jfroy
https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc#newcode23 media/cast/sender/h264_vt_encoder.cc:23: CFNumberCreate(NULL, kCFNumberSInt32Type, &value)); On 2014/08/12 00:06:12, rsesek wrote: > ...
6 years, 4 months ago (2014-08-12 01:04:16 UTC) #12
jfroy
On 2014/08/12 00:06:12, rsesek wrote: > Mac-wise, this is in pretty good shape now. I'm ...
6 years, 4 months ago (2014-08-12 01:08:36 UTC) #13
miu
On 2014/08/12 01:08:36, jfroy wrote: > Thanks a lot for your feedback. It is tremendously ...
6 years, 4 months ago (2014-08-12 03:45:48 UTC) #14
jfroy
No worries I have plenty of work to do! On Mon, Aug 11, 2014 at ...
6 years, 4 months ago (2014-08-12 15:47:27 UTC) #15
Robert Sesek
https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc#newcode23 media/cast/sender/h264_vt_encoder.cc:23: CFNumberCreate(NULL, kCFNumberSInt32Type, &value)); On 2014/08/12 01:04:15, jfroy wrote: > ...
6 years, 4 months ago (2014-08-12 18:47:09 UTC) #16
jfroy
On 2014/08/12 18:47:09, rsesek wrote: > https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc > File media/cast/sender/h264_vt_encoder.cc (right): > > https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc#newcode23 > ...
6 years, 4 months ago (2014-08-12 19:40:50 UTC) #17
Robert Sesek
On 2014/08/12 19:40:50, jfroy wrote: > On 2014/08/12 18:47:09, rsesek wrote: > > > https://codereview.chromium.org/450693006/diff/100001/media/cast/sender/h264_vt_encoder.cc ...
6 years, 4 months ago (2014-08-12 20:34:50 UTC) #18
jfroy
Waiting for review by miu.
6 years, 4 months ago (2014-08-15 22:11:37 UTC) #19
miu
On 2014/08/15 22:11:37, jfroy wrote: > Waiting for review by miu. Gettin' to it today. ...
6 years, 4 months ago (2014-08-18 22:06:16 UTC) #20
jfroy
No rush miu, I'm on vacation this week. On Mon, Aug 18, 2014 at 18:06 ...
6 years, 4 months ago (2014-08-18 23:01:38 UTC) #21
miu
https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc#newcode459 media/cast/sender/h264_vt_encoder.cc:459: timestamp_cm = CMTimeMake(capture_time.ToInternalValue(), USEC_PER_SEC); On 2014/08/08 23:23:26, jfroy wrote: ...
6 years, 4 months ago (2014-08-25 19:21:18 UTC) #22
jfroy
https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc#newcode8 media/cast/sender/h264_vt_encoder.cc:8: #include <vector> On 2014/08/25 19:21:17, miu wrote: > Looks ...
6 years, 4 months ago (2014-08-25 20:59:13 UTC) #23
jfroy
https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/1/media/cast/sender/h264_vt_encoder.cc#newcode459 media/cast/sender/h264_vt_encoder.cc:459: timestamp_cm = CMTimeMake(capture_time.ToInternalValue(), USEC_PER_SEC); On 2014/08/25 19:21:17, miu wrote: ...
6 years, 4 months ago (2014-08-25 21:00:23 UTC) #24
miu
https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc#newcode247 media/cast/sender/h264_vt_encoder.cc:247: base::ScopedCFTypeRef<CVPixelBufferRef> H264VideoToolboxEncoder::WrapVideoFrame( On 2014/08/25 20:59:13, jfroy wrote: > On ...
6 years, 4 months ago (2014-08-25 21:47:41 UTC) #25
jfroy
https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc#newcode247 media/cast/sender/h264_vt_encoder.cc:247: base::ScopedCFTypeRef<CVPixelBufferRef> H264VideoToolboxEncoder::WrapVideoFrame( On 2014/08/25 21:47:40, miu wrote: > On ...
6 years, 4 months ago (2014-08-25 21:57:56 UTC) #26
miu
Okay, this looks great now. Can you add the BUILD files changes and the code ...
6 years, 4 months ago (2014-08-25 22:22:09 UTC) #27
jfroy
Working on the build file changes now. https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/120001/media/cast/sender/h264_vt_encoder.cc#newcode181 media/cast/sender/h264_vt_encoder.cc:181: pixel_buffer = ...
6 years, 4 months ago (2014-08-25 22:30:40 UTC) #28
jfroy
Working on stubs for CoreVideo and VideoToolbox, since the code only supports very recent versions ...
6 years, 3 months ago (2014-08-29 16:36:33 UTC) #29
jfroy
Still working on media framework glue code.
6 years, 3 months ago (2014-09-03 23:22:58 UTC) #30
jfroy
I've uploaded a big patch set which reworks the encoder to use the VideoToolbox glue ...
6 years, 3 months ago (2014-09-17 22:24:58 UTC) #31
jfroy
New patch set that rebases the build files on top of the latest version of ...
6 years, 3 months ago (2014-09-19 18:08:38 UTC) #32
miu
On 2014/09/19 18:08:38, jfroy wrote: > New patch set that rebases the build files on ...
6 years, 3 months ago (2014-09-22 18:28:22 UTC) #33
miu
Looks great. Could you write a simple unit test or two for this? Also, there's ...
6 years, 3 months ago (2014-09-24 00:10:14 UTC) #34
jfroy
Thanks for the review. I'll submit a new patch set asap. https://codereview.chromium.org/450693006/diff/280001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): ...
6 years, 3 months ago (2014-09-24 01:00:59 UTC) #35
jfroy
https://codereview.chromium.org/450693006/diff/280001/media/cast/sender/video_sender.cc File media/cast/sender/video_sender.cc (right): https://codereview.chromium.org/450693006/diff/280001/media/cast/sender/video_sender.cc#newcode100 media/cast/sender/video_sender.cc:100: video_encoder_.reset(new VideoEncoderImpl( On 2014/09/24 00:10:14, miu wrote: > On ...
6 years, 3 months ago (2014-09-24 18:43:53 UTC) #36
miu
All set with the impl, but still need unit tests. https://codereview.chromium.org/450693006/diff/360001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/360001/media/cast/sender/h264_vt_encoder.cc#newcode294 ...
6 years, 2 months ago (2014-09-30 19:45:32 UTC) #38
jfroy
Yep will do on the bug. Been working on tests for all the recent code ...
6 years, 2 months ago (2014-09-30 19:58:38 UTC) #39
jfroy
Patch set 23 adds 2 basic unit tests for the encoder. The first is similar ...
6 years, 2 months ago (2014-10-23 23:10:18 UTC) #40
jfroy
Well as I suspected the trybot Mac slaves don't support VideoToolbox, so the end to ...
6 years, 1 month ago (2014-10-27 19:46:34 UTC) #41
jfroy
The latest patch set implements the video frame factory interface from https://codereview.chromium.org/688423003/ and reworks the ...
6 years, 1 month ago (2014-11-19 23:17:58 UTC) #44
jfroy
miu, this is pretty much done. The unit tests are built from an independent target ...
6 years, 1 month ago (2014-11-20 21:08:31 UTC) #45
miu
lgtm % minor things: https://codereview.chromium.org/450693006/diff/630001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/630001/media/cast/sender/h264_vt_encoder.cc#newcode7 media/cast/sender/h264_vt_encoder.cc:7: #include <algorithm> Don't think you ...
6 years, 1 month ago (2014-11-20 23:16:56 UTC) #46
jfroy
https://codereview.chromium.org/450693006/diff/630001/media/cast/sender/h264_vt_encoder.cc File media/cast/sender/h264_vt_encoder.cc (right): https://codereview.chromium.org/450693006/diff/630001/media/cast/sender/h264_vt_encoder.cc#newcode7 media/cast/sender/h264_vt_encoder.cc:7: #include <algorithm> On 2014/11/20 23:16:55, miu wrote: > Don't ...
6 years, 1 month ago (2014-11-20 23:38:30 UTC) #47
jfroy
I think I've addressed your feedback in the last patch set, minus importing queue. I'll ...
6 years, 1 month ago (2014-11-20 23:54:31 UTC) #48
miu
lgtm
6 years, 1 month ago (2014-11-21 00:10:07 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/450693006/650001
6 years, 1 month ago (2014-11-21 00:11:38 UTC) #51
commit-bot: I haz the power
Committed patchset #30 (id:650001)
6 years, 1 month ago (2014-11-21 01:45:11 UTC) #52
commit-bot: I haz the power
6 years, 1 month ago (2014-11-21 01:45:55 UTC) #53
Message was sent while issue was closed.
Patchset 30 (id:??) landed as
https://crrev.com/3eb789bc38793698755e8e75d5850989696ff97d
Cr-Commit-Position: refs/heads/master@{#305141}

Powered by Google App Engine
This is Rietveld 408576698