|
|
|
@ -4,14 +4,14 @@ import android.media.MediaCodec;
|
|
|
|
|
import android.media.MediaFormat;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
|
|
import net.ossrs.sea.rtmp.RtmpPublisher;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
import net.ossrs.sea.rtmp.RtmpPublisher;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by winlin on 5/2/15.
|
|
|
|
|
* Updated by leoma on 4/1/16.
|
|
|
|
@ -74,7 +74,18 @@ public class SrsFlvMuxer {
|
|
|
|
|
* get cached video frame number in publisher
|
|
|
|
|
*/
|
|
|
|
|
public final AtomicInteger getVideoFrameCacheNumber() {
|
|
|
|
|
return publisher.getVideoFrameCacheNumber();
|
|
|
|
|
return publisher == null ? null : publisher.getVideoFrameCacheNumber();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* set video resolution for publisher
|
|
|
|
|
* @param width
|
|
|
|
|
* @param height
|
|
|
|
|
*/
|
|
|
|
|
public void setVideoResolution(int width, int height) {
|
|
|
|
|
if (publisher != null) {
|
|
|
|
|
publisher.setVideoResolution(width, height);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -134,9 +145,8 @@ public class SrsFlvMuxer {
|
|
|
|
|
/**
|
|
|
|
|
* start to the remote SRS for remux.
|
|
|
|
|
*/
|
|
|
|
|
public void start(String url, int width, int height) throws IOException {
|
|
|
|
|
public void start(String url) throws IOException {
|
|
|
|
|
rtmpUrl = url;
|
|
|
|
|
publisher.setVideoResolution(width, height);
|
|
|
|
|
|
|
|
|
|
worker = new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|