Wowza Community

Custom camera preview size

Part of layout from sample app (activity_camera.xml):

<FrameLayout
        android:id="@+id/cameraView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#0d0d0d">
        <com.wowza.gocoder.sdk.api.devices.WZCameraView
            android:id="@+id/cameraPreview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            wowza:defaultCamera="back"
            wowza:frameSizePreset="frameSize1280x720"
            wowza:scaleMode="fill" />
</FrameLayout>

and in this case all works right, ok…

but I need to set custom camera preview size.

If I set size of WZCameraView to

android:layout_width="90dp"
android:layout_height="120dp"

then I got error:

W/b: a was in an unexpected state. Expected: READY, Actual: IDLE
E/b: A broadcast component reported the following error during the START_BROADCAST transition
                                                                 severity                  : ERROR
                                                                 error class               : WZStreamingError
                                                                 error code                : 33
                                                                 description               : A session component was in an invalid transition state
W/WZBroadcast: Ending the broadcast session due to an error that occurred during the READY to RUNNING transition
W/b: a was not running at broadcast teardown. It was in a IDLE state

this error may be workarounded - I can set size for “@+id/cameraView” (parent FrameLayout), not “@+id/cameraPreview”. But this works only in sample app.

In my real application with custom layout I still get “invalid transition state” error.

Is there any way to use WZCameraView with custom size and in “not-sample-app-like” layouts?

I spent half day, and found that:

this works:

<RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <FrameLayout
            android:id="@+id/cameraView"
            android:layout_width="90dp"
            android:layout_height="120dp"
            android:layout_gravity="center"
            android:background="#0d0d0d">
            <com.wowza.gocoder.sdk.api.devices.WZCameraView
                android:id="@+id/cameraPreview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                wowza:defaultCamera="back"
                wowza:frameSizePreset="frameSize1280x720"
                wowza:scaleMode="fill" />
        </FrameLayout>
    </RelativeLayout>

and this - not:

<FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <FrameLayout
            android:id="@+id/cameraView"
            android:layout_width="90dp"
            android:layout_height="120dp"
            android:layout_gravity="center"
            android:background="#0d0d0d">
            <com.wowza.gocoder.sdk.api.devices.WZCameraView
                android:id="@+id/cameraPreview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                wowza:defaultCamera="back"
                wowza:frameSizePreset="frameSize1280x720"
                wowza:scaleMode="fill" />
        </FrameLayout>
    </FrameLayout>

Is this issue resolved? If not I would suggest opening a support ticket, or possibly seeking aid from a Wowza endorsed consultant.

To open a ticket, please follow these steps

To request a consultant please post to the find a consultant forum

Regards,

Salvadore

works well with last version (1.0.0.177)