importing some vid code from naoko
Revert "importing some vid code from naoko"

This reverts commit 9496edbc180883fa3233f200a22d342601bc5780.
importing some vid api code from naoko