Hardware accelerated video playback in Chromium?

We’re currently prototyping on the TX2 for a product and are trying to make decisions about architecting the UI. Our hope was that we could host HTML content in a browser as that’s a fairly common implementation. The catch is smooth HD video playback is a very important part of our application, so software rendering is not an option. Looking at Chromium’s Tegra features, there are modules which support using the TX1’s v4l2 interface for hardware accelerated playback that can be enabled at compile time. E.g.,:

bool TegraV4L2Device::Initialize() {
  VLOGF(2);
  static bool initialized = []() {
    if (!dlopen("/usr/lib/libtegrav4l2.so",
                RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE)) {
      return false;
    }
#define TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(name)          \
  do {                                                    \
    TegraV4L2_##name = reinterpret_cast<TegraV4L2##name>( \
        dlsym(RTLD_DEFAULT, "TegraV4L2_" #name));         \
    if (TegraV4L2_##name == NULL) {                       \
      VLOGF(1) << "Failed to dlsym TegraV4L2_" #name;     \
      return false;                                       \
    }                                                     \
  } while (0)

    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Open);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Close);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Ioctl);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Poll);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(SetDevicePollInterrupt);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(ClearDevicePollInterrupt);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Mmap);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(Munmap);
    TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR(UseEglImage);
#undef TEGRAV4L2_DLSYM_OR_RETURN_ON_ERROR
    return true;
  }();

Unfortunately, the same interface is not present on the version of libtegrav4l2.so bundled with our Jetson boards. Specifically, the TegraV4L2_UseEglImage symbol is now absent:

nvidia@tegra-ubuntu:/usr/lib/aarch64-linux-gnu/tegra$ nm -D libtegrav4l2.so | grep Tegra
0000000000002644 T TegraV4L2_ClearDevicePollInterrupt
0000000000002254 T TegraV4L2_Close
0000000000002270 T TegraV4L2_Ioctl
00000000000026c0 T TegraV4L2_Mmap
000000000000275c T TegraV4L2_Munmap
00000000000021ac T TegraV4L2_Open
0000000000002398 T TegraV4L2_Poll
00000000000024c8 T TegraV4L2_Poll_CPlane
00000000000023f4 T TegraV4L2_Poll_OPlane
000000000000259c T TegraV4L2_SetDevicePollInterrupt

Is there a particular reason for the omission? Better yet, should we be trying a different approach (VAAPI, omx etc)?

Hi,
This is not supported. The feature was reviewed at r24.2 but not adopted. The status is pending currently.

If you have strong request, please contact sales https://www.nvidia.com/en-us/contact/sales/
Let’s see if we can have further cooperation. Thanks.

We actually do very much, the Jetson Nano is a very interesting plattform for us and having accelerated video playback in chromium would benefit us a lot. I’m unable to complete any of the support contact forms without getting an error unfortunately.