Back to project page cameraMediaCodec.
The source code is released under:
Copyright (c) 2014, Zhang Ziyue All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * ...
If you think the Android project cameraMediaCodec listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android.testtool; /* w w w. ja va 2s .c om*/ public class AvcDecoderBug { private boolean mEnableDrop = true; private int mFrameCount = 0; public void EnableDrop(boolean enable) { mEnableDrop = enable; } public boolean ShouldDropAvcFrame(int frame_count, int nal_type) { boolean drop = false; if (mEnableDrop == false) return drop; if (frame_count > 30) { //drop sps/pps if (nal_type == AvcUtils.NAL_TYPE_SPS || nal_type == AvcUtils.NAL_TYPE_PPS) { drop = true; } //drop idr // if (nal_type == AvcUtils.NAL_TYPE_CODED_SLICE_IDR) // { // drop = true; // } //drop p // if (nal_type == AvcUtils.NAL_TYPE_CODED_SLICE) // { // if (frame_count % 150 == 0) // { // drop = true; // } // } } mFrameCount = frame_count; return drop; } }