本文整理汇总了Java中net.majorkernelpanic.streaming.mp4.MP4Config类的典型用法代码示例。如果您正苦于以下问题:Java MP4Config类的具体用法?Java MP4Config怎么用?Java MP4Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MP4Config类属于net.majorkernelpanic.streaming.mp4包,在下文中一共展示了MP4Config类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMediaCodecAPI
import net.majorkernelpanic.streaming.mp4.MP4Config; //导入依赖的package包/类
@SuppressLint("NewApi")
private MP4Config testMediaCodecAPI() throws RuntimeException, IOException {
createCamera();
updateCamera();
try {
if (mQuality.resX>=640) {
// Using the MediaCodec API with the buffer method for high resolutions is too slow
mMode = MODE_MEDIARECORDER_API;
}
EncoderDebugger debugger = EncoderDebugger.debug(mSettings, mQuality.resX, mQuality.resY);
return new MP4Config(debugger.getB64SPS(), debugger.getB64PPS());
} catch (Exception e) {
// Fallback on the old streaming method using the MediaRecorder API
Log.e(TAG,"Resolution not supported with the MediaCodec API, we fallback on the old streamign method.");
mMode = MODE_MEDIARECORDER_API;
return testH264();
}
}
示例2: generateSessionDescription
import net.majorkernelpanic.streaming.mp4.MP4Config; //导入依赖的package包/类
/**
* Returns a description of the stream using SDP. It can then be included in an SDP file.
* Will fail if called when streaming.
*/
public String generateSessionDescription() throws IllegalStateException, IOException {
MP4Config config = testH264();
return "m=video "+String.valueOf(getDestinationPorts()[0])+" RTP/AVP 96\r\n" +
"a=rtpmap:96 H264/90000\r\n" +
"a=fmtp:96 packetization-mode=1;profile-level-id="+config.getProfileLevel()+";sprop-parameter-sets="+config.getB64SPS()+","+config.getB64PPS()+";\r\n";
}
示例3: testH264
import net.majorkernelpanic.streaming.mp4.MP4Config; //导入依赖的package包/类
/**
* Tests if streaming with the given configuration (bit rate, frame rate, resolution) is possible
* and determines the pps and sps. Should not be called by the UI thread.
**/
private MP4Config testH264() throws IllegalStateException, IOException {
if (mMode != MODE_MEDIARECORDER_API) return testMediaCodecAPI();
else return testMediaRecorderAPI();
}