Skip to content

Commit a9d0ad4

Browse files
committed
v1.0.0
1 parent 02c893b commit a9d0ad4

3 files changed

Lines changed: 3 additions & 114 deletions

File tree

src/com/example/Integrity/IntegrityCheck.java

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,18 @@ public class IntegrityCheck {
1111
// single instance mode
1212
private static IntegrityCheck instance;
1313
private SparseArray<Segment> urlMap;
14-
//private SparseArray<Integer> idURIMap;
15-
//private static int idCount = -1;
16-
public static final String URL_TAG = "http://buptant.cn/autoChart/du/video/ljw2016/zxyqwe/download.php";
14+
public static final String URL_TAG =
15+
"http://buptant.cn/autoChart/du/video/ljw2016/zxyqwe/download.php";
1716
public static final String URI_TAG = "http://127.1.1.1:9999/";
18-
//private static final int TOTAL_SEGS = 5;
1917

2018
private CellularDown celluDown;
2119

2220
private IntegrityCheck() {
2321
urlMap = new SparseArray<Segment>();
24-
//idURIMap = new SparseArray<Integer>();
25-
//insertURLtoMaps(idURIMap);
2622
celluDown = new CellularDown();
2723
}
2824

29-
// private void insertURLtoMaps(SparseArray<Integer> idUri) {
30-
// for (int i = 1; i <= TOTAL_SEGS; i++) {
31-
// idUri.put(++idCount, Integer.valueOf(i));//URI_TAG + i + ".mp4");
32-
// Log.v("map", idUrl.get(0));
33-
// }
34-
//
35-
// }
25+
3626

3727
public static synchronized IntegrityCheck getInstance() {
3828
if (instance == null) {
@@ -77,31 +67,8 @@ private int uri2id(int uri) {
7767
// TODO Auto-generated method stub
7868
synchronized (this) {
7969
return uri;
80-
// int count = getIndex(uri);
81-
// boolean t = false;
82-
// int i = 0;
83-
// while (!t) {
84-
// if (i == TOTAL_SEGS) {
85-
// return -2;
86-
// }
87-
// t = idURIMap.get(i).intValue()==count;
88-
// i++;
89-
//
90-
// }
91-
// // return idURIMap.indexOfValue(uri);
92-
//return (--i);
9370
}
9471
}
95-
private int getIndex(String uri){
96-
String fileName = "";
97-
for (String s : uri.split("/")) {
98-
if (s.contains(".mp4")) {
99-
fileName = s;
100-
break;
101-
}
102-
}
103-
return Integer.parseInt(fileName.substring(0, 1));
104-
}
10572

10673
public void setSegLength(int id, int totalLength) {
10774
Segment s = urlMap.get(id);

src/com/example/celluar/CellularDown.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ public void run() {
4343
connection.setDoInput(true);
4444
connection.setRequestProperty("Accept-Encoding", "");
4545
connection.setDoOutput(true);
46-
// data need to be modified
47-
// String data = "filename=" + url
48-
// + ".mp4&sessionid=lykfr9oyqipf2q3tvy2l73bao216";
49-
// OutputStream out = connection.getOutputStream();
50-
// out.write(data.getBytes());
51-
// out.flush();
52-
// out.close();
5346
Log.d("ResponseCode",
5447
String.valueOf(connection.getResponseCode()));
5548

src/com/example/dashproxyserver/DashProxyServer.java

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public Response serve(IHTTPSession session) {
6969

7070
IntegrityCheck iTC = IntegrityCheck.getInstance();
7171

72-
//String tmpp = iTC.URI_TAG + playist;
7372
int tmpp = Integer.parseInt(playist.substring(0,1));
7473

7574
byte[] tmp = iTC.getSegments(tmpp);
@@ -84,76 +83,6 @@ public Response serve(IHTTPSession session) {
8483
}
8584
}
8685

87-
88-
89-
// switch(MainFragment.configureData.getWorkingMode()){
90-
// case ConfigureData.LOCAL_MODE:
91-
// try {
92-
// fis = new FileInputStream(Environment.getExternalStorageDirectory()
93-
// + "/video/4/"+playist);
94-
//
95-
// length=fis.available();
96-
//
97-
// } catch (Exception e) {
98-
// // TODO Auto-generated catch block
99-
// e.printStackTrace();
100-
// }
101-
// break;
102-
// case ConfigureData.G_MDOE:
103-
//
104-
// break;
105-
// case ConfigureData.COOPERATIVE_MODE:
106-
// break;
107-
// }
108-
109-
// try {
110-
// fis = new FileInputStream(Environment.getExternalStorageDirectory()
111-
// + "/video/4/"+playist);
112-
//
113-
// length=fis.available();
114-
//
115-
// } catch (Exception e) {
116-
// // TODO Auto-generated catch block
117-
// e.printStackTrace();
118-
// }
119-
120-
// return
121-
// newFixedLengthResponse(Response.Status.OK,"application/x-mpegurl",fis,length);
122-
123-
// }else if(!getFileName(session,".ts").equals("")){
124-
// String tsFile=getFileName(session,".ts");
125-
//
126-
// if(tsFile.equals("output107.ts")){
127-
// Log.v("DashProxy","sleep");
128-
// try {
129-
// Thread.sleep(3000);
130-
// } catch (InterruptedException e) {
131-
// e.printStackTrace();
132-
// }
133-
//
134-
//
135-
// }
136-
//
137-
//
138-
// try {
139-
// fis = new FileInputStream(Environment.getExternalStorageDirectory()
140-
// + "/dash/"+tsFile);
141-
//
142-
// length=fis.available();
143-
//
144-
// } catch (Exception e) {
145-
// // TODO Auto-generated catch block
146-
// e.printStackTrace();
147-
// }
148-
//
149-
// return
150-
// newFixedLengthResponse(Response.Status.OK,"video/mp2t",fis,length);
151-
//
152-
// }
153-
// else{
154-
//
155-
// return newFixedLengthResponse("Joke");
156-
// }
15786

15887
}
15988

0 commit comments

Comments
 (0)