xuxiuxi
2017-05-15 6d25cbae7fd9bd66ed79c6de7c77d78e309da6ed


git-svn-id: http://192.168.1.226/svn/proxy@634 454eff88-639b-444f-9e54-f578c98de674
2个文件已修改
71 ■■■■ 已修改文件
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/SurveillanceFragment.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/res/layout/fragment_surveillance.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/SurveillanceFragment.java
@@ -5,8 +5,10 @@
import android.os.Build;
import android.os.Bundle;
import android.text.format.Formatter;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
@@ -16,6 +18,7 @@
import cn.com.basic.face.base.BaseFragment;
import cn.com.basic.face.base.MainActivity;
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.service.DeviceMng;
import cn.com.basic.face.util.RtspFaceNative;
@@ -50,13 +53,17 @@
    @ViewInject(R.id.fragment_supervisory_bottom_attendance_list_view)
    private SurveillanceBottomAttendanceListView fragment_supervisory_bottom_attendance_list_view;
    @ViewInject(R.id.fragment_supervisory_enter_camera)
    SurfaceView fragment_supervisory_enter_camera;
    private SurfaceView fragment_supervisory_enter_camera;
    @ViewInject(R.id.fragment_supervisory_exit_camera)
    SurfaceView fragment_supervisory_exit_camera;
    private SurfaceView fragment_supervisory_exit_camera;
    @ViewInject(R.id.fragment_surveillance_enter_timer)
    private TextView fragment_surveillance_enter_timer;
    @ViewInject(R.id.fragment_surveillance_exit_timer)
    private TextView fragment_surveillance_exit_timer;
    @ViewInject(R.id.fragment_supervisory_enter_progress_bar)
    private ProgressBar fragment_supervisory_enter_progress_bar;
    @ViewInject(R.id.fragment_supervisory_exit_progress_bar)
    private ProgressBar fragment_supervisory_exit_progress_bar;
    static boolean useNative = false;
@@ -116,6 +123,44 @@
    @Override
    protected void initViews(View view, Bundle savedInstanceState) {
        fragment_supervisory_enter_camera.getHolder().addCallback(new SurfaceHolder.Callback() {
            @Override
            public void surfaceCreated(SurfaceHolder holder) {
                fragment_supervisory_enter_progress_bar.setVisibility(View.INVISIBLE);
                RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.IN), fragment_supervisory_enter_camera.getHolder().getSurface());
                RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.IN), DeviceMng.getInstance().getCamera1Address());
                RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.IN), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
            }
            @Override
            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
            }
            @Override
            public void surfaceDestroyed(SurfaceHolder holder) {
                //fragment_supervisory_enter_progress_bar.setVisibility(View.VISIBLE);
            }
        });
        fragment_supervisory_exit_camera.getHolder().addCallback(new SurfaceHolder.Callback() {
            @Override
            public void surfaceCreated(SurfaceHolder holder) {
                fragment_supervisory_exit_progress_bar.setVisibility(View.INVISIBLE);
                RtspFaceNative.setSurface(Integer.parseInt(CommonVariables.Camera.OUT), fragment_supervisory_exit_camera.getHolder().getSurface());
                RtspFaceNative.createPlayer(Integer.parseInt(CommonVariables.Camera.OUT), DeviceMng.getInstance().getCamera2Address());
                RtspFaceNative.setFaceCallback(Integer.parseInt(CommonVariables.Camera.OUT), "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
            }
            @Override
            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
            }
            @Override
            public void surfaceDestroyed(SurfaceHolder holder) {
                //fragment_supervisory_exit_progress_bar.setVisibility(View.VISIBLE);
            }
        });
        new Thread(new Runnable() {
            @Override
            public void run() {
@@ -135,12 +180,7 @@
                                } catch (Exception e) {
                                    e.printStackTrace();
                                }
                                RtspFaceNative.setSurface(1, fragment_supervisory_enter_camera.getHolder().getSurface());
                                RtspFaceNative.setSurface(2, fragment_supervisory_exit_camera.getHolder().getSurface());
                                RtspFaceNative.createPlayer(1, DeviceMng.getInstance().getCamera1Address());
                                RtspFaceNative.createPlayer(2, DeviceMng.getInstance().getCamera2Address());
                                RtspFaceNative.setFaceCallback(1, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
                                RtspFaceNative.setFaceCallback(2, "cn/com/basic/face/util/RtspFaceNative", "faceCallBack");
                            }
                            public String convertStreamToString(InputStream is) throws Exception {
                                BufferedReader reader = new BufferedReader(new InputStreamReader(is));
VisitFace/DemoForBsk/app/src/main/res/layout/fragment_surveillance.xml
@@ -73,8 +73,14 @@
                    android:text="摄像机进"
                    android:layout_marginRight="@dimen/w122dp"/>
            </RelativeLayout>
            <ProgressBar
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:visibility="invisible"
                android:id="@+id/fragment_supervisory_enter_progress_bar"
                />
        </RelativeLayout>
        <RelativeLayout
            android:layout_width="@dimen/view_size_0"
            android:layout_height="match_parent"
@@ -115,6 +121,13 @@
                    android:text="摄像机出"
                    android:layout_marginRight="@dimen/w12dp"/>
            </RelativeLayout>
            <ProgressBar
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:visibility="invisible"
                android:id="@+id/fragment_supervisory_exit_progress_bar"
                />
        </RelativeLayout>
    </LinearLayout>