Open camera after connection and encoder enabled

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 8 years ago
parent 3e0874b080
commit da863658e3

@ -25,6 +25,6 @@ android {
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:appcompat-v7:25.1.1'
compile project(path: ':library') compile project(path: ':library')
} }

@ -84,8 +84,8 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
editor.putString("rtmpUrl", rtmpUrl); editor.putString("rtmpUrl", rtmpUrl);
editor.apply(); editor.apply();
mPublisher.startCamera();
mPublisher.startPublish(rtmpUrl); mPublisher.startPublish(rtmpUrl);
mPublisher.startCamera();
if (btnSwitchEncoder.getText().toString().contentEquals("soft encoder")) { if (btnSwitchEncoder.getText().toString().contentEquals("soft encoder")) {
Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show();
@ -243,8 +243,8 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
btnRecord.setText("record"); btnRecord.setText("record");
mPublisher.setScreenOrientation(newConfig.orientation); mPublisher.setScreenOrientation(newConfig.orientation);
if (btnPublish.getText().toString().contentEquals("stop")) { if (btnPublish.getText().toString().contentEquals("stop")) {
mPublisher.startCamera();
mPublisher.startEncode(); mPublisher.startEncode();
mPublisher.startCamera();
} }
} }

@ -28,6 +28,6 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

Loading…
Cancel
Save