Skip to content

Commit 0fc759d

Browse files
authored
[camera_android] Remove references to third party googlesamples/mlkit code (#10056)
Remove references to [mlkit/android/vision-quickstart](https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart) as per my findings in #10022 (comment). ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent bbc7da4 commit 0fc759d

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/media/ImageStreamReaderUtils.java

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
//
5-
// Note: the code in this file is taken directly from the official Google MLKit example:
6-
// https://github.com/googlesamples/mlkit
74

85
package io.flutter.plugins.camera.media;
96

@@ -28,8 +25,6 @@ public class ImageStreamReaderUtils {
2825
* NV21 format. This happens if the planes share the same buffer, the V buffer is one position
2926
* before the U buffer and the planes have a pixelStride of 2. If this is case, we can just copy
3027
* them to the NV21 array.
31-
*
32-
* <p>https://github.com/googlesamples/mlkit/blob/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/BitmapUtils.java
3328
*/
3429
@NonNull
3530
public ByteBuffer yuv420ThreePlanesToNV21(
@@ -60,23 +55,7 @@ public ByteBuffer yuv420ThreePlanesToNV21(
6055
return ByteBuffer.wrap(out);
6156
}
6257

63-
/**
64-
* Copyright 2020 Google LLC. All rights reserved.
65-
*
66-
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
67-
* except in compliance with the License. You may obtain a copy of the License at
68-
*
69-
* <p>http://www.apache.org/licenses/LICENSE-2.0
70-
*
71-
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
72-
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
73-
* either express or implied. See the License for the specific language governing permissions and
74-
* limitations under the License.
75-
*
76-
* <p>Checks if the UV plane buffers of a YUV_420_888 image are in the NV21 format.
77-
*
78-
* <p>https://github.com/googlesamples/mlkit/blob/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/BitmapUtils.java
79-
*/
58+
/** Checks if the UV plane buffers of a YUV_420_888 image are in the NV21 format. */
8059
private static boolean areUVPlanesNV21(@NonNull Image.Plane[] planes, int width, int height) {
8160
int imageSize = width * height;
8261

@@ -104,24 +83,10 @@ private static boolean areUVPlanesNV21(@NonNull Image.Plane[] planes, int width,
10483
}
10584

10685
/**
107-
* Copyright 2020 Google LLC. All rights reserved.
108-
*
109-
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
110-
* except in compliance with the License. You may obtain a copy of the License at
111-
*
112-
* <p>http://www.apache.org/licenses/LICENSE-2.0
113-
*
114-
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
115-
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
116-
* either express or implied. See the License for the specific language governing permissions and
117-
* limitations under the License.
118-
*
119-
* <p>Unpack an image plane into a byte array.
86+
* Unpack an image plane into a byte array.
12087
*
12188
* <p>The input plane data will be copied in 'out', starting at 'offset' and every pixel will be
12289
* spaced by 'pixelStride'. Note that there is no row padding on the output.
123-
*
124-
* <p>https://github.com/googlesamples/mlkit/blob/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/BitmapUtils.java
12590
*/
12691
private static void unpackPlane(
12792
@NonNull Image.Plane plane, int width, int height, byte[] out, int offset, int pixelStride)

0 commit comments

Comments
 (0)