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

Issue 2987413002: ObjC: Implement HW codecs in ObjC instead of C++ (Closed)

Created:
3 years, 4 months ago by magjed_webrtc
Modified:
3 years, 4 months ago
Reviewers:
andersc, brandtr
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhengzhonghou_agora.io, video-team_agora.io, stefan-webrtc, mflodman, tkchin_webrtc, jtt_webrtc
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

ObjC: Implement HW codecs in ObjC instead of C++ The current ObjC HW encoder is implemented as a C++ webrtc::VideoEncoder. We then wrap it two times in the following way: webrtc::VideoEncoder -> RTCVideoEncoder -> webrtc::VideoEncoder. This was originally done to minimize the code diff when landing the injectable encoder. This CL removes the first wrapping and implements the ObjC HW encoder as a RTCVideoEncoder directly. Similarly, the decoder is implemented as a RTCVideoDecoder directly. Based on andersc@ CL: https://codereview.webrtc.org/2978623002/. BUG=webrtc:7924 Review-Url: https://codereview.webrtc.org/2987413002 Cr-Commit-Position: refs/heads/master@{#19255} Committed: https://chromium.googlesource.com/external/webrtc/+/73c0eb50143a04eaf835aba0cc8ddc654661aedf

Patch Set 1 #

Patch Set 2 : Rebase against https://codereview.webrtc.org/2992233002 #

Total comments: 2

Patch Set 3 : Move RTCH264PacketizationMode to RTCVideoCodec.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+684 lines, -2134 lines) Patch
M webrtc/modules/video_coding/BUILD.gn View 1 2 4 chunks +34 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/DEPS View 1 chunk +1 line, -1 line 0 comments Download
A + webrtc/modules/video_coding/codecs/test/objc_codec_h264_test.h View 1 chunk +10 lines, -31 lines 0 comments Download
A + webrtc/modules/video_coding/codecs/test/objc_codec_h264_test.mm View 1 chunk +14 lines, -32 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h View 1 2 2 chunks +8 lines, -5 lines 0 comments Download
M webrtc/sdk/BUILD.gn View 1 chunk +4 lines, -4 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm View 3 chunks +7 lines, -0 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h View 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm View 4 chunks +4 lines, -215 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoEncoderSettings.mm View 2 chunks +2 lines, -21 lines 0 comments Download
A + webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm View 6 chunks +114 lines, -139 lines 0 comments Download
A + webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm View 1 2 10 chunks +325 lines, -412 lines 0 comments Download
D webrtc/sdk/objc/Framework/Classes/VideoToolbox/decoder.h View 1 chunk +0 lines, -59 lines 0 comments Download
D webrtc/sdk/objc/Framework/Classes/VideoToolbox/decoder.mm View 1 chunk +0 lines, -277 lines 0 comments Download
D webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.h View 1 chunk +0 lines, -97 lines 0 comments Download
D webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm View 1 1 chunk +0 lines, -767 lines 0 comments Download
A + webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h View 2 chunks +28 lines, -40 lines 0 comments Download
A webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc View 1 chunk +90 lines, -0 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm View 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_encoder_factory.mm View 1 4 chunks +7 lines, -10 lines 0 comments Download
M webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h View 1 2 6 chunks +32 lines, -7 lines 0 comments Download
M webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecH264.h View 1 2 1 chunk +3 lines, -13 lines 0 comments Download
M webrtc/sdk/objc/Framework/UnitTests/objc_video_encoder_factory_tests.mm View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 46 (34 generated)
magjed_webrtc
Anders - take a look if you have time, otherwise I'll Daniela review.
3 years, 4 months ago (2017-08-03 14:58:28 UTC) #13
andersc
On 2017/08/03 14:58:28, magjed_webrtc wrote: > Anders - take a look if you have time, ...
3 years, 4 months ago (2017-08-03 20:29:22 UTC) #20
magjed_webrtc
On 2017/08/03 20:29:22, andersc wrote: > On 2017/08/03 14:58:28, magjed_webrtc wrote: > > Anders - ...
3 years, 4 months ago (2017-08-04 12:38:03 UTC) #21
magjed_webrtc
brandtr - please review the changes to webrtc/modules/video_coding.
3 years, 4 months ago (2017-08-04 15:17:19 UTC) #25
andersc
On 2017/08/04 12:38:03, magjed_webrtc wrote: > On 2017/08/03 20:29:22, andersc wrote: > > On 2017/08/03 ...
3 years, 4 months ago (2017-08-04 18:29:27 UTC) #26
brandtr
video_coding/ lgtm https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h File webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h (right): https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h#newcode184 webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h:184: cricket::VideoCodec codecInfo = encoder_factory->supported_codecs().at(0); Is there a ...
3 years, 4 months ago (2017-08-07 08:01:57 UTC) #31
magjed_webrtc
https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h File webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h (right): https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h#newcode184 webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h:184: cricket::VideoCodec codecInfo = encoder_factory->supported_codecs().at(0); On 2017/08/07 08:01:57, brandtr wrote: ...
3 years, 4 months ago (2017-08-07 12:59:34 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2987413002/160001
3 years, 4 months ago (2017-08-07 13:51:21 UTC) #40
commit-bot: I haz the power
Committed patchset #3 (id:160001) as https://chromium.googlesource.com/external/webrtc/+/73c0eb50143a04eaf835aba0cc8ddc654661aedf
3 years, 4 months ago (2017-08-07 13:55:37 UTC) #43
brandtr
On 2017/08/07 12:59:34, magjed_webrtc wrote: > https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h > File webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h > (right): > > https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h#newcode184 ...
3 years, 4 months ago (2017-08-07 14:45:55 UTC) #44
magjed_webrtc
On 2017/08/07 14:45:55, brandtr wrote: > On 2017/08/07 12:59:34, magjed_webrtc wrote: > > > https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h ...
3 years, 4 months ago (2017-08-08 14:10:08 UTC) #45
brandtr
3 years, 4 months ago (2017-08-08 15:10:35 UTC) #46
Message was sent while issue was closed.
On 2017/08/08 14:10:08, magjed_webrtc wrote:
> On 2017/08/07 14:45:55, brandtr wrote:
> > On 2017/08/07 12:59:34, magjed_webrtc wrote:
> > >
> >
>
https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_cod...
> > > File
> webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h
> > > (right):
> > > 
> > >
> >
>
https://codereview.webrtc.org/2987413002/diff/140001/webrtc/modules/video_cod...
> > >
> webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h:184:
> > > cricket::VideoCodec codecInfo = encoder_factory->supported_codecs().at(0);
> > > On 2017/08/07 08:01:57, brandtr wrote:
> > > > Is there a benefit from using .at here, vs. the regular []?
> > > 
> > > Not much, at() will check if the index is within bound and throw an
> exception,
> > > compared to [] that will not check the bounds and segfault instead.
> > 
> > Right, but since we are not using exceptions, will the crash from the
> exception
> > be nicer than the segfault?
> 
> The exception failure will look like this on iOS:
> libc++abi.dylib: terminating with uncaught exception of type
std::out_of_range:
> vector
> I'm not sure it will always segfault with [], I think it depends on if the
> vector has allocated memory or not.
> It's not a big issue regardless, we can change to [] for consistency.

That does seem like an improvement from the segfault/weird behaviour of indexing
out-of-bounds using []. No need to change anything here.

Powered by Google App Engine
This is Rietveld 408576698