Skip to content

Commit

Permalink
CMake File Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Islam committed Nov 2, 2023
1 parent b4414e9 commit 53f07b7
Show file tree
Hide file tree
Showing 146 changed files with 848 additions and 4,591 deletions.
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,20 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "fe6553b689e4d2151b0f760ca06927fc284cc0a9"
channel: "beta"
revision: "d211f42860350d914a5ad8102f9ec32764dc6d06"
channel: "stable"

project_type: app
project_type: plugin_ffi

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
- platform: android
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
- platform: ios
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
- platform: linux
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
- platform: macos
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
- platform: web
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
- platform: windows
create_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
base_revision: fe6553b689e4d2151b0f760ca06927fc284cc0a9
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06

# User provided section

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
29 changes: 1 addition & 28 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
BSD 3-Clause License

Copyright (c) 2023, Muhammad Islam

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
TODO: Add your license here.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# camera_linux

Camera Linux is a Flutter FFI plugin designed specifically for the Linux platform. This plugin allows Flutter developers to access and capture images from the Linux camera, seamlessly integrating native code invocation using Dart's FFI.
A new Flutter FFI plugin project.

## Getting Started

Dart FFI Integration: Built on top of Flutter's FFI (Foreign Function Interface) to directly invoke native functions.
Platform-Specific: Tailored for Linux, ensuring optimal performance and compatibility.
Easy Access to Camera: Provides straightforward functions to capture images directly from the Linux camera.
This project is a starting point for a Flutter
[FFI plugin](https://docs.flutter.dev/development/platform-integration/c-interop),
a specialized package that includes native code directly invoked with Dart FFI.

## Project structure

Expand All @@ -18,7 +18,7 @@ This template uses the following structure:
* `lib`: Contains the Dart code that defines the API of the plugin, and which
calls into the native code using `dart:ffi`.

* platform folder (`linux`): Contains the build files
* platform folders (`android`, `ios`, `windows`, etc.): Contains the build files
for building and bundling the native code library with the platform application.

## Building and bundling native code
Expand Down Expand Up @@ -57,17 +57,23 @@ A plugin can have both FFI and method channels:
ffiPlugin: true
```
The native build systems that are invoked by FFI (and method channel) plugin is:
The native build systems that are invoked by FFI (and method channel) plugins are:
* For Android: Gradle, which invokes the Android NDK for native builds.
* See the documentation in android/build.gradle.
* For iOS and MacOS: Xcode, via CocoaPods.
* See the documentation in ios/camera_linux.podspec.
* See the documentation in macos/camera_linux.podspec.
* For Linux and Windows: CMake.
* See the documentation in linux/CMakeLists.txt.
* See the documentation in windows/CMakeLists.txt.
## Binding to native code
Instead of manually writing the Dart bindings to native code, they are auto-generated from the header file (src/camera_linux.h) using the package:ffigen. To refresh these bindings, execute:
`flutter pub run ffigen --config ffigen.yaml`
To use the native code, bindings in Dart are needed.
To avoid writing these by hand, they are generated from the header file
(`src/camera_linux.h`) by `package:ffigen`.
Regenerate the bindings by running `flutter pub run ffigen --config ffigen.yaml`.

## Invoking native code

Expand All @@ -78,16 +84,9 @@ Longer-running functions should be invoked on a helper isolate to avoid
dropping frames in Flutter applications.
For example, see `sumAsync` in `lib/camera_linux.dart`.

## Getting Started with the Plugin

Add the camera_linux plugin to your pubspec.yaml:

```dependencies:
camera_linux: ^0.1.0
```
## Flutter help

Execute the following command to fetch the package:
`flutter pub get`
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## Further Assistance
For comprehensive guidance on Flutter, visit the official documentation, offering tutorials, samples, mobile development insights, and a complete API reference.
24 changes: 0 additions & 24 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
13 changes: 0 additions & 13 deletions android/.gitignore

This file was deleted.

67 changes: 0 additions & 67 deletions android/app/build.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions android/app/src/debug/AndroidManifest.xml

This file was deleted.

33 changes: 0 additions & 33 deletions android/app/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions android/app/src/main/res/drawable-v21/launch_background.xml

This file was deleted.

12 changes: 0 additions & 12 deletions android/app/src/main/res/drawable/launch_background.xml

This file was deleted.

Binary file removed android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 0 additions & 18 deletions android/app/src/main/res/values-night/styles.xml

This file was deleted.

18 changes: 0 additions & 18 deletions android/app/src/main/res/values/styles.xml

This file was deleted.

7 changes: 0 additions & 7 deletions android/app/src/profile/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit 53f07b7

Please sign in to comment.