Validate input dimensions in process()

Input dimensions are checked for supported range in set_dimensions
control call. Encoder returns an error for unsupported values in
this control call. But if the caller ignores this error and proceeds
to call process(), encoder wasn't checking the dimensions again.

Unsupported dimensions are now checked in process() call as well.

Note: This is relanding previously reverted commit
06c30b33c400afcf175916dea34f8b09599b58e5

Bug: 172908358
Test: Poc in bug
Test: atest android.mediav2.cts
Test: atest android.media.cts
Change-Id: Icf3f296ab24432c680427a82da3505491acca3bd
1 file changed