- May 26, 2022
-
-
Jeffrey Kardatzke authored
This adds support for the HEVC/H265 codec to the Android codec2 V4L2 decode component. Bug: 215043150 Bug: 183217901 Test: ExoPlayer works with HEVC on guybrush w/ codecs added and corresponding ChromeOS CLs for crosvm/libvda Change-Id: I3707e9730d245871b74982527edfebe81b484e8a (cherry picked from commit 05bacef7fa53541f21c85f26f6f8351dcdfd7f0e)
-
- Nov 08, 2021
-
-
Roman Stratiienko authored
RaspberryPI codecs are allocated in the system at /dev/video{10-12}. Signed-off-by:
Roman Stratiienko <r.stratiienko@gmail.com> Change-Id: Ia95b3859b126c5a9054b75e3c6442827a055429b
-
- Oct 20, 2021
-
-
Chih-Yu Huang authored
Bug: None Test: mmm external/v4l2_codec2 Change-Id: I21d5d30ce32279dfb1cbe2b40d435d2e9707f5aa
-
David Staessens authored
The V4L2 encoder requests SPS and PPS NAL units to be prepended to IDR frames using the V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR control, to improve the resilience of the encoded video stream. When this control is not supported a warning is logged but no other steps are taken. This CL adds functionality to manually cache and preprend SPS and PPS NAL units to IDR frames when the above control is unsupported. BUG: 161495502 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I6b0906c4bdd46041f34eab7061e61f7b4a460fe2
-
David Staessens authored
The V4L2 encoder tries to extract SPS and PPS NAL units from H.264 video streams, as this information needs to be provided to the mediacodec framework. This CL makes a number of improvements to the extraction code: - Upon extraction a temporary buffer is allocated using the full size of the encoded frame. This is adjusted to only allocate enough data to hold the SPS and PPS NAL units. - The NAL parser currently parses the complete encoded frame data. The code is adjusted to stop parsing after both the SPS and PPS NAL units are found (which are typicaly located at the start of the frame). BUG: 161495502 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I89267727029b1317057d5475e41d7126c705c2c1
-
David Staessens authored
This CL adds support for the C2_PARAMKEY_BITRATE_MODE parameter to the v4l2 encoder. This parameter allows configuring the bitrate mode used to encode a video. The supported bitrate modes are: - C2Config::BITRATE_VARIABLE - C2Config::BITRATE_CONST Note: Currently the C2 framework does not support configuring the peak bitrate, which is used when the bitrate mode is set to VBR. Instead we set the peak bitrate to a multiple of the target bitrate. Note: Submit after support for V4L2_CID_MPEG_VIDEO_BITRATE_PEAK and V4L2_CID_MPEG_VIDEO_BITRATE_MODE has been added to the virto encoder in crrev.com/c/2944506. BUG: 190336806 BUG: 181514834 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I95d8f9921c1ba475ea8c65760d3c18e5e2818d5e
-
- Jun 30, 2021
-
-
Chih-Yu Huang authored
Currently, the Fourcc conversion function only accepts pixel format. However, the caller might pass codec fourcc like "H264" to the conversion function. Using ALOGE is too scary. This CL changes these log to ALOGV. Bug: 186838277 Test: mmm external/v4l2_codec2 Change-Id: I69f52bcbaa18af9b5f462f7eab5800df3e78a0dd (cherry picked from commit 5c0c5e4f0dc26ad3a3632934d6045460dcf56639)
-
- Jun 07, 2021
-
-
Chih-Yu Huang authored
SEQUENCE_CHECKER() macro does nothing when libchrome DCHECK flag is not enabled. We cannot use ALOG_ASSERT() for the checker variable. Also, we switched to Android ui::Rect class, which doesn't have Contains() method. This CL fixes these issues. Bug: 155138142 Test: mmm external/v4l2_codec2 with uncomment #define LOG_NDEBUG 0 Change-Id: I9960f5230166684c3b507e7b356833a1fb626fc6
-
David Staessens authored
This CL changes the color aspects H.264 NAL parser to use getBitsGraceful() when reading from the NALU, and check the result of bit operations. Reading from the NALU is currenlty safe and the bit reader never reads out-of-bounds, but an assert is thrown causing the StagefrightTest to abort rather than gracefully fail. Bug: 187402250 Test: arc.VideoDecodeAccel.* on hatch Change-Id: I6abb5f485e0a6f4fb8c46c8b74e895127e9107b5
-
- May 12, 2021
-
-
Kazuhiro Inaba authored
It looks like the codec name was lost in ag/13694191 accidentally. Bug: 186361543 Test: Run any CTS test and check MediaDeviceInfo.deviceinfo.json Change-Id: I3ed72bb3f6ea6eb88652aca778adb2fd3fe2049a
-
David Staessens authored
This CL removes the libv4l2_codec2_accel library now all files have been removed from the library, and updates dependent modules. Bug: 155138142 Test: m -j32 Change-Id: I45629ae702b12aedf9a6be256d955e702da8245d
-
David Staessens authored
This CL reworks the VideoPixelFormat class that was branched from Chrome: - Removed all Chrome-specific references from comments - Removed specific numbering as we don't need compatibility with Chrome - Removed deprecated formats - Adhere to the Android coding style. - Make use of Android logging mechanisms. - Make use of Android assert macros. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I8387af0b427ebc990ec6374432f18ad732894569
-
David Staessens authored
This CL Moves the VideoPixelFormat files to the common code folder. In a next step these files will be cleaned up and reworked into proper Android code, but splitting the move into a separate CL makes the review process a lot easier. Note: the "accel" folder is now empty, but the folder and Android.bp files will be cleaned up in a next CL so we can properly clean up all dependencies on the v4l2_accel module. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: Ia4708e5dbdd11223b9a2c445850b8c0cf6ee6d37
-
David Staessens authored
This CL reworks the Fourcc class that was branched from Chrome: - Adhere to the Android coding style. - Make use of Android logging mechanisms. - Make use of Android assert macros. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I0288d7e0ff94b378f6cbba61b15098caf738229c
-
David Staessens authored
This CL Moves the Fourcc files to the common code folder. In a next step these files will be cleaned up and reworked into proper Android code, but splitting the move into a separate CL makes the review process a lot easier. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I8d04b8538187c157f052dcd200f349313a64c7c6
-
David Staessens authored
This CL removes all uses of the media::ColorPlaneFormat and media::VideoFrameLayout types that were copied from Chrome. All uses of ColorPlaneFormat are changed to the VideoFramePlane type in Common.h. To replace the Chrome VideoFrameLayout a much simpler type was introduced in Common.h. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: If601718351b7dd328bda65036b1a0525f8b7e0fb
-
David Staessens authored
After the recent cleanup operations the only code left in the VideoFrame class are helper functions directly related to the VideoPixelFormat. This CL merges all these helpers into video_pixel_format.h. Additionally a helper in the VideoFrameLayout class is also moved to the video_pixel_format.h, so all VideoPixelFormat-related helpers are in one place. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I76699ecf69eb90fe890c1c272db058938b68062b
-
David Staessens authored
This CL changes all uses of the media::VideoCodecProfile type that was copied from Chrome to their respective C2 profile counterparts. This removes the additional conversion between C2 profiles, VideoCodecProfile and V4L2 profiles. The video_codecs.h/cc files are removed. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I0df03215e51def6379c468a4c189104d5fbde0e9
-
David Staessens authored
This CL changes the V4L2 encoder component to use the newly introduced C2Config::PROFILE_VP8_0 profile. This profile was initially not present, complicating code dealing with VP8. Note: Submit after ag/13976507 Bug: 155138142 Test: arc.VideoEncodeAccel.vp8_192p_i420_vm Change-Id: I4256a4871221d3f417b5f1a003cc9fcfdb3dcd0e
-
David Staessens authored
This CL changes the overflow check that's used when calculating a video's area in getArea() to use base::CheckedNumeric, as the current check is depending on undefined behavior. Bug: 155138142 Test: arc.VideoDecodeAccel.h264_vm Change-Id: I1b702c663ed7d99b1199ce743196bab64302dfc3
-
David Staessens authored
This CL removes all uses of the media::VideoCodec type that was copied from Chrome, in favor of the VideoCodec definition in common/VideoTypes.h. The media::VideoCodec type is removed. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I9a936bd54bc4232dfb5af016073c8cf8cc86077c
-
David Staessens authored
This CL changes the V4L2 decoder and encoder to use the Android Size structure instead of the one copied from Chrome, the Chrome size.h file is removed. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm arc.VideoDecodeAccel.h264_vm Change-Id: I8f63e847d8cf4ffd33621706287a44c93a4864fd
-
David Staessens authored
This CL changes the V4L2 decoder and encoder to use the Android rect structure instead of the one copied from Chrome, the Chrome rect.h file is removed. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm arc.VideoDecodeAccel.h264_vm Change-Id: Ie581deee6b4b43a27c45e48269a6902526727933
-
David Staessens authored
This CL cleans up the video_encode_accelerator.h/cc and video_decode_accelerator.h/cc files. These files were copied from Chrome to help with the development of the V4L2 encoder and decoder, but most off their functionality has already been removed in a previous CL. The remaining functionality is integrated into the V4L2Device so these files can be removed now. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I4591e3d03f5ebc6d568cc718ccde5df05af37b36
-
David Staessens authored
This CL reworks the V4L2 device and V4L2 device poller code that was branched from their Chrome counterparts: - Adhere to the Android coding style. - Make use of Android logging mechanisms. - Make use of Android assert macros. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I4842624e7fae9fc3f52d90dc90a5e7c026c63513
-
David Staessens authored
This CL removes leftover code related to V4L2 requests from the V4L2 device, as it's currently not functional nor used. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I98702a74778e84f1aec00f8f216c9c4f1c16c261
-
David Staessens authored
This CL removes leftover code related to image processor support and JPEG encoding/decoding from the V4L2 device, as it's currently not used. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I34fe7819e78b93a9a9d33e4888e56aba5f9826cb
-
David Staessens authored
This CL performs a small bit of cleanup by removing an unused member variable from the V4L2 device. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I3ef7c7fd28db30137ca7b4e1a52c031e6dcc0591
-
David Staessens authored
This CL merges the V4L2Device and GenericV4L2Device code. The code was copied from Chrome where multiple device types are possible, but in Android we only have a single implementation. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I16ee2af26f5dd89cdc44c83170b8be74baaec186
-
David Staessens authored
This CL performs minor cleanup and removes a few unused defines from the V4L2 device. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I8d486775f3e1b8618f6a82dd02932892f143a17a
-
David Staessens authored
This CL Move the V4L2 device and V4L2 device poller files to the common code folder. In a next step these files will be cleaned up and reworked into proper Android code, but splitting the move into a separate CL makes the review process a lot easier. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I4c4c9d7f5c7e85feed10ed1e3fd9b8fa14ca67ae
-
David Staessens authored
This CL expands the simple NALParser to support parsing color aspects from the SPS NAL unit. The V4L2 decode component is adapted to use this new NALParser rather than the Chrome parser. This allows us to remove the Chrome H.264 parser and its associated dependencies in a subsequent CL, removing a lot of code. Bug: 155138142 Test: arc.VideoDecodeAccel.* and arc.VideoDecodeAccelPerf.* on hatch Change-Id: Icbfa63478980ab2b2d1bf2d46697359a0ac92937
-
David Staessens authored
This CL moves the simple NALParser to a dedicated file. The parser will be expanded in a subsequent CL so moving the code in a separate CL will make it easier to distinguish newly made changes. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I9691de7e610a4c9881c29dbdc337ae9d01668145
-
David Staessens authored
This CL cleans up a few unused includes in the encode helpers. Bug: 155138142 Test: arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I41edd1d95b92410d8bb143ebb2d2da26eef0c01e
-
- Mar 15, 2021
-
-
David Staessens authored
This CL adds support for the VP8 and VP9 codecs to the Android codec2 V4L2 encode component. note: VP8 is currently disabled on most Intel devices due to b/158655609 Bug: 155138243 Test: tast run DUT arc.VideoEncodeAccel.vp8_1080p_i420 on hatch tast run DUT arc.VideoEncodeAccel.vp9_1080p_i420 on rammus Change-Id: Ic3d58d711633b4ffb481813b3016d7c369a9f8f0
-
- Feb 13, 2021
-
-
Bob Badour authored
Added SPDX-license-identifier-BSD to: accel/Android.bp common/Android.bp components/Android.bp plugin_store/Android.bp service/Android.bp store/Android.bp tests/c2_comp_intf/Android.bp Added SPDX-license-identifier-BSD legacy_unencumbered to: Android.bp tests/c2_e2e_test/jni/Android.mk Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I4ef032a3849d650e13761a868b45309275d408a2
-
- Jan 12, 2021
-
-
David Staessens authored
The H.264 levels currently requested by the C2 V4L2 encoder are H.264 IDC levels rather than the required V4L2 levels. This CL changes the encoder to request the correct levels. Bug: 174967472 Test: android.media.cts.MediaRecorderTest#testProfileAvcBaselineLevel1 Change-Id: Ic05a919a4f8a8dd1d0b0acc6577951c88c229469
-
David Stevens authored
On ARCVM, using no SW flags when locking a buffer causes it to return the host buffer stride/offsets. This isn't what is desirable here, as the buffer dimensions here are used for validation of the guest buffer within the guest kernel. To get the guest stride/offsets, we need to pass SW flags when locking the buffer. Note that crosvm switches to using the host stride/offsets before passing the buffers to libvda. Bug: 173667442 Test: android.media.cts.VideoEncoderTest#testOtherH264SurfArbitraryW Change-Id: I1c87a12179fd3ed3f17c0414f7266506746a96b9
-
David Stevens authored
InputBufferManager notifies the codec2 framework when the component no longer has any references to an input buffer. While a dedicated release notification is necessary in some circumstances, the release can usually be done when the corresponding work item is completed, to reduce the amount of IPC. This change sets the notification interval used by InputBufferManager to reduce how often a dedicated release notification is sent. Bug: 172184040 Test: tast run DUT arc.VideoDecodeAccel.vp8_vm Change-Id: Id6371d328bb00730b50d3b3075eccf4010554f27
-
- Aug 31, 2020
-
-
David Staessens authored
This CL removes the duplicate HalPixelFormat and InputCodec types in common.h that are also present in VideoTypes.h. VideoTypes.h is moved to the common/ folder so it can also be used by other classes. note: Submit together with ag/12467730 Bug: 143333813 Test: tast run $HOST arc.VideoEncodeAccel.h264_vm on hatch-arc-r Change-Id: I93bca14a3b2f0c4c49104149d5683193554ba3eb
-