mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
f2ca0eaf27
This provides a performance and power usage improvement by removing the texture copy from an OES texture to 2D texture. The flow is as follows 1. Generate the output buffer with the required sync meta with the incrementing push counter and OES GL memory 1.1 release_output_buffer (buf, render=true) and push downstream 2. Downstream waits for on the sync meta (timed wait) or drops the frame (no wait) 2.1 Timed wait for the frame number to reach the number of frame callbacks fired 2.2 Unconditionally update the image when the wait completes (success or fail). Sets the affine transformation matrix meta on the buffer. 3. Downstream renders as usual. At *some* point through this the on_frame_callback may or may not fire. If it does fire, we can finish waiting early and render. Otherwise we have to wait for a timeout to occur which may cause more buffers to be pused into the internal GL queue which siginificantly decreases the chances of the on_frame_callback to fire again. This is because the frame callback only occurs when the internal GL queue changes state from empty to non-empty. Because there is no way to reliably correlate between the number of buffers pushed and the number of frame callbacks received, there are a number of workarounds in place. 1. We self-increment the ready counter when it falls behind the push counter 2. Time based waits as the frame callback may not be fired for a certain frame. 3. It is assumed that the device can render at speed or performs some QoS of the interal GL queue (which may not match the GStreamer QoS). It holds that we call SurfaceTexture::updateTexImage for each buffer pushed downstream however there's no guarentee that updateTexImage will result in the exact next frame (it could skip or duplicate) so synchronization is not guaranteed to be accurate although it seems to be close enough to be unable to discern visually. This has not changed from before this patch. The current requirement for synchronization is that updateTexImage is called at the point in time when the buffers is to be rendered. https://bugzilla.gnome.org/show_bug.cgi?id=757285
42 lines
1.1 KiB
Makefile
42 lines
1.1 KiB
Makefile
plugin_LTLIBRARIES = libgstandroidmedia.la
|
|
|
|
libgstandroidmedia_la_SOURCES = \
|
|
gstamc.c \
|
|
gstamcaudiodec.c \
|
|
gstamcvideodec.c \
|
|
gstamcvideoenc.c \
|
|
gstamcsurface.c \
|
|
gstamcsurfacetexture.c \
|
|
gstjniutils.c
|
|
|
|
noinst_HEADERS = \
|
|
gstamc.h \
|
|
gstamc-constants.h \
|
|
gstamcaudiodec.h \
|
|
gstamcvideodec.h \
|
|
gstamcvideoenc.h \
|
|
gstamcsurface.h \
|
|
gstamcsurfacetexture.h \
|
|
gstjniutils.h
|
|
|
|
libgstandroidmedia_la_CFLAGS = \
|
|
-I$(top_srcdir)/gst-libs \
|
|
-I$(top_builddir)/gst-libs \
|
|
$(GST_PLUGINS_BASE_CFLAGS) \
|
|
$(GST_BASE_CFLAGS) \
|
|
$(GST_CFLAGS) \
|
|
$(ORC_CFLAGS)
|
|
libgstandroidmedia_la_LIBADD = \
|
|
$(top_builddir)/gst-libs/gst/gl/libgstgl-$(GST_API_VERSION).la \
|
|
$(GST_PLUGINS_BASE_LIBS) \
|
|
-lgstaudio-@GST_API_VERSION@ \
|
|
-lgstpbutils-@GST_API_VERSION@ \
|
|
-lgstvideo-@GST_API_VERSION@ \
|
|
$(GST_BASE_LIBS) \
|
|
$(GST_LIBS) \
|
|
$(ORC_LIBS)
|
|
libgstandroidmedia_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
|
libgstandroidmedia_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
|
|
|
|
androidmedia_java_classesdir = $(datadir)/gst-android/ndk-build/androidmedia/
|
|
androidmedia_java_classes_DATA = org/freedesktop/gstreamer/androidmedia/GstAmcOnFrameAvailableListener.java
|