Android Open Source - cameraMediaCodec Avc Decoder Bug






From Project

Back to project page cameraMediaCodec.

License

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.

Java Source Code

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;
  }
}




Java Source Code List

com.android.testtool.AvcDecoderBug.java
com.android.testtool.AvcDecoder.java
com.android.testtool.AvcEncoder.java
com.android.testtool.AvcUtils.java
com.android.testtool.BitBufferLite.java
com.android.testtool.CameraInfoCollector.java
com.android.testtool.FpsHelper.java
com.android.testtool.HelloCameraActivity.java
com.android.testtool.RawUtils.java
com.android.testtool.SvcCaptureCallback.java
com.android.testtool.SvcCaptureEngine.java
com.android.testtool.SvcEncodeOutputParam.java
com.android.testtool.SvcEncodeSpacialParam.java
com.android.testtool.SvcEncoder.java
com.android.testtool.VideoBufferInfo.java