I worked again on this point but I did not found a solution yet.
If I use GoCoder in an Activity (opened by main activity) or if I use GoCoder in a Fragment opened by main activity SDK config seems to be ok.
Theese are the logs:
mWZBroadcastConfig.getVideoSourceConfig().getVideoFrameHeight(): 480 mWZBroadcastConfig.getVideoSourceConfig().getVideoFrameWidth(): 640 mWZBroadcastConfig.getVideoFrameHeight(): 720 mWZBroadcastConfig.getVideoFrameWidth(): 1280 mWZBroadcastConfig.getVideoFrameSize().height: 720 mWZBroadcastConfig.getVideoFrameSize().width: 1280
mWZBroadcastConfig.getOrientationBehavior() = ORIENTATION_LANDSCAPE_INVERTED in both cases
mWZBroadcastConfig.getRotation = 0 in both cases
But I seen some other logs during the stream that show the strange behavior.
Activity
I/ExtendedACodec: [OMX.qcom.video.encoder.avc] configure, AMessage : AMessage(what = ‘conf’, target = 1) = { int32_t capture-rate = 30 int32_t color-format = 2130708361 int32_t i-frame-interval = 1 string mime = “video/avc” int32_t width = 1280 int32_t bitrate = 3750000 int32_t frame-rate = 30 int32_t height = 720 int32_t encoder = 1 }
D/WMSTransport: [00]: “@setDataFrame”, [01]: “onMetaData”, [02]: {“videocodecid”: “avc1”, “width”: 1280, “height”: 720, “frameWidth”: 1280, “frameHeight”: 720, “displayWidth”: 1280, “displayHeight”: 720, “framerate”: 30, “videodatarate”: 3662, “audiocodecid”: “mp4a”, “audiosamplerate”: 44100, “audiochannels”: 2, “audiodatarate”: 62, “aacaot”: 2}
Fragment
I/ExtendedACodec: [OMX.qcom.video.encoder.avc] configure, AMessage : AMessage(what = ‘conf’, target = 1) = { int32_t capture-rate = 30 int32_t color-format = 2130708361 int32_t i-frame-interval = 1 string mime = “video/avc” int32_t width = 720 int32_t bitrate = 3750000 int32_t frame-rate = 30 int32_t height = 1280 int32_t encoder = 1 }
D/WMSTransport: [00]: “@setDataFrame”, [01]: “onMetaData”, [02]: {“videocodecid”: “avc1”, “width”: 720, “height”: 1280, “frameWidth”: 720, “frameHeight”: 1280, “displayWidth”: 720, “displayHeight”: 1280, “framerate”: 30, “videodatarate”: 3662, “audiocodecid”: “mp4a”, “audiosamplerate”: 44100, “audiochannels”: 2, “audiodatarate”: 62, “aacaot”: 2}
In the fragment’s logs width and height are inverted
MainActivity and GoCoder Activity extend both AppCompatActivity
This is how I manage the orientation in the fragment
@Overridepublic void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated( savedInstanceState );
getActivity().setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE );
((AppCompatActivity) getActivity()).getSupportActionBar().hide();
}