GithubHelp home page GithubHelp logo

mpp_linux_cpp's Introduction

MPP_LINUX_C++

a demo shows that how to use mpp on linux if you want to using mpp on android,please use MediaCodec directly(hardware codec has been embedded in MediaCodec).

project architecture

├── build --build directory
├── CMakeLists.txt --cmake script
├── main.cpp --main program
├── mpp --mpp abstract interface
├── README.md --doc
├── res --res directory
├── rkdrm --drm interface(abount display)
├── rkrga --rga interface(about format and resolution conversion)
└── thread --thread abstract interface(use posix)

make & test

first please modify CMakeLists.txt to specified c and c++ compiler.
just do that
set(CMAKE_C_COMPILER "enter your toolchain gcc path)
set(CMAKE_CXX_coMPILER "enter your toolchain g++ path")

cmake version >= 2.8 is required
root:cd build
root:make
root:./mpp_linux_demo

how you will see

on your device screen,you will see that local avc file is displayed.

mpp_linux_cpp's People

Contributors

sliver-chen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mpp_linux_cpp's Issues

编译失败

请问一下如何编译测试?我在编译过程中就提示失败,用的rk3288,ubuntu16.04的系统

is it working in Tinker Board RK3288 ?

I built this with a few modifications on rk3288 board(Tinker OS)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fac5d4..2f0bb75 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,11 @@ cmake_minimum_required(VERSION 2.8)
 project(mpp_linux_demo)

 set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc" )
+set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++" )
+
+include_directories( "/usr/local/include/rockchip")
+include_directories( "/usr/include/libdrm")

 set(SOURCE_FILES main.cpp
         mpp/Codec.cpp
@@ -13,4 +18,4 @@ set(SOURCE_FILES main.cpp
         rkdrm/modeset.c)

 add_executable(mpp_linux_demo ${SOURCE_FILES})
-target_link_libraries(mpp_linux_demo mpp pthread drm)
\ No newline at end of file
+target_link_libraries(mpp_linux_demo rockchip_mpp pthread drm)

Question.
It does not seem to work properly.
Does not work on the debian Tinker Board?

linaro@tinkerboard:~/GitHub/mpp_linux_cpp/build$ ./mpp_linux_demo
mpi: mpp version: a340f34 author: Jacob Chen DEBIAN-ONLY: [osal]: drm: fix 64bit wrong offset
hal_h264d_api: hal_h264d_init mpp_buffer_group_get_internal used ion In
failed to open rga dev /dev/v4l/by-path/platform-ff680000.rga-video-index0.
failed to exec mRGA->init -1.
failed to init codec
mpp_meta: Assertion list_empty(&mlist_meta) failed at ~MppMetaService:129
mpp_buffer: mpp_group 0xb620ce60 tag hal_h264d_api_2 caller hal_h264d_init mode internal type ion deinit with 4040 bytes not released
mpp_buffer:
dumping buffer group 0xb620ce60 id 2
mpp_buffer: mode internal
mpp_buffer: type ion
mpp_buffer: limit size 0 count 0
mpp_buffer: used buffer count 1
mpp_buffer: buffer 0xb620e3a0 fd    9 size       4040 ref_count   1 discard 0 caller vdpu1_h264d_init
mpp_buffer: unused buffer count 0
mpp_buffer: Assertion buffer->ref_count == 0 failed at deinit_buffer_no_lock:184
Segmentation fault

find not -lmpp

libmpp ? rk3588\external\mpp ,Official mpp code is compiled without libmpp,only libmpp_rc.a libmpp_codec.a libmpp_base.a ...

rk@linaro-alip:~/xxw$ sudo find / -name libmpp*
[sudo] rk 的密码:
/home/rk/xxw/mpp/build1/mpp/codec/libmpp_rc.a
/home/rk/xxw/mpp/build1/mpp/codec/libmpp_codec.a
/home/rk/xxw/mpp/build1/mpp/base/libmpp_base.a
/home/rk/xxw/mpp/build1/mpp/vproc/libmpp_vproc.a
/home/rk/xxw/mpp/build1/mpp/hal/libmpp_hal.a

root@linaro-alip:/home/rk/xxw/mpp_linux_cpp-master/build# make
Scanning dependencies of target mpp_linux_demo
[ 12%] Building CXX object CMakeFiles/mpp_linux_demo.dir/main.cpp.o
[ 25%] Building CXX object CMakeFiles/mpp_linux_demo.dir/mpp/Codec.cpp.o
/home/rk/xxw/mpp_linux_cpp-master/mpp/Codec.cpp: In member function ‘int Codec::deinit()’:
/home/rk/xxw/mpp_linux_cpp-master/mpp/Codec.cpp:471:1: warning: control reaches end of non-void function [-Wreturn-type]
471 | }
| ^
[ 37%] Building CXX object CMakeFiles/mpp_linux_demo.dir/thread/Thread.cpp.o
/home/rk/xxw/mpp_linux_cpp-master/thread/Thread.cpp: In member function ‘int Thread::init()’:
/home/rk/xxw/mpp_linux_cpp-master/thread/Thread.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
30 | }
| ^
[ 50%] Building CXX object CMakeFiles/mpp_linux_demo.dir/rkrga/RGA.cpp.o
[ 62%] Building C object CMakeFiles/mpp_linux_demo.dir/rkdrm/bo.c.o
[ 75%] Building C object CMakeFiles/mpp_linux_demo.dir/rkdrm/dev.c.o
[ 87%] Building C object CMakeFiles/mpp_linux_demo.dir/rkdrm/modeset.c.o
[100%] Linking CXX executable mpp_linux_demo
/usr/bin/ld: 找不到 -lmpp
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/mpp_linux_demo.dir/build.make:193:mpp_linux_demo] 错误 1
make[1]: *** [CMakeFiles/Makefile2:95:CMakeFiles/mpp_linux_demo.dir/all] 错误 2
make: *** [Makefile:103:all] 错误 2

vpu.h not found

My chip is rk3399.
I set the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in CMakeList.txt.
Then I do mkdir build;cd build;cmake ..;make, and I get the following error.

root@norco:~/mpp_linux_cpp/build# make
Scanning dependencies of target mpp_linux_demo
[ 12%] Building CXX object CMakeFiles/mpp_linux_demo.dir/main.cpp.o
In file included from /root/mpp_linux_cpp/main.cpp:9:0:
/root/mpp_linux_cpp/mpp/Codec.h:16:17: fatal error: vpu.h: No such file or directory
compilation terminated.
CMakeFiles/mpp_linux_demo.dir/build.make:62: recipe for target 'CMakeFiles/mpp_linux_demo.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/mpp_linux_demo.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mpp_linux_demo.dir/all' failed
make[1]: *** [CMakeFiles/mpp_linux_demo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Should I install a vpu.h manually? How to install it?

i meet issues fllowing the problem, can you help me?

mpp_drm: os_allocator_drm_alloc handle_to_fd failed ret -1
mpp_buffer: mpp_buffer_create failed to create buffer with size 101376
mpp_packet: mpp_packet_init_with_buffer invalid input packet 0x7f937f68c8 buffer (nil)
mpp_buffer: mpp_buffer_put invalid input: buffer (nil)
mpp_enc: Assertion packet failed at mpp_enc_control_thread:135
mpp_packet: check_is_mpp_packet pointer (nil) failed on check
Segmentation fault (core dumped)
my system is Linux NanoPi-NEO4 4.4.143 #1 SMP Tue Nov 20 11:10:11 CST 2018 aarch64 aarch64 aarch64 GNU/Linux
my board is rk3399

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.