Brad Chen – Native Client: Native Code to Build Web Apps

Brad Chen – Native Client: Native Code to Build Web Apps

BRAD: Hi, I’m Brad Chen,
and I’m gonna be giving a talk
at Google I/O about a system called
Native Client. It’s a new technology
that Google has developed for using native code as a part
of web applications. Now, uh, uh,
people often ask me, “Well, why native code
in web applications? “I mean, uh,
what’s new about that? Active X has been there
for such a long time.” That may be true,
but, uh, uh, it’s one thing to use
native code, and it’s another thing
to use native code safely. Our goal
is to make native code– that is, compiled C
or C++ applications– as safe as the Java script
in HTML that people use and take
for granted today on the Web. One example that I’ll
be talking about at Google I/O is, uh, is a Linux
video processing system that we ported recently
to Native Client. Now, the original program would take a video
encoded in H264 format and convert it into a file
containing raw images on disc. And, uh, this example, the nice thing
that it shows is, with only about ten lines
of source code changes, we were able to take
that simple Linux application and make a video player
for Native Client. This first page
actually shows the first
substantial modification. And it’s really
quite simple. We start up
by initializing the Native Client
multimedia system. Uh, and then four lines
of error checking. Uh, then we initialize
the video subsystem in the multimedia system. Uh, and then making sure
that the application knows we’re not gonna be
writing that image to a– to a file, as the original
application did. And then on the next line,
we can see the code that actually does
the displaying of video frames. And, again,
it’s really simple. We call this routine, which had already been
implemented as a part
of the video library, to take the YV12 representation
of the video and convert it into a 24-bit
RGB representation. Then we simply call
nacl_video_update. That’s gonna cause the flame–
the frame– to be transferred
into the video memory. And then the system, uh, uh, takes care of, uh, the updating
of the frames itself. And that was it. With those changes,
we got a video player that would display video
in Native Client. And I’m looking forward
to showing that to you at the demo
at Google I/O.

Danny Hutson

1 thought on “Brad Chen – Native Client: Native Code to Build Web Apps

Leave a Reply

Your email address will not be published. Required fields are marked *