package net.ossrs.rtmp;

import com.github.faucamp.simplertmp.RtmpHandler;

import java.io.IOException;
import java.net.SocketException;

/**
 * Created by pedro on 21/01/17.
 */

public class SrsCreator {

    private SrsFlvMuxer srsFlvMuxer = new SrsFlvMuxer(new RtmpHandler(new RtmpHandler.RtmpListener() {
        @Override
        public void onRtmpConnecting(String msg) {

        }

        @Override
        public void onRtmpConnected(String msg) {

        }

        @Override
        public void onRtmpVideoStreaming() {

        }

        @Override
        public void onRtmpAudioStreaming() {

        }

        @Override
        public void onRtmpStopped() {

        }

        @Override
        public void onRtmpDisconnected() {

        }

        @Override
        public void onRtmpVideoFpsChanged(double fps) {

        }

        @Override
        public void onRtmpVideoBitrateChanged(double bitrate) {

        }

        @Override
        public void onRtmpAudioBitrateChanged(double bitrate) {

        }

        @Override
        public void onRtmpSocketException(SocketException e) {

        }

        @Override
        public void onRtmpIOException(IOException e) {

        }

        @Override
        public void onRtmpIllegalArgumentException(IllegalArgumentException e) {

        }

        @Override
        public void onRtmpIllegalStateException(IllegalStateException e) {

        }
    }));

    private SrsMp4Muxer srsMp4Muxer = new SrsMp4Muxer(new SrsRecordHandler(new SrsRecordHandler.SrsRecordListener() {
        @Override
        public void onRecordPause() {

        }

        @Override
        public void onRecordResume() {

        }

        @Override
        public void onRecordStarted(String msg) {

        }

        @Override
        public void onRecordFinished(String msg) {

        }

        @Override
        public void onRecordIllegalArgumentException(IllegalArgumentException e) {

        }

        @Override
        public void onRecordIOException(IOException e) {

        }
    }));

    public SrsFlvMuxer getSrsFlvMuxer() {
        return srsFlvMuxer;
    }

    public SrsMp4Muxer getSrsMp4Muxer() {
        return srsMp4Muxer;
    }
}

@@ -18,16 +18,42 @@
 .rtmp;%0A%0A
+import android.util.Log;%0A%0A
 import c
@@ -94,16 +94,16 @@
 andler;%0A
-
 %0Aimport 
@@ -222,24 +222,63 @@
 sCreator %7B%0A%0A
+    private String TAG = %22SrsCreator%22;%0A
     private 
@@ -429,33 +429,61 @@
 g(String msg) %7B%0A
+            Log.i(TAG, msg);
 %0A
-
         %7D%0A%0A     
@@ -537,33 +537,61 @@
 d(String msg) %7B%0A
+            Log.i(TAG, msg);
 %0A
-
         %7D%0A%0A     
@@ -787,25 +787,64 @@
 Stopped() %7B%0A
+            Log.i(TAG, %22rtmp stopped%22);
 %0A
-
         %7D%0A%0A 
@@ -899,25 +899,69 @@
 nnected() %7B%0A
+            Log.i(TAG, %22rtmp disconnected%22);
 %0A
-
         %7D%0A%0A 
@@ -1306,33 +1306,72 @@
 tException e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A
-
         %7D%0A%0A     
@@ -1430,33 +1430,72 @@
 OException e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A
-
         %7D%0A%0A     
@@ -1580,33 +1580,72 @@
 tException e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A
-
         %7D%0A%0A     
@@ -1724,33 +1724,72 @@
 eException e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A
-
         %7D%0A    %7D)
@@ -2301,33 +2301,72 @@
 tException e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A
-
         %7D%0A%0A     
@@ -2431,24 +2431,63 @@
 eption e) %7B%0A
+            Log.e(TAG, e.getMessage());
 %0A        %7D%0A 

add log to SrsCreator