0

Here is my question: how to crop the video via the surfaceview/surfaceholder class?

In my survey, the only way to crop the video is to use the TextureView::setTransform/setLayoutParams, am I right?

But there is only one interface working with surfaceholder class in my 3rd-party video player library: VideoPlayer::setDisplay( SurfaceHolder holder ). If I don't use the TextureView class, is it possible to resolve this problem?

I look forward to every possible suggestions, thanks a lot!

steven
  • 13
  • 4
  • I don't think there's a trivial API to do what you want. One possibility is to use OpenGL ES to transform the video. See e.g. "texture from camera" in Grafika (https://github.com/google/grafika). – fadden Oct 11 '14 at 13:26

1 Answers1

0

You can extend SurfaceView and follow example of VideoView to place video screen output the way you need.

Not sure if there are any other easier options available.

Volodymyr Lykhonis
  • 2,936
  • 2
  • 17
  • 13
  • Dear vladimir, in my knowledge, videoview will scale the video output. What I need is to crop the video, to show the region of interest. – steven Oct 11 '14 at 02:15
  • Yes, that's why I mentioned one of the options can be extending SurfaceView to display video the way you want. – Volodymyr Lykhonis Oct 13 '14 at 17:25