v4l2_codec2: Ignore unsupported controls in V4L2EncodeComponent.

The virtio driver doesn't support all of the controls currently used by
the V4L2EncodeComponent. As these controls are not essential for the
correct functioning of the encoder, this CL makes changes to treat
these unsupported controls as warnings rather than errors.

Bug: 143333813
Test: tast run $HOST arc.VideoEncodeAccel.h264_vm on rammus
Change-Id: I7961c1e95c807de1d4df064fb869c01ba793f2c4
diff --git a/components/V4L2EncodeComponent.cpp b/components/V4L2EncodeComponent.cpp
index 164d16c..2f603bd 100644
--- a/components/V4L2EncodeComponent.cpp
+++ b/components/V4L2EncodeComponent.cpp
@@ -791,8 +791,9 @@
     // Enable frame-level bitrate control. This is the only mandatory general control.
     if (!mDevice->SetExtCtrls(V4L2_CTRL_CLASS_MPEG,
                               {media::V4L2ExtCtrl(V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE, 1)})) {
-        ALOGE("Failed enabling bitrate control");
-        return false;
+        ALOGW("Failed enabling bitrate control");
+        // TODO(b/161508368): V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE is currently not supported yet,
+        // assume the operation was successful for now.
     }
 
     // Additional optional controls:
@@ -877,9 +878,9 @@
         ALOGV("Setting bitrate to %u", bitrate);
         if (!mDevice->SetExtCtrls(V4L2_CTRL_CLASS_MPEG,
                                   {media::V4L2ExtCtrl(V4L2_CID_MPEG_VIDEO_BITRATE, bitrate)})) {
-            ALOGE("Requesting bitrate change failed");
-            reportError(C2_CORRUPTED);
-            return false;
+            // TODO(b/161495749): V4L2_CID_MPEG_VIDEO_BITRATE is currently not supported yet, assume
+            // the operation was successful for now.
+            ALOGW("Requesting bitrate change failed");
         }
         mBitrate = bitrate;
     }
@@ -896,9 +897,9 @@
         parms.parm.output.timeperframe.numerator = 1;
         parms.parm.output.timeperframe.denominator = framerate;
         if (mDevice->Ioctl(VIDIOC_S_PARM, &parms) != 0) {
-            ALOGE("Requesting framerate change failed");
-            reportError(C2_CORRUPTED);
-            return false;
+            // TODO(b/161499573): VIDIOC_S_PARM is currently not supported yet, assume the operation
+            // was successful for now.
+            ALOGW("Requesting framerate change failed");
         }
         mFramerate = framerate;
     }
@@ -928,9 +929,9 @@
     if (mKeyFrameCounter == 0) {
         if (!mDevice->SetExtCtrls(V4L2_CTRL_CLASS_MPEG,
                                   {media::V4L2ExtCtrl(V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME)})) {
-            ALOGE("Failed requesting key frame");
-            reportError(C2_CORRUPTED);
-            return false;
+            // TODO(b/161498590): V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME is currently not supported
+            // yet, assume the operation was successful for now.
+            ALOGW("Failed requesting key frame");
         }
     }