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

Issue 2764573002: Deliver video frames on Android, on the decode thread. (Closed)

Created:
3 years, 9 months ago by tommi
Modified:
3 years, 8 months ago
CC:
webrtc-reviews_webrtc.org, interface-changes_webrtc.org, video-team_agora.io, yujie_mao (webrtc), zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, qiang.lu, niklas.enbom, peah-webrtc, mflodman
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Deliver video frames on Android, on the decode thread. VideoCoding * Adding a method for polling for frames on Android only until the capture implementation takes care of this (longer term plan). CodecDatabase * Add an accessor for the current decoder * Use std::unique_ptr<> for ownership. * Remove "Release()" and "ReleaseDecoder()". Instead just delete. * Remove |friend| relationship between CodecDatabase and VCMGenericDecoder. VCMDecodedFrameCallback * DCHECKs for thread correctness. * Remove |lock_| now that a threading model has been established and verified. VCMGenericDecoder * All methods now have thread checks. * Variable access associated with thread checkers. VideoReceiver * Added two notification methods, DecoderThreadStarting() and DecoderThreadStopped() * Allows us to establish a period when the decoder thread is not running and it is safe to modify variables such as callbacks, that are only read when the decoder thread is running. * Allows us to DCHECK thread guarantees. * Allows synchronizing callbacks from the module process thread and have them only active while the decoder thread is running. * The above, allows us to establish two modes for the thread, single-threaded-mutable and multi-threaded-const. * Using that knowledge, we can remove |receive_crit_| as well as locking for a number of member variables. MediaCodecVideoDecoder * Removed frame polling code from this class, since this is now done from the root thread function in VideoReceiveStream. VideoReceiveStream * On Android: Polls for decoded frames every 10ms (same interval as previously in MediaCodecVideoDecoder) * [Un]Registers the |video_receiver_| with the module thread only around the time the decoder thread is started/stopped. * Notifies the receiver of start/stop events of the decoder thread. * Changed the decoder thread to use the new PlatformThread callback type. BUG=webrtc:7361, 695438 Review-Url: https://codereview.webrtc.org/2764573002 Cr-Commit-Position: refs/heads/master@{#17527} Committed: https://chromium.googlesource.com/external/webrtc/+/e3aa88bbd5accadec73fa7e38584dfbf6aabe8a9

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address comments #

Patch Set 3 : Rebase #

Patch Set 4 : incorporate fix from Sami #

Total comments: 10

Patch Set 5 : Simplify error check #

Patch Set 6 : Rebase #

