本文整理汇总了Java中net.majorkernelpanic.streaming.audio.AudioQuality类的典型用法代码示例。如果您正苦于以下问题:Java AudioQuality类的具体用法?Java AudioQuality怎么用?Java AudioQuality使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AudioQuality类属于net.majorkernelpanic.streaming.audio包,在下文中一共展示了AudioQuality类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSession
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
@Override
public void buildSession() {
boolean isAudioStream = settingsPreferencesUtil.loadAudioPreference();
int videoEncoder = settingsPreferencesUtil.loadVideoEncoderPreference();
int resolution = settingsPreferencesUtil.loadResolutionPreference();
int width[] = getResources().getIntArray(R.array.resolution_width);
int height[] = getResources().getIntArray(R.array.resolution_height);
session = SessionBuilder.getInstance()
.setCallback(this)
.setSurfaceView(surfaceView)
.setPreviewOrientation(90)
.setContext(this)
.setAudioEncoder(isAudioStream ? SessionBuilder.AUDIO_AAC : SessionBuilder.AUDIO_NONE)
.setAudioQuality(new AudioQuality(16000, 32000))
.setVideoEncoder((videoEncoder == 0) ? SessionBuilder.VIDEO_H264 : SessionBuilder.VIDEO_H263)
.setVideoQuality(new VideoQuality(width[resolution], height[resolution], 20, 500000))
.build();
}
示例2: init
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
public void init() {
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this.getContext()).edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(54321));
editor.apply();
mSession = SessionBuilder.getInstance()
.setCallback(this)
.setSurfaceView(mView)
.setPreviewOrientation(90)
.setContext(this.getContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setAudioQuality(new AudioQuality(16000, 32000))
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setVideoQuality(new VideoQuality(800,480,10,500000))
.build();
mView.getHolder().addCallback(this);
this.getContext().startService(new Intent(this.getContext(),RtspServer.class));
}
示例3: initRtspClient
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
private void initRtspClient() {
// Configures the SessionBuilder
mSession = SessionBuilder.getInstance()
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_AAC)
.setAudioQuality(new AudioQuality(8000, 16000))
.setVideoQuality(new VideoQuality(UVCCamera.DEFAULT_PREVIEW_WIDTH * 2, UVCCamera.DEFAULT_PREVIEW_HEIGHT, SELECTED_FPS, 400000))
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setPreviewOrientation(90)
.setSurfaceView(mSurfaceView)
.setCallback(this).build();
// Get Surface
canvasSurface = mSession.getVideoTrack().getSurface();
// Configures the RTSP client
mClient = new RtspClient();
mClient.setSession(mSession);
mClient.setCallback(this);
mSurfaceView.setAspectRatioMode(SurfaceView.ASPECT_RATIO_PREVIEW);
String ip, port, path;
// We parse the URI written in the Editext
Pattern uri = Pattern.compile("rtsp://(.+):(\\d+)/(.+)");
Matcher m = uri.matcher(AppConfig.STREAM_URL);
m.find();
ip = m.group(1);
port = m.group(2);
path = m.group(3);
mClient.setCredentials(AppConfig.PUBLISHER_USERNAME,
AppConfig.PUBLISHER_PASSWORD);
mClient.setServerAddress(ip, Integer.parseInt(port));
mClient.setStreamPath("/" + path);
Log.e(TAG, "done initRtsp");
}
示例4: initRtspClient
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
private void initRtspClient() {
// Configures the SessionBuilder
mSession = SessionBuilder.getInstance()
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setAudioQuality(new AudioQuality(8000, 16000))
.setVideoQuality(new VideoQuality(640, 480, 15, 200000))
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setSurfaceView(mSurfaceView)
.setPreviewOrientation(90)
.setCallback(this).build();
// Configures the RTSP client
mClient = new RtspClient();
mClient.setSession(mSession);
mClient.setCallback(this);
mSurfaceView.setAspectRatioMode(SurfaceView.ASPECT_RATIO_PREVIEW);
String ip, port, path;
// We parse the URI written in the Editext
Pattern uri = Pattern.compile("rtsp://(.+):(\\d+)/(.+)");
Matcher m = uri.matcher(AppConfig.STREAM_URL);
m.find();
ip = m.group(1);
port = m.group(2);
path = m.group(3);
mClient.setCredentials(AppConfig.PUBLISHER_USERNAME,
AppConfig.PUBLISHER_PASSWORD);
mClient.setServerAddress(ip, Integer.parseInt(port));
mClient.setStreamPath("/" + path);
}
示例5: initRtspClient
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
private void initRtspClient() {
// Configures the SessionBuilder
mSession = SessionBuilder.getInstance()
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setAudioQuality(new AudioQuality(8000, 16000))
.setVideoQuality(new VideoQuality(640, 480, 15, 200000))
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setPreviewOrientation(90)
.setSurfaceView(mSurfaceView)
.setCallback(this).build();
// Get Surface
canvasSurface = mSession.getVideoTrack().getSurface();
// Configures the RTSP client
mClient = new RtspClient();
mClient.setSession(mSession);
mClient.setCallback(this);
mSurfaceView.setAspectRatioMode(SurfaceView.ASPECT_RATIO_PREVIEW);
String ip, port, path;
// We parse the URI written in the Editext
Pattern uri = Pattern.compile("rtsp://(.+):(\\d+)/(.+)");
Matcher m = uri.matcher(AppConfig.STREAM_URL);
m.find();
ip = m.group(1);
port = m.group(2);
path = m.group(3);
mClient.setCredentials(AppConfig.PUBLISHER_USERNAME,
AppConfig.PUBLISHER_PASSWORD);
mClient.setServerAddress(ip, Integer.parseInt(port));
mClient.setStreamPath("/" + path);
Log.e(TAG, "done initRtsp");
}
示例6: setAudioQuality
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
/** Sets the audio quality. */
public SessionBuilder setAudioQuality(AudioQuality quality) {
mAudioQuality = quality.clone();
return this;
}
示例7: getAudioQuality
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
/** Returns the AudioQuality set with {@link #setAudioQuality(AudioQuality)}. */
public AudioQuality getAudioQuality() {
return mAudioQuality;
}
示例8: setAudioQuality
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
/**
* Sets the configuration of the stream. You can call this method at any time
* and changes will take effect next time you call {@link #configure()}.
* @param quality Quality of the stream
*/
public void setAudioQuality(AudioQuality quality) {
if (mAudioStream != null) {
mAudioStream.setAudioQuality(quality);
}
}
示例9: getAudioQuality
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
/** Returns the AudioQuality set with {@link #setAudioQuality(net.majorkernelpanic.streaming.audio.AudioQuality)}. */
public AudioQuality getAudioQuality() {
return mAudioQuality;
}
示例10: setAudioQuality
import net.majorkernelpanic.streaming.audio.AudioQuality; //导入依赖的package包/类
/**
* Sets the configuration of the stream. <br />
* You can call this method at any time and changes will take
* effect next time you call {@link #configure()}.
* @param quality Quality of the stream
*/
public void setAudioQuality(AudioQuality quality) {
if (mAudioStream != null) {
mAudioStream.setAudioQuality(quality);
}
}