Unfortunately, the internal View used to render the video frames is a TextureView, and therefore you can't request the drawing cache (TextureView is HardwareAccelerated).
Moreover, the documentation specifies that:
public final void draw (Canvas canvas)
Subclasses of TextureView cannot do their own
rendering with the Canvas object.
So, your draw()
call will have no effect on the TextureView.
Maybe you could try to use the getBitmap()
method on the internal TextureView but I can't guarantee you this will work.
At this time, there is no such feature on the Weemo SDK, but we're investigating to provide a more convenient way of capturing these frames.
Also, it would be interesting for us to better understand your use case. Maybe you could share a bit more on what you are trying to achieve. This could help us design anew SDK feature that will best fit your needs.
Edit:
To get a reference to this TextureView
, simply browse the view hierarchy.
You could for example do this:
WeemoVideoInFrame videoFrame = getView().findViewById(R.id.video_frame);
findTextureView(videoFrame);
/* ... */
TextureView findTextureView(WeemoVideoInFrame frame) {
for (int index = 0; index < frame.getChildCount(); index++) {
View child = frame.getChildAt(index);
if(child instanceof TextureView) {
return (TextureView) child;
}
}
return null;
}
But keep in mind that this behavior is not guaranteed.