HW Video Acceleration in Chrome/Chromium HTML5 video 视频播放硬件加速
来源:互联网 发布:mac网线转接头怎么联网 编辑:程序博客网 时间:2024/05/21 07:47
Introduction
Video decode (e.g. YouTube playback) and encode (e.g. video chat applications) are some of the most complex compute operations on the modern web. Moving these operations from software running on general-purpose CPUs to dedicated hardware blocks means lower power consumption, longer battery life, higher quality (e.g. HD instead of SD), and better interactive performance as the CPU is freed up to work on everything else it needs to do.
Design
media::VideoDecodeAccelerator (VDA) and media::VideoEncodeAccelerator (VEA) (with their respective Client subclasses) are the interfaces at the center of all video HW acceleration in Chrome. Each consumer of HW acceleration implements the relevant Client interface and calls an object of the relevant V[DE]A interface.
In general the classes that want to encode or decode video live in the renderer process (e.g. the <video> player, or WebRTC’s video encoders & decoders) and the HW being utilized is not accessible from within the renderer process, soIPC is used to bridge the renderer<->GPU process gap.
Implementation Details
The main consumers of the acceleration APIs are: <video> pipeline (what plays media on the web), WebRTC (enabling plugin-free real-time video chat on the web), and Pepper API (offering HW acceleration to pepper plugins such as Adobe Flash).
The implementations of the acceleration APIs are specific to the OS (and sometimes HW platform) due to radically different options offered by the OS and drivers/HW present.
(not pictured: obsolete OpenMAX-IL-basedOVDA, and never-launched MacVDA).
Current Status
New devices are released all the time so this list is likely already out of date, but as of early June 2014, existing (public) support includes:
Decode
Windows: starting with Windows 7, HW accelerated decode of h.264 is used via DXVAVDA.
CrOS/Intel (everything post-Mario/Alex/ZGB): HW accelerated decode of h.264 is used via VAVDA
CrOS/ARM: HW accelerated decode of VP8 and h.264 is available via V4L2VDA
Android: HW accelerated decode of VP8 is available on N10, N5, some S4’s, and a bunch of other devices. (note that on Android this only applies to WebRTC, as there is no PPAPI and <video> uses the platform’s player)
Encode
CrOS/ARM: HW accelerated encode of h.264 (everywhere) and VP8 (2014 devices) is available via V4L2VEA
Android: HW accelerated encode of VP8 is available on N5.
Results
Generally speaking offloading encode or decode from CPU to specialized HW has shown an overall battery-life extension of 10-25% depending on the platform, workload, etc
转自
https://docs.google.com/document/d/1LUXNNv1CXkuQRj_2Qg79WUsPDLKfOUboi1IWfX2dyQE/preview#
根据Kitkat上的Chromium代码分析,HTML5 video播放硬件加速,最终是使用MediaCodec.java来利用本地native的硬件资源来做video视频播放加速的。
MediaPlayer的大致框图如下:
而Pipeline最终会通过GpuVideoDecoder调用到MediaCodec:
而具体的时序图则还没搞清楚。以MediaPlayer为切入点看Chromium的代码还真挺困难的
- HW Video Acceleration in Chrome/Chromium HTML5 video 视频播放硬件加速
- Chrome/Chromium HTML5 video 视频播放硬件加速
- Chrome/Chromium HTML5 video 视频播放硬件加速
- html5-video视频播放
- android html5<video> 视频播放
- html5实现视频播放<video>
- HTML5 - 使用<video>播放视频
- HTML5 - 使用<video>播放视频
- html5 video无法播放视频
- Video---HTML5视频video
- [HTML5] Video 标签播放及控制视频
- 使用HTML5的video标签播放视频
- HTML5 音频播放 <audio> 视频<video>
- Web视频播放 之 【HTML5 Video标签】
- HTML5 video播放视频的方法
- Chromium为视频标签<video>全屏播放的过程分析
- html5 video不能播放 能播放声音不能播放视频
- html5 video播放
- 小P的故事——神奇的Dota(SDUT 2773)
- spring aop 实现原理---代理模式
- 黑马程序员_GUI图形化界面
- Android自定义控件浅谈
- 发牌问题
- HW Video Acceleration in Chrome/Chromium HTML5 video 视频播放硬件加速
- 如何给自己编写的程序隐蔽的设置开机启动
- 车型五:丰田杰路驰 售价:25
- 查看java堆栈信息
- SQL Server添加序号列
- xmu 1000 A+B
- chrome的设置
- Oracle trigger详解
- 嵌入式 详解制作根文件系统以及文件系统中init以及其他文件详解