I think solution 1 is not easy to achieve, too. Since Android created CameraSource to adapt Camera into Stagefright, you will have to create a similar class adapt MediaStream into StageFright.
Another questioon is that if your source is not GraphicBuffer based(camera is) than several frame-by-frame memcpy maybe needed based on the HAL implementation which make hardware encoding not as fast as expected than software encoding. That means if you are going to enable transcoding on B2G, you will have to force stagefright decoding and the change scatters here and there. The memcpy problem for many MediaSource implementations(especially SurfaceMediaSource) is solved by MediaBuffer backed with GraphicBuffer by AOSP in ICS. In HC version, the memcpy is inevitable. Best Regards, Chiajung ----- Original Message ----- From: [email protected] To: [email protected] Sent: Wednesday, July 10, 2013 2:14:10 PM Subject: Re: MP4 recording on B2G On Wednesday, July 10, 2013 1:05:19 PM UTC+8, Robert O'Callahan wrote: > On Tue, Jul 9, 2013 at 8:17 PM, <[email protected]> wrote: > > > > > Based on bug 803414 and bug 842243, I'm studying how to enable H264/AAC > > > MP4 for MediaRecorder[1] on B2G. Following is my thought: > > > > > > 1. Reuse GonkRecorder > > > 2. Build a new path including MP4 muxer and encode wrapper to codec like > > > OMX. > > > > > > Option 1 should be the easy way because b2g18 uses it for a while and it > > > fulfils requirements. The drawback is: it uses a lot of Android stuff; IMHO > > > it could be a bad idea to spread these stuffs in gecko. > > > > > > Option 2 requires a lot of work. To write a MP4 muxer from scratch or use > > > a open source muxer? If we go with this option, I plan to use a MPL library > > > mp4v2[2] as MP4 muxer. > > > On B2G we also need to write an IOMX bridge to HW codec, it will include > > > some Android headers but it'd be able to encapsulate under TrackEncoder. > > > > > > > Are you working on this with Shelly in bug 879668? Yes. _______________________________________________ dev-media mailing list [email protected] https://lists.mozilla.org/listinfo/dev-media _______________________________________________ dev-media mailing list [email protected] https://lists.mozilla.org/listinfo/dev-media

