资源简介
通过LocalSocket 采集视频,打包h264视频rtsp传输,安卓手机为服务端,可以通过其他可以播放rtsp流的播放器播放,例如VLC。
代码片段和文件信息
/*
* Copyright (C) 2011-2012 GUIGUI Simon fyhertz@gmail.com
*
* This file is part of Spydroid (http://code.google.com/p/spydroid-ipcamera/)
*
* Spydroid is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License or
* (at your option) any later version.
*
* This source code is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code; if not write to the Free Software
* Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*/
package net.majorkernelpanic.http;
import static net.majorkernelpanic.http.TinyHttpServer.TAG;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URLDecoder;
import java.util.Date;
import java.util.Locale;
import org.apache.http.HttpEntity;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.MethodNotSupportedException;
import org.apache.http.entity.AbstractHttpEntity;
import org.apache.http.entity.ContentProducer;
import org.apache.http.entity.EntityTemplate;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.cookie.DateParseException;
import org.apache.http.impl.cookie.DateUtils;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpRequestHandler;
import org.apache.http.util.EntityUtils;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.util.Log;
/**
*
* Serves the content of assets/www
*
*/
public class ModAssetServer implements HttpRequestHandler {
public static final String PATTERN = “*“;
/** The list of MIME Media Types supported by the server. */
public static String[] mimeMediaTypes = new String[] {
“htm“ “text/html“
“html“ “text/html“
“gif“ “image/gif“
“jpg“ “image/jpeg“
“png“ “image/png“
“js“ “text/javascript“
“json“ “text/json“
“css“ “text/css“
};
private final TinyHttpServer mServer;
private final AssetManager mAssetManager;
public ModAssetServer(TinyHttpServer server) {
super();
mServer = server;
mAssetManager = mServer.mContext.getAssets();
}
public void handle(
final HttpRequest request
final HttpResponse response
final HttpContext context) throws HttpException IOException {
AbstractHttpEntity body
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\
文件 536 2014-04-24 23:15 spydroid-ipcamera-master\.classpath
文件 135 2014-04-24 23:15 spydroid-ipcamera-master\.gitignore
文件 811 2014-04-24 23:15 spydroid-ipcamera-master\.project
文件 2329 2014-04-24 23:15 spydroid-ipcamera-master\AndroidManifest.xm
文件 35147 2014-04-24 23:15 spydroid-ipcamera-master\LICENSE
文件 2955 2014-04-24 23:15 spydroid-ipcamera-master\README.md
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\assets\
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\
文件 3974 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\credits.htm
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\fonts\
文件 19744 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\fonts\bangers.eot
文件 21512 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\fonts\bangers.woff
文件 71816 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\fonts\sunshiney.eot
文件 81948 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\fonts\sunshiney.woff
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\
文件 1494 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\blue-button.png
文件 14893 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\camera.png
文件 18292 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\eye.png
文件 45314 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\facebook.png
文件 60567 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\install.jpg
文件 16120 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\lamp.png
文件 1554 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\phone.png
文件 6508 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\quote.png
文件 1527 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\red-button.png
文件 27344 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\speaker.png
文件 11038 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\images\spydroid.png
文件 9840 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\index.htm
目录 0 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\js\
文件 381 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\js\ie.js
文件 92630 2014-04-24 23:15 spydroid-ipcamera-master\assets\www\js\jquery-1.9.1.min.js
............此处省略154个文件信息
- 上一篇:Android备忘录系统
- 下一篇:疯狂java新浪微博代码
相关资源
- Android备忘录系统
- Android百度地图应用
- Android富文本编辑器源码
- android项目模板
- 《精通 Android 3》源代码/《Pro Android
- Android高仿订票系统
- Android下拉菜单控件
- Android手机课表开发完整版
- android蓝牙apk控制蓝牙小车
- 通过Android客户端访问web服务器,实现
- android-platform-tools-28.0.1
- Android显示GIF图片
- android简易浏览器
- android studio 简单获取天气案例
- 优博讯最新Android安卓SDK资源包V3,含
- 组建化封装思想试战AndroidApp源码
- android 个人股票源码
- Android SearchView和ListView结合使用Demo
- Android 小项目开发大全
- Android图书管理系统带服务端完整版
- android 仿微信聊天界面,以及语音录制
- 基于android手机短信管理系统设计
- android图片剪切
- Android游戏2048源代码
- android手机导航系统毕业设计
- android 日历+日程+日记
- Android拍照和获取相册图片demo
- Android自定义View实现类似水波扩散效果
- android版植物大战僵尸项目的源代码
- Android之Service AIDL 远程服务 实现比较
评论
共有 条评论