DescriptionRefactor video capturing code in the render process
This is a large refactoring to cleanup the code that handles video
capturing in the render process. The goal of this change is to:
* Simplify threading model for objects involved.
* Clarify ownership model.
* Remove extra complexity caused by media::VideoCapture.
Summary of this change:
* Interface media::VideoCapture is removed completely.
This interface doesn't add much value. It fails to define threading
model and ownership. Some of the methods are obsolete.
* Pepper code that performs video capturing now do not inherit from
media::VideoCapture.
The inheritance is not necessary
* VideoCaptureImpl is now a purely IO thread object.
VideoCaptureImpl can only be accessed on the IO thread. It now becomes
and inner object of VideoCaptureImplManager. Client is not allowed to
access this object directly. This helps remove code that accepts
call from the render thread and hopping to the IO thread. This also
makes cleanup much simpler.
* VideoCaptureHandle is removed.
The function of VideoCaptureHandle, i.e. handle cleanup of video
capture resource is now folded into VideoCaptureImplManager. It's
function is now replaced by a closure.
* VideoCaptureImplManager becomes the public interface for accessing
video capture device and start/stop capture.
It takes VideoCaptureImpl as an internal object and sheild it from
clients. We can now perform cleanup to prevent leak. Also ensures
VideoCaptureImpl objects are deleted on the IO thread.
* VideoFrames delivery done using callback insteasd of an interface.
Using callback to deliver VideoFrames and state changes make thread
hopping much simpler. Clients no longer need to provide an
EventHandler interface.
* Net deleted 450 lines of code.
Tested with apprtc.appspot.com and example pepper plugin.
Additional test to verify there's no leakage of VideoCaptureImpl objects.
BUG=335327, 362558
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266492
Patch Set 1 #Patch Set 2 : more friends #Patch Set 3 : explicit ClientInfo ctor #Patch Set 4 : explicit dtor #Patch Set 5 : merged #
Total comments: 80
Patch Set 6 : #Patch Set 7 : merged #Patch Set 8 : merged again :( #
Total comments: 29
Patch Set 9 : comments and merged #
Total comments: 2
Patch Set 10 : merged again :( #Patch Set 11 : remove TimeTicks #
Total comments: 1
Patch Set 12 : merged and upload again #Patch Set 13 : upload once more #Patch Set 14 : merge again and again :( #
Total comments: 13
Patch Set 15 : fixed comments #Patch Set 16 : comments for PepperPlatformVideoCapture #
Total comments: 1
Patch Set 17 : all done #Patch Set 18 : merge again :( #Messages
Total messages: 56 (0 generated)
|