#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+static bool CanSurfaceRenderWhiteList(const std::string &name)
+{
+ // All devices 'should' be capiable of surface rendering
+ // but that seems to be hit or miss as most odd name devices
+ // cannot surface render.
+ static const char *cansurfacerender_decoders[] = {
+ "OMX.Nvidia",
+ NULL
+ };
+ for (const char **ptr = cansurfacerender_decoders; *ptr; ptr++)
+ {
+ if (!strcmp(*ptr, name.c_str()))
+ return true;
+ }
+ return false;
+}
+
/*****************************************************************************/
/*****************************************************************************/
class CNULL_Listener : public CJNISurfaceTextureOnFrameAvailableListener
break;
}
- // odroid platform throws trying to updateTexImage with a 'error creating EGLImage' and
- // 'unsupported native buffer format (0x13)', sw render them until we figure out why.
- if (!m_render_sw)
- m_render_sw = g_cpuInfo.getCPUHardware().find("ODROID") != std::string::npos;
-
-
// CJNIMediaCodec::createDecoderByXXX doesn't handle errors nicely,
// it crashes if the codec isn't found. This is fixed in latest AOSP,
// but not in current 4.1 devices. So 1st search for a matching codec, then create it.
return false;
}
+ // whitelist of devices that can surface render.
+ m_render_sw = CanSurfaceRenderWhiteList(m_codecname);
+
ConfigureMediaCodec();
// setup a YUV420P DVDVideoPicture buffer.
src_ptr += offset;
int loop_end = 0;
- if (m_videobuffer.format == RENDER_FMT_YUV420P)
- loop_end = 3;
- else if (m_videobuffer.format == RENDER_FMT_NV12)
+ if (m_videobuffer.format == RENDER_FMT_NV12)
loop_end = 2;
+ else if (m_videobuffer.format == RENDER_FMT_YUV420P)
+ loop_end = 3;
for (int i = 0; i < loop_end; i++)
{