Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2122)

Unified Diff: examples/dart/camera_roll/camera_roll.dart

Issue 1375733004: -Add a mojo service to get video frames from the camera through an android service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove stale files. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | examples/dart/camera_roll/lib/main.dart » ('j') | examples/dart/device_info/lib/main.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/dart/camera_roll/camera_roll.dart
diff --git a/examples/dart/camera_roll/camera_roll.dart b/examples/dart/camera_roll/camera_roll.dart
deleted file mode 100644
index b5a8717acf5fcddec2b7b86426b9012c9604b468..0000000000000000000000000000000000000000
--- a/examples/dart/camera_roll/camera_roll.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-#!mojo sky_viewer.mojo
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// To run: mojo/devtools/common/mojo_run --sky \
-// examples/dart/camera_roll/camera_roll.dart --android
-// This example makes use of mojo:camera_roll which is available only when
-// running on Android.
-
-import 'dart:async';
-import 'dart:sky';
-
-import 'package:mojom/mojo/camera_roll.mojom.dart';
-import 'package:sky/mojo/embedder.dart';
-
-final CameraRollServiceProxy cameraRoll = new CameraRollServiceProxy.unbound();
-int photoIndex = 0;
-
-Picture draw(Image image) {
- PictureRecorder canvas = new PictureRecorder(view.width, view.height);
- Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0);
- canvas.scale(view.width / image.width, view.height / image.height);
- canvas.drawImage(image, 0.0, 0.0, paint);
- return canvas.endRecording();
-}
-
-void drawNextPhoto() {
- var future = cameraRoll.ptr.getPhoto(photoIndex);
- future.then((response) {
- if (response.photo == null) {
- cameraRoll.ptr.update();
- photoIndex = 0;
- drawNextPhoto();
- return;
- }
-
- new ImageDecoder(response.photo.content.handle.h, (image) {
- if (image != null) {
- view.picture = draw(image);
- view.scheduleFrame();
- }
- });
- });
-}
-
-bool handleEvent(Event event) {
- if (event.type == "pointerdown") {
- return true;
- }
-
- if (event.type == "pointerup") {
- photoIndex++;
- drawNextPhoto();
- return true;
- }
-
- return false;
-}
-
-void main() {
- embedder.connectToService("mojo:camera_roll", cameraRoll);
- view.setEventCallback(handleEvent);
- drawNextPhoto();
-}
« no previous file with comments | « no previous file | examples/dart/camera_roll/lib/main.dart » ('j') | examples/dart/device_info/lib/main.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698