Eliminate video capture thread in renderer
commit4504807dc2c05a12bea92e791e7c2a5a94f4234d
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 14 Jan 2014 13:51:29 +0000 (14 13:51 +0000)
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 14 Jan 2014 13:51:29 +0000 (14 13:51 +0000)
tree3579136c154b41f622bbc4380f0e037d3942aa61
parentbc6c00cab62fc382d84df8477e8d82f62df2a4e4
Eliminate video capture thread in renderer

The main motivation of this change is to remove the video capture thread
in the renderer. All users of a video capture device already handles the
video frame on their thread. There is no need to call the clients with
an additional thread.

Summary of this change:
* Video capture thread eliminated
  VideoCaptureImpl now runs on the IO thread. Clients are called on the
  IO thread.
* Simplified VideoCaptureImplManager
  We still need to keep this object for the purpose of sharing a
  VideoCaptureImpl object with multiple clients. It should own these
  objects and maintain the usage count. A couple clean up items are done
  on this class:
  * It doesn't own the video capture thread now.
  * It is now a render thread only object.
  * It maintains refcount of a VideoCaptureImpl explicitly.
  * It is no longer refcounted.
  * Clients access it through RenderThreadImpl. Which ensures usage is
    on the render thread.
* New VideoCaptureHandle class
  Object of this class is returned by VideoCaptureImplManager to give
  access to a media::VideoCapture object. It is purely a wrapper and
  helps to do refcounting on the render thread.

Testing:
Added unit tests for VideoCaptureImplManager to test refcounting.
Also updated unit test for VideoCaptureImpl due to the threading
changes.

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244074

Review URL: https://codereview.chromium.org/120893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244687 0039d316-1c4b-4281-b951-d872f2087c98
21 files changed:
content/content_tests.gypi
content/renderer/media/media_stream_dependency_factory.cc
content/renderer/media/media_stream_dependency_factory.h
content/renderer/media/mock_media_stream_dependency_factory.cc
content/renderer/media/rtc_video_capture_delegate.cc
content/renderer/media/rtc_video_capture_delegate.h
content/renderer/media/rtc_video_capturer.cc
content/renderer/media/rtc_video_capturer.h
content/renderer/media/video_capture_impl.cc
content/renderer/media/video_capture_impl.h
content/renderer/media/video_capture_impl_manager.cc
content/renderer/media/video_capture_impl_manager.h
content/renderer/media/video_capture_impl_manager_unittest.cc
content/renderer/media/video_capture_impl_unittest.cc
content/renderer/pepper/pepper_platform_video_capture.cc
content/renderer/pepper/pepper_platform_video_capture.h
content/renderer/render_thread_impl.cc
content/renderer/render_thread_impl.h
media/media.gyp
media/video/capture/mock_video_capture_event_handler.cc [new file with mode: 0644]
media/video/capture/mock_video_capture_event_handler.h [new file with mode: 0644]