Patch Set 7 : Update comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+513 lines, -323 lines) Patch
M webrtc/media/engine/videodecodersoftwarefallbackwrapper.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M webrtc/media/engine/videodecodersoftwarefallbackwrapper.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codec_database.h View 4 chunks +7 lines, -9 lines 0 comments Download
M webrtc/modules/video_coding/codec_database.cc View 8 chunks +40 lines, -49 lines 0 comments Download
M webrtc/modules/video_coding/generic_decoder.h View 5 chunks +24 lines, -21 lines 0 comments Download
M webrtc/modules/video_coding/generic_decoder.cc View 1 2 3 4 5 chunks +66 lines, -49 lines 0 comments Download
M webrtc/modules/video_coding/video_coding_impl.h View 4 chunks +49 lines, -19 lines 0 comments Download
M webrtc/modules/video_coding/video_receiver.cc View 1 2 3 4 5 6 21 chunks +146 lines, -71 lines 0 comments Download
M webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc View 1 2 3 4 5 26 chunks +113 lines, -81 lines 0 comments Download
M webrtc/video/video_receive_stream.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/video/video_receive_stream.cc View 1 2 3 4 5 7 chunks +47 lines, -23 lines 0 comments Download
M webrtc/video_decoder.h View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (18 generated)
tommi
sakal: - webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc (feel free to take a look at the rest though) mflodman, stefan ...
3 years, 9 months ago (2017-03-20 18:40:26 UTC) #2
sakal
I tried a call between Pixel and iPhone. I got constant output of: 03-21 10:51:57.136 ...
3 years, 9 months ago (2017-03-21 10:05:58 UTC) #8
tommi
https://codereview.webrtc.org/2764573002/diff/1/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc File webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc (left): https://codereview.webrtc.org/2764573002/diff/1/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc#oldcode523 webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc:523: if (callback_ == NULL) { On 2017/03/21 10:05:57, sakal ...
3 years, 9 months ago (2017-03-21 16:21:43 UTC) #9
tommi
Address comments
3 years, 9 months ago (2017-03-21 16:21:54 UTC) #10
tommi
Wrt the "Decoder is too far behind" message. Can you suggest what the right thing ...
3 years, 9 months ago (2017-03-22 09:02:37 UTC) #15
sakal
On 2017/03/22 09:02:37, tommi (webrtc) wrote: > Wrt the "Decoder is too far behind" message. ...
3 years, 9 months ago (2017-03-22 13:23:01 UTC) #16
tommi
On 2017/03/22 13:23:01, sakal wrote: > On 2017/03/22 09:02:37, tommi (webrtc) wrote: > > Wrt ...
3 years, 9 months ago (2017-03-22 17:25:52 UTC) #17
sakal
On 2017/03/22 17:25:52, tommi (webrtc) wrote: > On 2017/03/22 13:23:01, sakal wrote: > > On ...
3 years, 9 months ago (2017-03-23 08:26:36 UTC) #18
tommi
Rebase
3 years, 8 months ago (2017-03-28 08:50:37 UTC) #19
sakal
Please integrate this CL https://codereview.webrtc.org/2767473005 and then we can land this. I think the regression ...
3 years, 8 months ago (2017-03-28 15:03:03 UTC) #20
tommi
incorporate fix from Sami
3 years, 8 months ago (2017-03-29 19:34:30 UTC) #21
tommi
Thanks Sami - done. Stefan, Magnus - can you take a look?
3 years, 8 months ago (2017-03-29 19:35:40 UTC) #24
mflodman
Only once comment, then LGTM. Stefan, Can you also take look on this from the ...
3 years, 8 months ago (2017-03-31 09:30:01 UTC) #27
tommi
Simplify error check
3 years, 8 months ago (2017-03-31 10:27:12 UTC) #28
tommi
https://codereview.webrtc.org/2764573002/diff/60001/webrtc/modules/video_coding/generic_decoder.cc File webrtc/modules/video_coding/generic_decoder.cc (right): https://codereview.webrtc.org/2764573002/diff/60001/webrtc/modules/video_coding/generic_decoder.cc#newcode176 webrtc/modules/video_coding/generic_decoder.cc:176: if (ret < WEBRTC_VIDEO_CODEC_OK) { On 2017/03/31 09:30:01, mflodman ...
3 years, 8 months ago (2017-03-31 10:27:19 UTC) #29
stefan-webrtc
lgtm I wonder if we could do something to add a test case for the ...
3 years, 8 months ago (2017-03-31 13:42:07 UTC) #30
brandtr
On 2017/03/31 13:42:07, stefan-webrtc wrote: > lgtm > > I wonder if we could do ...
3 years, 8 months ago (2017-03-31 14:49:35 UTC) #31
tommi
Rebase
3 years, 8 months ago (2017-04-04 09:42:08 UTC) #32
tommi
Update comments
3 years, 8 months ago (2017-04-04 10:13:39 UTC) #33
tommi
https://codereview.webrtc.org/2764573002/diff/60001/webrtc/modules/video_coding/codec_database.cc File webrtc/modules/video_coding/codec_database.cc (left): https://codereview.webrtc.org/2764573002/diff/60001/webrtc/modules/video_coding/codec_database.cc#oldcode541 webrtc/modules/video_coding/codec_database.cc:541: ReleaseDecoder(ptr_decoder); On 2017/03/31 13:42:07, stefan-webrtc wrote: > Why don't ...
3 years, 8 months ago (2017-04-04 10:13:52 UTC) #34
tommi
On 2017/03/31 13:42:07, stefan-webrtc wrote: > I wonder if we could do something to add ...
3 years, 8 months ago (2017-04-04 10:15:46 UTC) #35
tommi
> I applied this patch to a test app, and it seems to lead to ...
3 years, 8 months ago (2017-04-04 10:18:38 UTC) #36
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/2764573002/120001
3 years, 8 months ago (2017-04-04 10:19:49 UTC) #39
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/external/webrtc/+/e3aa88bbd5accadec73fa7e38584dfbf6aabe8a9
3 years, 8 months ago (2017-04-04 10:53:07 UTC) #42
guidou
3 years, 8 months ago (2017-04-04 14:16:01 UTC) #43

Powered by Google App Engine
This is Rietveld 408576698