mirror of
https://github.com/sony/flutter-elinux-plugins.git
synced 2025-08-06 15:11:38 +08:00

* [video_player/camera] add gst_caps_unref Signed-off-by: Makoto Sato <makoto.sato@atmark-techno.com> * [video_player/camera] fix the return value of GstVideoPlayer::HandleGstMessage() If "async queue" is not handled, HandleGstMessage() should return GST_BUS_DROP. Signed-off-by: Makoto Sato <makoto.sato@atmark-techno.com> --------- Signed-off-by: Makoto Sato <makoto.sato@atmark-techno.com>
camera_elinux
The implementation of the camera plugin for flutter elinux. APIs are designed to be API compatible with the the official camera
.
Required libraries
This plugin uses GStreamer internally.
$ sudo apt install libgstreamer1.0-dev
# Install as needed.
$ sudo apt install libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
Usage
pubspec.yaml
dependencies:
camera: ^0.10.5+3
camera_elinux:
git:
url: https://github.com/sony/flutter-elinux-plugins.git
path: packages/camera
ref: main
Source code
Import camera
in your Dart code:
import 'package:camera/camera.dart';
Customization for your target devices
To improve the performance of this plugin, you will need to customize the pipeline in the source file. Please modify the source file and replace the videoconvert
element with a H/W accelerated element of your target device to perform well.
bool GstCamera::CreatePipeline()
in packages/camera/elinux/gst_camera.cc
default:
camerabin viewfinder-sink="videoconvert ! video/x-raw,format=RGBA ! fakesink"
i.MX 8M platforms:
camerabin viewfinder-sink="imxvideoconvert_g2d ! video/x-raw,format=RGBA ! fakesink"
Troubleshooting
If you get the following error:
Wrong JPEG library version: library is 62, caller expects 80
, try the following:
sudo mv /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpeg.so \
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpeg.so.org