- Apr 03, 2020
-
-
David Stevens authored
Fixes: 153130850 Test: None Change-Id: I358db66d8ddc75efcff2e2dd9bf4ae4518c1fc01
-
- Jan 13, 2020
-
-
Prabir Pradhan authored
Two build fixes: - Use C++17 since it is needed by dependencies in frameworks/native, and C++17 is used by default. - Rename header MediaSource.h Bug: 146373480 Test: mma -j500 Change-Id: I3dacea9645c1e2919888e7f63535d531c32947e9
-
- Dec 19, 2019
-
-
Pin-chih Lin authored
IMPLEMENTATION_DEFINED is a special format for encoder input frames which is backed by gralloc.In ChromeOS, IMPLEMENTATION_DEFINED may be backed by YCBCR_420_888 or RGBX_8888. As for C2AllocationGralloc::map(), any unrecognized format will be regarded as YCBCR_420_888. In YUV-backed case, C2AllocationGralloc::map() could map and provide layout correctly. However in RGB-backed case, map() would fail and the caller will get an empty layout instance. ImplDefinedToRGBXMap can provide the layout for RGB-backed IMPLEMENTATION_DEFINED format case. When the instance is created, it will own the GraphicBuffer wrapped from input block and lock it, to provide the address, offset, and rowInc information. The GraphicBuffer will be unlocked and released under destruction. Bug: 73059339 Test: android.media.cts.MediaRecorderTest#testSurfaceRecording Change-Id: Iae8112e9dc8c30d2f0a08ae2a4cc0d7fb9db1c03 (cherry picked from commit 28ae20917491a301ed0122e280ddbb4152151cb2)
-
- Dec 05, 2019
-
-
Pin-chih Lin authored
Bug: 144474391 Test: CtsMediaTestCases Change-Id: I0fbb41a8b9f52d10b964b366e58f21798640f40a (cherry picked from commit 39acc2a8f3a4a9ec10b0f23aada7ce2ad20eb175)
-
Pin-chih Lin authored
Several minor bugs were fixed caused from library DEP migration. Removed obsolete codes under cmds/. Use c++17 instead for building C2VDAComponent_test otherwise there are many complicated build errors. In C2V[D|E]ACompIntf_test TestUnsupportedParam, C2ComponentTemporalInfo is replaced by C2ComponentTimeStretchTuning because the former is removed. Bug: 145262637 Test: mmm external/v4l2_codec2 Change-Id: Ied744d025ccdda20533e823a3dfd17edc8f12d54
-
- Nov 28, 2019
-
-
TreeHugger Robot authored
-
- Nov 27, 2019
-
-
TreeHugger Robot authored
-
David Stevens authored
This change ports the decoder portion of the arc codec-tests [1] into an Android application. The codec-test source is copied with minimal changes - just renaming some header includes, replacing main() with a RunDecoderTests function, removing most references to 'arc', and auto formatting. The new code is the Android activity and the jni glue. This change also enables presubmit format hooks for java and fixes a typo in the clang_format hook configuration. [1] https://chromium.googlesource.com/chromiumos/platform2/+/57c0c80bdb0d671f4fb2293c4c5fa7b5ed9dddf0/arc/codec-test/ Test: existing decoder tests pass when following instructions in readme Bug: 142423642 Bug: 143584325 Bug: 144681449 Change-Id: I31e02cae5c10bb9936769c75efafe1fa9971bdbb (cherry picked from commit 46344d0a85479760c5294f21de2efc106ab54048)
-
- Nov 26, 2019
-
-
Keiichi Watanabe authored
V4L2 registers video input/output devices as /dev/videoX. So, we can use this name pattern instead of /dev/video-decX. Bug: 140275575 Test: Play YouTube on ARCVM with virtio-vdec Change-Id: Iacd403c46ef1b1f86c8a1675624a11efe86f6c74 Signed-off-by:
Keiichi Watanabe <keiichiw@google.com> (cherry picked from commit c552e9b97437a15d2311aafb14182b7a7f78bcfd)
-
Hirokazu Honda authored
C2VEAComponent::IntfImpl assumes a platform supports H264 encoding. C2VEAComponent::IntfImpl's ctor crashes on a platform that doesn't support. The ctor runs always on ARC++ startup. This fixes the crash. Bug: None Test: No crash happens in libv4l2_codec2.so on ARC++ startup Change-Id: If8c312b5583cfe9582d1c73317fcd901fa018898 (cherry picked from commit c559c23c692220894db1972919fa53818c12838e)
-
- Nov 25, 2019
-
-
Hirokazu Honda authored
gralloc stack might need the info that an allocated buffer will be consumed by hardware video encoder. Specifying BufferUsage::VIDEO_ENCODER in Android results in GRALLOC_USAGE_HW_VIDEO_ENCODER. This sets VIDEO_ENCODER mask for a destination buffer on converting in C2VEAFormatConverter. Without C2VEAFormatConverter, the input buffer given by C2VEAComponent client is passed as-is. That said, it is another part that has a responsibility to set the proper usage mask. Bug: 144135251 Test: ARC++ encoder on kukui Change-Id: I5cf2d462677ba14643fc564d99e2a8a64145cbce (cherry picked from commit 7e4a6634db0d12a86eaf1a5ead29206076046fc4)
-
- Nov 01, 2019
-
-
TreeHugger Robot authored
-
- Oct 30, 2019
-
-
Xin Li authored
Bug: 142003500 Change-Id: Ia0e2379efe718832962021332c5e0f232e15a1aa
-
Pin-chih Lin authored
Most ChromeOS devices are able to create 8 concurrent VDAs for ARC video clients. This is set as a constant in GAVDA to reject more than 8 clients by INSUFFICIENT_RESOURCES. However, for new device Kukui, the max concurrent VDA number is 4. Since we cannot change the constant nor obtain this value dynamically. The alternative way is in C2VDAComponent side, we treat initialization error PLATFORM_FAILURE as INSUFFICIENT_RESOURCES. In fact, Codec2.0 SW codecs also adapt this method. Bug: 143194688 Test: android.media.cts.MediaCodecCapabilitiesTest#testGetMaxSupportedInstances Change-Id: Ia25c9b27976bb71dd1d7166eece12e88fbfb4659 (cherry picked from commit 78981bbe6b64597aaf67d2fc67083715af073bf2)
-
Pin-chih Lin authored
In current C2VEAFormatConverter design, it always does format conversion and copy for each frame even if the source and target format are identical. This CL we added the scheme to avoid unnecessary copy while detecting the source format is already the same as target. Bug: 73059339 Bug: 118544836 Test: CtsMediaTestCases android.media.cts.MediaRecorderTest on Soraka Test: nexus7 camera App on Soraka Change-Id: I3ab1387cbc7508777d44f0f4319f5e95cd2da17d (cherry picked from commit 2a1d153e160b6ccb22b7249899161f9cb5cc9097)
-
Pin-chih Lin authored
The maximal supported AVC level is adjusted up to Level5.1 which is the same as legacy ArcVideoEncoder. ProfileLevelSetter is refined to be able to set lower level, e.g. Level1.0. This is the potential issue in current Codec2.0 config update procedure. Because config setting is one by one, the order of config setting may affect the final setting if there are dependent configurations. Bug: 140407694 Test: android.media.cts.MediaRecorderTest#testProfileAvcBaselineLevel1 Change-Id: Iea9bfc4d8b6fd7a8bd8ffa3a8f262ff24aa86518 (cherry picked from commit ca6e942d0926cb9331a7f81ae6bda5d92dc29d73)
-
Pin-chih Lin authored
In VEA API, UseBitstreamBuffer() doesn't require to correlate to Encode(). That is, in C2VEAComponent's aspect, output buffers are not guaranteed to be FIFO. Instead, we should apply a unique buffer index for each output buffer and assign it to the corresponding BitstreamBufferReady callback. It could help C2VEAComponent to identify which output buffer is returned. Bug: 73059339 Test: pass arcvideoencoder native e2e test on Kevin. Test: pass CTS android.media.cts.EncodeDecodeTest on Kevin. Change-Id: I0c7a7768f9266c3c908dfe4506cbffa47a3459a4 (cherry picked from commit 9bb2cd5745bee36c877b67bc6ad16656cf6eb574)
-
Pin-chih Lin authored
When component flush is called, component will initialize VEA again and callback RequireBitstreamBuffers is expected. However, if component is stopped (released) in the middle of them, RequireBitstreamBuffers callback is no longer cared. And in fact previous code would cause CHECK error since the component state is no longer CONFIGURING. Bug: 73059339 Test: CtsMediaTestCases android.media.cts.MediaCodecTest#testReleaseAfterFlush Change-Id: Iafac39b8a4a0da0fac0dd899c304ba1d0f35660f (cherry picked from commit 2feac90f0f51c5f2539f43529912aeb4ddb29cc6)
-
Pin-chih Lin authored
Previously, C2VEAComponent regarded the workaround CSD-holder C2Work and put the CSD info extracted by the first output bitstream into it. However, there are several emerging issues of this workaround which increase the complexity of our implementation (see b/140975410). We decided NOT to support the workaround and in practice VEA is not able to output CSD (SPS/PPS stream) prior to getting any input. C2VEAComponent will just return the workaround C2Work, and CSD info will be put into the corresponding C2Work of the first input buffer. Bug: 140975410 Bug: 73059339 Test: CtsMediaTestCases android.media.cts.VideoEncoderTest#testOtherH264Flex720p Change-Id: I94922ef189a39ea75d3ffcba729e46c8e149cf6a (cherry picked from commit 8e0e00d0dea48d105b89864f72d0e5d95a06685f)
-
Pin-chih Lin authored
When the component is in error state, it is not guaranteed VDA is still responsible. Rather than sending VDA->Reset() request and waiting on callback, the component will release VDA adaptor immediately on stop. Furthermore, after this change we might not guarantee there is no remaining task after onStop() is executed, which will change the state to UNINITIALIZED immediately. We modified EXPECT_RUNNING_OR_RETURN_ON_ERROR() to just return if tasks are executed while component state is UNINITIALIZED, instead of assertion. Bug: 139457871 Bug: 140357179 Test: pass android.security.cts.StagefrightTest#testStagefright_bug_21443020 on Kevin Test: pass CtsMediaTestCases on Kevin Change-Id: I3eef02f66619cfea8a72bed40b5ac83c282ede10 (cherry picked from commit f7d8029f9f18a0f8be138fed41add63417d5d5da)
-
Pin-chih Lin authored
The previous implementation has a bug that we assume on start process VEAAdaptor is already created. In fact, if the component has been through start --> stop --> start, then VEAAdaptor is nullptr on the second start process. This CL fixed the above issue. Bug: 73059339 Test: CtsMediaTestCases android.media.cts.MediaCodecTest#testReconfigureWithoutSurface Change-Id: I328c9241938d6fa81753f11af14f239b6a24a183 (cherry picked from commit c4146fbc682bcd70250838f96c1555cce1107135)
-
Pin-chih Lin authored
C2VEAFormatConverter is designed to convert C2VEAComponent input frames into required pixel format (NV12) and coded size. It will allocate additional graphic blocks for format conversion. Bug: 73059339 Test: arcvideoencoder native e2e test on Soraka and Kevin Change-Id: If2e8198563a2eafebe3cc56c473755c2ccf89988 (cherry picked from commit 8a2903d1aa56102b22e5c48e0607c0d126a40802)
-
Pin-chih Lin authored
In current C2 framework, CSD info would be reported in different manners whether encoder is in input surface mode and byte-buffer mode. Byte-buffer mode: A work with no input buffer will be queued prior to other works to get CSD info only (CSD-holder work). When the first bitstream buffer is encoded by VEA, the component needs to extract the CSD info and put into CSD-holder work as a parameter. Surface mode: No CSD-holder work. When the first bitstream buffer is encoded by VEA, the component needs to extract the CSD info and put into the same work corresponding to this bitstream as a parameter. Bug: 73059339 Test: android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBufferQCIF Test: android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromSurfaceToSurfaceQCIF Change-Id: I13ede4c3b725e27cd0eb66b07925fdf93b5bafb4 (cherry picked from commit 0922077bcc55af276402129b23110de9abfee5f7)
-
Pin-chih Lin authored
In the past we check most of the function tasks to be executed while component state is running (not UNINITIALIZED) and assert if violated. However, in some cases we might not guarantee there is no remaining task after onStop() is executed, which will change the state to UNINITIALIZED immediately. Instead of assertion, we modified to just return if tasks are executed while component state is UNINITIALIZED. It makes sense because the component is already released everything. And it could also avoid unnecessary process crashes. Bug: 73059339 Test: android.media.cts.MediaCodecTest#testAbruptStop passed and no crash Change-Id: Ib5b68ed51f3ba137b981edc24519dd4ba7144532 (cherry picked from commit 23cccc9f965581241573bad6a9f840a8363bb0d7)
-
Pin-chih Lin authored
Add usage flag BufferUsage::VIDEO_DECODER for video decoder while allocating graphic buffers. Note that this flag is defined in IAllocator but not in legacy GRALLOC_USAGE. Bug: 139859772 Test: check usage bit is propogated to C2AllocatorGralloc Test: pass GtsExoPlayerTestCases on Soraka Change-Id: Ief673eff25df34026c66c8941f6b54c9e49c8b11 (cherry picked from commit 89006a485724cbef83b6e220026047639763cdd0)
-
Hirokazu Honda authored
V4L2VDA assumes a buffer with V4L2_BUF_FLAG_LAST doesn't contain a decoded frame. However, the fact is a buffer with V4L2_BUF_FLAG_LAST might contain a decoded frame (not always though). This CL removes the wrong assumption. Bug: 131122595 Test: ARC++ decoder E2E test (i.e. arc_video_decoder_e2e_test) with pure Android solution Change-Id: Iaf2d425b019a3d0438552c5ea3d2fb1852043777 (cherry picked from commit fe275e331fb9afab7d04fa01881ff6b802df32b9)
-
Hirokazu Honda authored
V4L2VDA calls NotifyEndOfBitstreamBuffer() when BitstreamBufferRef is destructed. BitstreamBufferRef is destructed when a file descriptor info is registered in |input_record|. This is obviously wrong if we use a file descriptor for bitstream buffer because we don't copy the content to memory owned by v4l2 driver. Therefore, the bitstream buffer can be overwritten in a client side for a new bitstream buffer before a v4l2 driver will consume the buffer. The bitstream buffer shall not be overwritten until a v4l2 driver will consume. This CL delays NotifyEndOfBitstreamBuffer() by keeping the reference of BitstreamBufferRef until DQBUF is complete on OUTPUT queue, after which a driver should not refer the buffer defenitely. Bug: 131122595 Test: arcvideodecoder native e2e test on eve Change-Id: I5b357f9395acbad53417c843800465138d92d619 (cherry picked from commit 85e5d31bcbd6eb7d5df75355ef664e4bbb3d070a)
-
Pin-chih Lin authored
Note: the original code is under video_types.(h|cc) in Chromium Bug: 73059339 Test: compile image Change-Id: I3a5a71d2a9ea076e6e6807a4bb5342f4c8279624 (cherry picked from commit 24ce720487f1c92229d50e0018631f7eef7a928a)
-
Pin-chih Lin authored
The previous check of flushed input/output buffer by frame index is not correct for output. isFlushedState() is introduced to provide a better approach by checking if the component state is under two situations: 1) flushed by stop, and 2) flushed by flush. Bug: 73059339 Test: pass arcvideoencoder native e2e test on Kevin and Soraka Change-Id: Ifb1c2d5ef6098bf95b94b5a4b2d8491b856991dd (cherry picked from commit 2940ca2475746235f32fbf92dc6b9758e5ab683c)
-
Pin-chih Lin authored
For C2Work, the output worklet should be assigned with the output bitstream which is encoded from the corresponding input frame. In VEA's aspect, the callback of bitstream ready is paired with timestamp, which is obtained from the corresponding input frame. That is, the component should use timestamp to match the output bitstream with the pending work. Bug: 73059339 Test: arcvideoencoder native e2e test on Soraka and Kevin Change-Id: I235a3d8aa2f1e33de762a25a1e8ce2414a18e629 (cherry picked from commit c541e2c0d99424ced9294b4f7a95b1753e1b7e79)
-
Hirokazu Honda authored
The number of allocated buffers by a driver by VIDIOC_REQBUFS should not be smaller than requested unless the driver runs out of memory. This CL correct the exisiting check for CAPTURE queue and add the check for OUTPUT queue. Bug: None Test: ARC e2e decoder test Change-Id: I95fe5564979b77594ebbfa83815037755e85c38c (cherry picked from commit 7bbeeecb65916f75bd089e8f118b392494db0da6)
- Oct 15, 2019
-
-
Chih-Yu Huang authored
Bug: 136716638 Test: m -j32 Change-Id: Ie3a652c5ecd6d7b597efb6fcfa090f942d5dd4a1 (cherry picked from commit 0d5ae9523d04984d5205b845b2733cf58f681aef)
-
Pin-chih Lin authored
1. C2VEAAdaptorProxy should be guarded by #ifdef V4L2_CODEC2_ARC 2. Thread-safety attributes are not able to compile by bertha. I haven't found the root cause yet so removed them first. Bug: 73059339 Test: build bertha_x86_64-eng on pi-arcvm-dev Change-Id: Ib0ea84f4c24072faffd68a8bd4e9d1cee66b1e2b (cherry picked from commit c8fab05fe388259b3b148400b573f685a5bab870)
-
Pin-chih Lin authored
Please refer to go/codec2-v4l2-encoder for design details. Note: there is a hack to pretend YV12 by I420 of input buffers since currently Chromium VEA only accepts I420 format. YV12 will be used for input byte-buffer mode, which is adopted by arcvideoencoder native test. By doing so, the encoded stream will have UV-swapped while playing. Bug: 73059339 Test: pass arcvideoencoder native e2e test. Change-Id: Ibfcb19f5a397ccbc934f3800443d19dafb8e42f8 (cherry picked from commit 13e650b2031da1cb6c8948391896dd8fcf7161a1)
-
Pin-chih Lin authored
Previously we want to use timestamp as the indicator for component to find the corresponding work on notifying from VEA. However, it would be not robust enough since timestamp could be repetitive and wrap-back. Index (frame index) should be the better indicator due to its uniqueness and is always increased monotonically. Bug: 73059339 Test: mmm external/v4l2_codec2 Change-Id: I23ac7f1830f2405163604e25f7be92b98fabd949 (cherry picked from commit 155167ddd100311e1aa2b15649b21cb0580bee22)
-
- Sep 26, 2019
-
-
Pin-chih Lin authored
We are adding video encode accelerator (VEA) related codes into this library. So we would like to rename it to *_accel. Bug: 73059339 Test: build image Change-Id: I66c574b66d4fdf9014db304b0d97c19c248718c1 (cherry picked from commit 7ba9f723f767e78b04b330f66901beeadff4915d)
-
Hirokazu Honda authored
C2VDAComponent has got offsets and strides info by using C2ConstGraphicBlock::map(). The function actually maps an owned buffer in memory by calling lockYCbCr with SW flag. We computed offsets from the based addresses. The computed offsets are not always correct and it's not guaranteed a buffer is mappable always either. The correct way is to execute lockYCbCr() without SW flag. However, C2ConstGraphicBlock::map() doesn't have the way. This CL changes C2VDAComponent to directly execute lockYCbCr() to native_handle in C2GraphicBlock and compute offsets and strides from android_ycbcr. Bug: 137161142 Test: ExoPlayerDemo app on kevin Change-Id: Ia8a49ef0960770bc35ba7fc05476e4b86c266202 (cherry picked from commit 9ba0c64347b9bdd75acfb8c2db0857ac37f822e5)
-
Hirokazu Honda authored
C2VDAComponent allocates a graphic buffer by gralloc. The size is requested by C2VDAAdaptor. gralloc might adjust stride. C2VDAComponent needs to inform the adjusted size to C2VDAAdaptor by C2VDAAdaptor::AssignPictureBuffers(). C2VDAComponent calls GraphicBuffer::lockYCbCr with usage=0 to an output buffer. Note that lockYCbCr doesn't map the buffer with usage=0. Bug: chromium:979115 Test: Regular playback and Secure playback with ExoPlayerDemo app Change-Id: Ia3f2dbdc561114dc734eb862ac800aa0ca202f1b (cherry picked from commit 0df5811519ed485d62d8c54a6e2f7ce4268edc64)
-