Closed Bug 963458 Opened 10 years ago Closed 10 years ago

[Media Encoder][b2g-emulator-jb] Cannot record the video stream from fake gUM

Categories

(Core :: Audio/Video: Recording, defect)

x86_64
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: rlin, Assigned: jhlin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

STR. on emulator-jb, git gecko ver:85b8bb0ff931e
1. get media stream from fake getUserMedia
2. record the media stream
3. got onerror callback

log: 
I/OMXClient(  535): Using client-side OMX mux.
I/SoftAVCEncoder(  535): Construct SoftAVCEncoder
I/ACodec  (  535): setupVideoEncoder succeeded
E/ACodec  (  535): [OMX.google.h264.encoder] configureCodec returning error -2147483648
E/MediaCodec(  535): Codec reported an error. (omx error 0x80001001, internalError -2147483648)
I/MediaEncoder(  535): [VideoTrackEncoder]: Fail to initialize the encoder!
I/OMXClient(  535): Using client-side OMX mux.
I/MediaEncoder(  535): [AudioTrackEncoder]: Receive TRACK_EVENT_ENDED .
SoftAVCEncoder does not support encoding video resolution > CIF (352x288) (See http://androidxref.com/4.3_r2.1/xref/frameworks/av/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp#60). Need to use different AVC/H.264 encoder configuration if running on emulator.
QA Contact: jolin
Incorrectly set QA Contact field in previous editing.
Assignee: nobody → jolin
QA Contact: jolin → jsmith
Attached patch avc-encoder-config-for-emu.patch (obsolete) — Splinter Review
Use Android system properties API to check if we're running on emulator and adjust parameters accordingly.
Attachment #8374637 - Flags: review?(roc)
Attached patch avc-encoder-config-for-emu.patch (obsolete) — Splinter Review
Return error rather than assert/crash when input size too large. (Thanks to feedback from :CJKu and :rlin)
Attachment #8374637 - Attachment is obsolete: true
Attachment #8374637 - Flags: review?(roc)
Attachment #8375415 - Flags: review?(roc)
Comment on attachment 8375415 [details] [diff] [review]
avc-encoder-config-for-emu.patch

Review of attachment 8375415 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/media/omx/OMXCodecWrapper.cpp
@@ +132,5 @@
> +  OMX_VIDEO_CONTROLRATETYPE bitrateMode = OMX_Video_ControlRateConstant;
> +  // Limitation of soft AVC/H.264 encoder running on emulator in stagefright.
> +  static bool emu = IsRunningOnEmulator();
> +  if (emu) {
> +    if (aWidth > 352 || aHeight > 288) {

If software encoder in stagefright can accept VGA resolution in future, code here will block recording pipeline forever.

Another suggestion is instead of return NS_ERROR_INVALID_ARG here, you may 
if (aWidth > 352 || aHeight > 288) {
  mMayFailedBecauseOfResolutionToBig = true;
}

After getting an unknown error callback from MediaCodec, in error callback function, write this log:
CODEC_ERROR("SoftAVCEncoder doesn't support resolution larger than CIF");
Update commit message & carry r+ from roc.
Attachment #8375415 - Attachment is obsolete: true
Attachment #8376907 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4dcf54ce26cc
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Component: Video/Audio → Video/Audio: Recording
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: