本文整理汇总了Java中net.majorkernelpanic.streaming.rtsp.RtspServer类的典型用法代码示例。如果您正苦于以下问题:Java RtspServer类的具体用法?Java RtspServer怎么用?Java RtspServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RtspServer类属于net.majorkernelpanic.streaming.rtsp包,在下文中一共展示了RtspServer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的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
示例2: onError
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onError(RtspServer server, Exception e, int error) {
// We alert the user that the port is already used by another app.
if (error == RtspServer.ERROR_BIND_FAILED) {
new AlertDialog.Builder(SpydroidActivity.this)
.setTitle(R.string.port_used)
.setMessage(getString(R.string.bind_failed, "RTSP"))
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int id) {
startActivityForResult(new Intent(SpydroidActivity.this, OptionsActivity.class),0);
}
})
.show();
}
}
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:16,代码来源:SpydroidActivity.java
示例3: onMessage
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onMessage(RtspServer server, int message) {
if (message==RtspServer.MESSAGE_STREAMING_STARTED) {
if (mAdapter != null && mAdapter.getHandsetFragment() != null)
mAdapter.getHandsetFragment().update();
} else if (message==RtspServer.MESSAGE_STREAMING_STOPPED) {
if (mAdapter != null && mAdapter.getHandsetFragment() != null)
mAdapter.getHandsetFragment().update();
}
}
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:11,代码来源:SpydroidActivity.java
示例4: onServiceConnected
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mRtspServer = (RtspServer) ((RtspServer.LocalBinder)service).getService();
update();
}
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:6,代码来源:PreviewFragment.java
示例5: onServiceConnected
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mRtspServer = (CustomRtspServer) ((RtspServer.LocalBinder)service).getService();
mRtspServer.addCallbackListener(mRtspCallbackListener);
mRtspServer.start();
}
开发者ID:ghazi94,项目名称:Android_CCTV,代码行数:7,代码来源:SpydroidActivity.java
示例6: onError
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onError(RtspServer server, Exception e, int error) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(RTSP_SERVER_ERROR).append(error).append(" ").append(e.getMessage());
getView().logError(stringBuilder.toString());
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:7,代码来源:StartStreamPresenter.java
示例7: onMessage
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
@Override
public void onMessage(RtspServer server, int message) {
if (message == RTSP_STREAM_CONNECTING) getView().showStreamConnectingToast();
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:5,代码来源:StartStreamPresenter.java
示例8: startRtspServer
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
private void startRtspServer() {
rtspServer = new RtspServer();
rtspServer.addCallbackListener(this);
rtspServer.start();
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:6,代码来源:StartStreamPresenter.java
示例9: loadPortPreference
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
public String loadPortPreference() {
return settingsPreferences.getString(RtspServer.KEY_PORT, SHARED_PREF_DEFAULT_PORT);
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:4,代码来源:SettingsPreferencesUtil.java
示例10: savePortPreferencePreference
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
public void savePortPreferencePreference(String port) {
SharedPreferences.Editor editor = settingsPreferences.edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(port));
editor.apply();
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:6,代码来源:SettingsPreferencesUtil.java
示例11: onCreate
import net.majorkernelpanic.streaming.rtsp.RtspServer; //导入依赖的package包/类
/** Called with the activity is first created. */
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
// setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);
requestWindowFeature(Window.FEATURE_PROGRESS);
setScreenOnFlag();
setContentView(R.layout.video_camera);
// findViewById需要在setContentView之后,否则获得为null
ImageButton stopButton = (ImageButton) findViewById(R.id.camera_stop);
ImageButton switchButton = (ImageButton) findViewById(R.id.camera_switch);
ImageButton muteButton = (ImageButton) findViewById(R.id.camera_mute);
WindowManager windowManager = (WindowManager) this
.getSystemService(WINDOW_SERVICE);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
stopButton.setLayoutParams(new LinearLayout.LayoutParams(
screenWidth / 2, screenHeight / 10));
switchButton.setLayoutParams(new LinearLayout.LayoutParams(
screenWidth / 4, screenHeight / 10));
muteButton.setLayoutParams(new LinearLayout.LayoutParams(
screenWidth / 4, screenHeight / 10));
// mVideoPreview = (VideoPreview) findViewById(R.id.camera_preview);
// mVideoPreview.setAspectRatio(VIDEO_ASPECT_RATIO);
mSurfaceView = (SurfaceView)findViewById(R.id.camera_preview);
// don't set mSurfaceHolder here. We have it set ONLY within
// surfaceCreated / surfaceDestroyed, other parts of the code
// assume that when it is set, the surface is also set.
// SurfaceHolder holder = mVideoPreview.getHolder();
SurfaceHolder holder = mSurfaceView.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mRecordingTimeView = (TextView) findViewById(R.id.recording_time);
mFPS = (TextView) findViewById(R.id.fps);
mVideoFrame = (VideoView) findViewById(R.id.video_frame);
// Sets the port of the RTSP server to 1234
Editor editor = PreferenceManager.getDefaultSharedPreferences(this)
.edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(1234));
editor.commit();
// Configures the SessionBuilder
SessionBuilder.getInstance().setSurfaceView(mSurfaceView)
.setPreviewOrientation(90).setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setVideoEncoder(SessionBuilder.VIDEO_H264);
// Starts the RTSP server
this.startService(new Intent(this, RtspServer.class));
}
开发者ID:mnhkahn,项目名称:cInterphone,代码行数:62,代码来源:CameraDemo.java
注:本文中的net.majorkernelpanic.streaming.rtsp.RtspServer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论