Skip to content

Instantly share code, notes, and snippets.

@FlyingJester
Created July 24, 2014 22:39
Show Gist options
  • Select an option

  • Save FlyingJester/008b71d0c07d73baee50 to your computer and use it in GitHub Desktop.

Select an option

Save FlyingJester/008b71d0c07d73baee50 to your computer and use it in GitHub Desktop.
const size_t kCsdLength = 2;
uint8 csd[kCsdLength];
csd[0] = profile << 3 | frequency_index >> 1;
csd[1] = (frequency_index & 0x01) << 7 | channel_config << 3;
ScopedJavaLocalRef<jbyteArray> byte_array =
base::android::ToJavaByteArray(env, csd, kCsdLength);
Java_MediaCodecBridge_setCodecSpecificData(
env, j_format, 0, byte_array.obj());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment