Search code examples
javascriptc++google-chromegoogle-chrome-extensiongoogle-nativeclient

how to pass chrome.tabCapture stream from js to c++ PNACL native code


I am working on integrate a chrome extension that captures video from the current tab, with the PNACL SDK in order to record the video stream into a .webm file. I already did that in a only-javascript version (with whammy) but I am interested in replace whammy with native code for performance reasons.

  • I wonder how to pass the stream obtained from chrome.tabCapture.capture in js to the native side (I guess it is through a postMessage but not sure if the js stream object can be passed as is, and in which kind of c++ structure receive it at native side).

    I appreciate any suggestions or feedback,


Solution

  • The Native Client SDK has an example plugin that does this. It's an API demo called media_stream_video.

    Here are instructions on how to build and run the examples: https://developer.chrome.com/native-client/sdk/examples