Closed lgorse closed 9 years ago
The current broadcast configuration breaks if the user does not input a resolution (setWidth/setHeight).
This is because un-instantiated ints such as:
public class BroadcastConfig { private int width; private int height;
return 0 rather than null.
Check out this test:
public class MainActivity extends ActionBarActivity { private int testnum; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i("TEST A NUM", String.valueOf(testnum)); } }
This causes an error in BroadcastActivity when the activity tries to get the width and height as extras with default -1:
if (extras != null) { outputString = extras.getString("PUBLISH_URL"); width = extras.getInt("WIDTH", -1); height = extras.getInt("HEIGHT", -1); orientation = extras.getString("ORIENTATION"); this.requestedCamera = extras.getString("CAMERA");
because the value never reaches default of -1, since default of un-instantiated int is 0.
I'll set up a fix and send you a PR.
Resolved by #6.
The current broadcast configuration breaks if the user does not input a resolution (setWidth/setHeight).
This is because un-instantiated ints such as:
return 0 rather than null.
Check out this test:
This causes an error in BroadcastActivity when the activity tries to get the width and height as extras with default -1:
because the value never reaches default of -1, since default of un-instantiated int is 0.
I'll set up a fix and send you a PR.