Make sure webrtc::VideoSourceInterface is released on the main render thread.
commitee22d8807a7a7bbb69dcbb7a37307eadb57a7b2b
authorperkj@chromium.org <perkj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 9 May 2014 11:07:47 +0000 (9 11:07 +0000)
committerperkj@chromium.org <perkj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 9 May 2014 11:07:47 +0000 (9 11:07 +0000)
treeadd3d6ef66a6941bad8b201ed8a9b558ad468302
parent2b57e2ee3f4a5c245269b32a2a9b94fefada039c
Make sure webrtc::VideoSourceInterface is released on the main render thread.
webrtc::VideoSourceInterface must be released on the main render thread since it needs a libjingle thread wrapper. Fix problem with where a const scoped_refptr<webrtc::VideoSourceInterface>& source must be released on the main render thread. The problem was introduced in https://codereview.chromium.org/252393006/ where the video frames are now delivered on the IO-thread that may result in that that WebRtcVideoTrackAdapter::WebRtcVideoSourceAdapter that holds the last reference to it is destroyed on the IO-thread.

TEST= http://googlechrome.github.io/webrtc/samples/web/content/constraints/ click Ge media and click Connect. When video is flowing, refresh the page.
R=tommi@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269222 0039d316-1c4b-4281-b951-d872f2087c98
content/renderer/media/rtc_peer_connection_handler_unittest.cc
content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc
content/renderer/media/webrtc/webrtc_video_track_adapter.cc