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


Java VideoQuality类代码示例

本文整理汇总了Java中net.majorkernelpanic.streaming.video.VideoQuality的典型用法代码示例。如果您正苦于以下问题:Java VideoQuality类的具体用法?Java VideoQuality怎么用?Java VideoQuality使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VideoQuality类属于net.majorkernelpanic.streaming.video包,在下文中一共展示了VideoQuality类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildSession

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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();
}
 
开发者ID:hypeapps,项目名称:Endoscope,代码行数:19,代码来源:StartStreamActivity.java

示例2: init

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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));

    }
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:23,代码来源:VideoStreamProvider.java

示例3: onCreate

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
@Override
public void onCreate() {

	// The following line triggers the initialization of ACRA
	// Please do not uncomment this line unless you change the form id or I will receive your crash reports !
	//ACRA.init(this);

	sApplication = this;

	super.onCreate();

	SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);

	notificationEnabled = settings.getBoolean("notification_enabled", true);
	
	// On android 3.* AAC ADTS is not supported so we set the default encoder to AMR-NB, on android 4.* AAC is the default encoder
	audioEncoder = (Integer.parseInt(android.os.Build.VERSION.SDK)<14) ? SessionBuilder.AUDIO_AMRNB : SessionBuilder.AUDIO_AAC;
	audioEncoder = Integer.parseInt(settings.getString("audio_encoder", String.valueOf(audioEncoder)));
	videoEncoder = Integer.parseInt(settings.getString("video_encoder", String.valueOf(videoEncoder)));

	// Read video quality settings from the preferences 
	videoQuality = new VideoQuality(
					settings.getInt("video_resX", videoQuality.resX),
					settings.getInt("video_resY", videoQuality.resY), 
					Integer.parseInt(settings.getString("video_framerate", String.valueOf(videoQuality.framerate))), 
					Integer.parseInt(settings.getString("video_bitrate", String.valueOf(videoQuality.bitrate/1000)))*1000);

	SessionBuilder.getInstance() 
	.setContext(getApplicationContext())
	.setAudioEncoder(!settings.getBoolean("stream_audio", true)?0:audioEncoder)
	.setVideoEncoder(!settings.getBoolean("stream_video", false)?0:videoEncoder)
	.setVideoQuality(videoQuality);

	// Listens to changes of preferences
	settings.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener);

	registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
	
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:40,代码来源:SpydroidApplication.java

示例4: initRtspClient

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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");
}
 
开发者ID:quanhua92,项目名称:libstreaming_android_studio,代码行数:40,代码来源:StreamDualUsbCamera.java

示例5: initRtspClient

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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);
}
 
开发者ID:quanhua92,项目名称:libstreaming_android_studio,代码行数:33,代码来源:StreamAndroidPhone.java

示例6: initRtspClient

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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");
}
 
开发者ID:quanhua92,项目名称:libstreaming_android_studio,代码行数:40,代码来源:StreamUsbCamera.java

示例7: setVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
/** Sets the video stream quality. */
public SessionBuilder setVideoQuality(VideoQuality quality) {
	mVideoQuality = quality.clone();
	return this;
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:6,代码来源:SessionBuilder.java

示例8: getVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
/** Returns the VideoQuality set with {@link #setVideoQuality(VideoQuality)}. */
public VideoQuality getVideoQuality() {
	return mVideoQuality;
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:5,代码来源:SessionBuilder.java

示例9: setVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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 setVideoQuality(VideoQuality quality) {
	if (mVideoStream != null) {
		mVideoStream.setVideoQuality(quality);
	}
}
 
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:11,代码来源:Session.java

示例10: getVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
/** Returns the VideoQuality set with {@link #setVideoQuality(net.majorkernelpanic.streaming.video.VideoQuality)}. */
public VideoQuality getVideoQuality() {
	return mVideoQuality;
}
 
开发者ID:Oo-Dev,项目名称:OoDroid2,代码行数:5,代码来源:SessionBuilder.java

示例11: onCreate

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
@Override
public void onCreate() {

	// The following line triggers the initialization of ACRA
	// Please do not uncomment this line unless you change the form id or I will receive your crash reports !
	//ACRA.init(this);

	sApplication = this;

	super.onCreate();

	SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);

	notificationEnabled = settings.getBoolean("notification_enabled", true);
	
	// On android 3.* AAC ADTS is not supported so we set the default encoder to AMR-NB, on android 4.* AAC is the default encoder
	audioEncoder = (Integer.parseInt(android.os.Build.VERSION.SDK)<14) ? SessionBuilder.AUDIO_AMRNB : SessionBuilder.AUDIO_AAC;
	audioEncoder = Integer.parseInt(settings.getString("audio_encoder", String.valueOf(audioEncoder)));
	videoEncoder = Integer.parseInt(settings.getString("video_encoder", String.valueOf(videoEncoder)));

	// Read video quality settings from the preferences 
	videoQuality = VideoQuality.merge(
			new VideoQuality(
					settings.getInt("video_resX", 0),
					settings.getInt("video_resY", 0), 
					Integer.parseInt(settings.getString("video_framerate", "0")), 
					Integer.parseInt(settings.getString("video_bitrate", "0"))*1000),
					videoQuality);

	SessionBuilder.getInstance() 
	.setContext(getApplicationContext())
	.setAudioEncoder(!settings.getBoolean("stream_audio", true)?0:audioEncoder)
	.setVideoEncoder(!settings.getBoolean("stream_video", false)?0:videoEncoder)
	.setHeartEncoder(!settings.getBoolean("stream_heartrate", false)?0:heartRateEncoder)
	.setVideoQuality(videoQuality);

	// Listens to changes of preferences
	settings.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener);

	registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
	
}
 
开发者ID:jamesrdelaney,项目名称:ecg_over_rtp,代码行数:43,代码来源:SpydroidApplication.java

示例12: setVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的package包/类
/** Sets the video stream quality. */
public SessionBuilder setVideoQuality(VideoQuality quality) {
	mVideoQuality = VideoQuality.merge(quality, mVideoQuality);
	return this;
}
 
开发者ID:jamesrdelaney,项目名称:ecg_over_rtp,代码行数:6,代码来源:SessionBuilder.java

示例13: setVideoQuality

import net.majorkernelpanic.streaming.video.VideoQuality; //导入依赖的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 setVideoQuality(VideoQuality quality) {
	if (mVideoStream != null) {
		mVideoStream.setVideoQuality(quality);
	}
}
 
开发者ID:hypeapps,项目名称:Endoscope,代码行数:12,代码来源:Session.java


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