How to make androidmedia support direct output on surfaceview

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to make androidmedia support direct output on surfaceview

lucky chou
This post was updated on .
Hi,
As far as I know, it seems that  androidmedia plugin can only use OpenGL output video, right?
I hope similar to nuplayer, Video frame  be displayed on surface which is passed down by MediaPlayer insead of SurfaceTexture, how to do it?
AMediaCodec_configure (codec,format, surface,
              NULL, flags)

Because in some devices,  especially on TV device,
direct surface output video usually has hardware acceleration.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make androidmedia support direct output on surface

Matthew Waters
On 09/01/17 23:59, lucky chou wrote:

> Hi,
> As far as I know, it seems that  androidmedia plugin can only use OpenGL
> output video, right?
> I hope similar to nuplayer, Video frame  be displayed on surface which is
> passed down by MediaPlayer, how to do it?
> AMediaCodec_configure (codec,format, surface,
>               NULL, flags)
>
> Because in some devices,  especially on TV device,
> direct surface output video usually has hardware acceleration.
androidmedia can currently only use OpenGL for accelerated video
display, yes.  It uses the SurfaceTexture API to retrieve the OpenGL
texture to render the resulting video frame to the screen.

The other possibility (that's not currently implemented) is to pass a
SurfaceView based Surface into MediaCodec for decoding to render the
resulting video frames.  To do so, one would need a special sink element
as well as modifications to the androidmedia decoder to allow setting
the Surface from outside.  All doable though :)

Cheers
-Matt


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (527 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make androidmedia support direct output on surface

lucky chou
This post was updated on .
Matthew Waters wrote
On 09/01/17 23:59, lucky chou wrote:
> Hi,
> As far as I know, it seems that  androidmedia plugin can only use OpenGL
> output video, right?
> I hope similar to nuplayer, Video frame  be displayed on surface which is
> passed down by MediaPlayer, how to do it?
> AMediaCodec_configure (codec,format, surface,
>               NULL, flags)
>
> Because in some devices,  especially on TV device,
> direct surface output video usually has hardware acceleration.

>The other possibility (that's not currently implemented) is to pass a
>SurfaceView based Surface into MediaCodec for decoding to render the
>resulting video frames.  To do so, one would need a special sink element
>as well as modifications to the androidmedia decoder to allow setting
>the Surface from outside.  All doable though :)
Sounds great.Indeed, I think if support  surfaceview in Android, it should be more friendly for app developers.




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to make androidmedia support direct output on surface

lucky chou
Can anyone simply explain how androidmedia works?
such as,as far as I know, the decoded frames is placed in  gl_queue, but how to drive _amc_gl_wait to consume the data inside it?

In other words,
If we pass a SurfaceView based Surface into MediaCodec for decoding to render the
resulting video frames. "a special sink" element  must do what , to replace some of  work by opengl?
Loading...