Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 8 years ago
parent 283d52ef73
commit 4b67a0640f

@ -33,10 +33,10 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
private static final String TAG = "Yasea";
Button btnPublish = null;
Button btnSwitchCamera = null;
Button btnRecord = null;
Button btnSwitchEncoder = null;
private Button btnPublish;
private Button btnSwitchCamera;
private Button btnRecord;
private Button btnSwitchEncoder;
private SharedPreferences sp;
private String rtmpUrl = "rtmp://ossrs.net/" + getRandomAlphaString(3) + '/' + getRandomAlphaDigitString(5);

@ -401,7 +401,7 @@ public class SrsEncoder {
throw new UnsupportedOperationException("Not implemented");
//swRgbaFrame(data, width, height, pts);
} else {
byte[] processedData = hwYUVNV21FrameScale(data, width, height, boundingBox);
byte[] processedData = hwYUVNV21FrameScaled(data, width, height, boundingBox);
if (processedData != null) {
onProcessedYuvFrame(processedData, pts);
} else {
@ -429,7 +429,7 @@ public class SrsEncoder {
throw new UnsupportedOperationException("Not implemented");
//swArgbFrame(data, width, height, pts);
} else {
byte[] processedData = hwArgbaFrameScale(data, width, height, boundingBox);
byte[] processedData = hwArgbFrameScaled(data, width, height, boundingBox);
if (processedData != null) {
onProcessedYuvFrame(processedData, pts);
} else {
@ -457,7 +457,7 @@ public class SrsEncoder {
throw new UnsupportedOperationException("Not implemented");
//swArgbFrame(data, width, height, pts);
} else {
byte[] processedData = hwArgbaFrame(data, width, height);
byte[] processedData = hwArgbFrame(data, width, height);
if (processedData != null) {
onProcessedYuvFrame(processedData, pts);
} else {
@ -486,7 +486,7 @@ public class SrsEncoder {
}
}
private byte[] hwYUVNV21FrameScale(byte[] data, int width, int height, Rect boundingBox) {
private byte[] hwYUVNV21FrameScaled(byte[] data, int width, int height, Rect boundingBox) {
switch (mVideoColorFormat) {
case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar:
return NV21ToI420Scaled(data, width, height, true, 180, boundingBox.left, boundingBox.top, boundingBox.width(), boundingBox.height());
@ -497,7 +497,7 @@ public class SrsEncoder {
}
}
private byte[] hwArgbaFrameScale(int[] data, int width, int height, Rect boundingBox) {
private byte[] hwArgbFrameScaled(int[] data, int width, int height, Rect boundingBox) {
switch (mVideoColorFormat) {
case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar:
return ARGBToI420Scaled(data, width, height, false, 0, boundingBox.left, boundingBox.top, boundingBox.width(), boundingBox.height());
@ -508,7 +508,7 @@ public class SrsEncoder {
}
}
private byte[] hwArgbaFrame(int[] data, int inputWidth, int inputHeight) {
private byte[] hwArgbFrame(int[] data, int inputWidth, int inputHeight) {
switch (mVideoColorFormat) {
case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar:
return ARGBToI420(data, inputWidth, inputHeight, false, 0);

Loading…
Cancel
Save