当前位置: 首页>>代码示例>>Java>>正文


Java MP4Config类代码示例

本文整理汇总了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();
	}
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:19,代码来源:H264Stream.java

示例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";
}
 
开发者ID:jamesrdelaney,项目名称:ecg_over_rtp,代码行数:12,代码来源:H264Stream.java

示例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();
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:9,代码来源:H264Stream.java


注:本文中的net.majorkernelpanic.streaming.mp4.MP4Config类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。