Android Video: Don't destroy a video texture in the destructor until it's returned.
This CL fixes the bug that WMPA makes the compositor get following gl error.
E/chromium(12686): [12686:12717:0327/005938:
110608389551:ERROR:gles2_cmd_decoder.cc(10082)]
[.BrowserCompositor-0x62cdff20]GL ERROR :GL_INVALID_OPERATION : glConsumeTextureCHROMIUM:
invalid mailbox name
Currently, WebMediaPlayerAndroid deletes a texture, even if the texture is
used by the clients. This CL makes "release callback" be able to delete in-display
texture even after WebMediaPlayerAndroid is destructed.
This pattern is very similar that GpuVideoDecoder, accelerated 2d canvas and
WebGL release remained mailboxes. See GpuVideoDecoder.
Major changes:
1. Make StreamTextureFactory ref-counted to use it even after WMPA is destructed.
2. Speaking stream texture, texture_id_ is origin and all VideoFrame objects refer to texture_id_.
When all VideoFrame objects and texture_id_ are deleted, the stream texture is deleted.
3. Delete redundant StreamTextureFactory::DestroyStreamTexture().
Test=Run following tests on Nexus 5.
- http://www.quirksmode.org/html5/tests/video.html for HW Video.
- http://html5demos.com/video-canvas for Accelerated 2D Canvas.
- http://people.mozilla.org/~bjacob/mdn_samples_webgl_sample8/index.html for WebGL.
BUG=350925
Review URL: https://codereview.chromium.org/
192813003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260871 0039d316-1c4b-4281-b951-d872f2087c98