Giter Site home page Giter Site logo

marcry / termux-sdl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lzhiyong/termux-sdl

0.0 0.0 0.0 117.75 MB

termux sdl plugin

License: Apache License 2.0

Shell 5.87% C++ 10.31% Python 0.01% Perl 0.09% C 78.17% Objective-C 2.58% Java 0.83% Assembly 0.12% CSS 0.10% Makefile 0.66% HTML 0.62% CMake 0.11% Metal 0.01% M4 0.51%

termux-sdl's Introduction

termux-sdl

This is a termux sdl plugin for compiling and running SDL2 and native app.

How to running SDL2 and native activity program:

Download the Termux app, then execute the command pkg install clang

# compile examples
cd examples/SDL2/draw2

# create build directory
mkdir build && cd build

# execute cmake 
cmake ..

# start running
make run

# compile your own program, please refer to examples 


Using github actions to auto building debug app

If you want to use github actions to build debug app.
please fork this repository, then execute the command as below.

# clone your own repository
git clone https://github.com/your_repository/termux-sdl

# change to the termux-sdl directory
cd termux-sdl

# add a tag v2.5 v3.0 ..etc
git tag -a v3.0 -m "release 3.0 version" 

# push tag to trigger the github actions
# or you can modify the workflow file to change the trigger conditions
git push origin --tag

Using ffplay to play video and audio

At the same time, I added ffplay, so it can also be used as a local player.

ffplay has implemented a progress bar and time display.
swipe the left side of the screen to control the brightness, swipe the right side of the screen to control the volume.
the progress bar is drawn by SDL2_gfx, the time is drawn by SDL2_ttf.

# copy ffplay to /data/data/com.termux/files/usr/bin
cp example/SDL2/ffplay/ffplay /data/data/com.termux/files/usr/bin
chmod 755 /data/data/com.termux/files/usr/bin/ffplay

# play video
ffplay -i /sdcard/video/test.mp4

# play music whit 1.5x speed
ffplay -af atempo=1.5 -i /sdcard/music/hello.flac

# 2x speed playback
ffplay -af atempo=2.0 -vf setpts=1/2*PTS -i /sdcard/video/test.mp4

# play at any speed: atempo=x setpts=1/x*PTS

# no window title(set title is null)
ffplay -window_title -i /sdcard/video/test.mp4

# full screen
ffplay -fs -i /sdcard/video/test.mp4

How to use SDL_AndroidLogPrint method to print log click here for example.


Issues

  • There are still some problems with ffplay, when playing at playback speed, drag the progress bar, the time is inaccurate, and the video and audio are not synchronized.

  • You can also add some external libraries, such as libx264 libx265 fdk-aac etc, to better support ffplay.

termux-sdl's People

Contributors

lzhiyong avatar marcry avatar

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.