Code Monkey home page Code Monkey logo

android-accessory-display's Introduction

android-accessory-display

Android USB Accessory,[email protected]

Host Required

python 2.7 & ubuntu 14.04LTS

1. install libusb

2. install ffmpeg

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg

3. install pyusb

or download source :  https://github.com/walac/pyusb

4. permission

/etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="2d01", MODE="0666", OWNER="<username>"
SUBSYSTEM=="usb", ATTR{idVendor}=="2717", ATTR{idProduct}=="ff68", MODE="0666", OWNER="<username>"
SUBSYSTEM=="usb", ATTR{idVendor}=="2717", ATTR{idProduct}=="ff48", MODE="0666", OWNER="<username>"
or used sudo when permission exception

5. run

enable USB debug on phone
a. aosp/frameworks/base/tests/AccessoryDisplay on phone
    when use this , screen size must less 320x240,
    or modify com.android.accessorydisplay.common.Protocol.MAX_ENVELOPE_SIZE more larger
b. run this file
c. run ffplay /tmp/android_accessory_display.pipe on ubuntu.
   prebuilt ffplay support video sync , it show slow then phone.
   getcode : https://github.com/FFmpeg/FFmpeg
   fixed it(not use video sync) : get ffmpeg source 
	 modify ffplay.c like follow :
		time= av_gettime_relative()/1000000.0;
        if (time < is->frame_timer + delay) {
            *remaining_time = FFMIN(is->frame_timer + delay - time, *remaining_time);
            //goto display; // == mask this line
        
        }
        is->frame_timer += delay;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.