-
- Downloads
EncodeComponent: clamp dynamic framerate for H264
The user app can provide buffers to the encoder directly via MediaCodec API (queueInputBuffer) or via InputSurface. In case the input surface is used, the timestamps of the encoded frames are automatically generated, as they're being considered as a real-time traffic (for example - from screen capture session or the camera input). Also the Component is supposed to dynamically adjust the framerate based on the input frames timestamps (see b/192419592). The dynamic framerate calculation may provide extreme framerate values, which will cause encoder failures because of too high MBPS for the given profile. One such case was detected by test android.media.codec.cts.MediaCodecTest#testAbruptStop after OMX removal. As the CTS test itself can generate such values, the encoder was updated to calculate the maximum allowed framerate for the input frame size and output level. Then this value is used to limit the dynamic framerate calculations. As it can be potentially an app error, the warning is printed whenever this happens. Note: this is currently done only for H264. For other codecs the clamping won't be effective, as the maximum allowed framerate is set to uint32_t::max(). Bug: 295339810 Bug: 362902868 Test: android.media.codec.cts.MediaCodecTest#testAbruptStop Test: com.google.android.media.gts.RtcVideoCodecTest#testDynamicFramerateChangeVp8 Change-Id: I783493453d762886a10996d0ad9821149cafb014
Showing
- common/Android.bp 1 addition, 0 deletionscommon/Android.bp
- common/H264.cpp 30 additions, 0 deletionscommon/H264.cpp
- common/include/v4l2_codec2/common/H264.h 51 additions, 0 deletionscommon/include/v4l2_codec2/common/H264.h
- components/EncodeComponent.cpp 20 additions, 0 deletionscomponents/EncodeComponent.cpp
- components/EncodeInterface.cpp 2 additions, 28 deletionscomponents/EncodeInterface.cpp
- components/include/v4l2_codec2/components/EncodeComponent.h 3 additions, 0 deletionscomponents/include/v4l2_codec2/components/EncodeComponent.h
- v4l2/V4L2EncodeComponent.cpp 4 additions, 12 deletionsv4l2/V4L2EncodeComponent.cpp
Loading