Giter VIP home page Giter VIP logo

jrtplib4android's Introduction

Jrtplib4Android

基于开源项目jrtplib,自主编译出jni依赖库,在Android平台上实现RTP/RTCP数据接收、发送等示例。(包含H264数据分包发送,添加时间水印等)

注意:本人采用的是android-ndk-r14b,并不是as自带的。!!!(自带的会出现各种异常)

app编译项目

接收端实现的功能:

1、接收rtp数据,回调数据至java(目前只有byte[],length,isMarker,可根据需求自行修改);
2、接收rtcp、bye命令等,回调至java,通过自定义的int值type来区分,同时传递了数据发送端的IP字符串。

发送端实现的功能:

1、实现FU-A分包发送H264数据;
2、实现发送RTP数据;
3、实现接收rtcp、bye命令等,回调至java,通过自定义的int值type来区分,同时传递了数据发送端的IP字符串。

osd编译项目

实现的功能:

1、实现将NV21格式数据转换为NV12格式,并旋转角度;
2、实现在NV12格式数据上,添加时间水印;

test项目是实际应用项目

1、Android实现采集摄像头数据,异步编码为H264数据,通过jni发送至指定接收端;
2、实现网络摄像机RTSP协议对接(单通道视频流);
3、实现接收RTSP服务端的RTP数据,转发至指定接收端。(项目使用是局域网接收摄像机,通过Android手机传递至公网服务器);

使用方法

RtpHandle是RTP相关jni操作对象。
initSendHandle方法适用于只发送数据;
initReceiveHandle方法适用于只接收数据;
initReceiveAndSendHandle方法适用于接收并转发数据;

YuvOsdUtils是时间水印相关jni操作对象。
initOsd方法初始化;
addOsd方法实时添加时间水印;
releaseOsd方法最后销毁时调用;

建议与反馈

项目中关于回调数据,建议不要在回调线程中直接处理。一些性能上的优化,暂时使用java来处理。由于本人项目要求不高,暂时没有在jni中实现缓存队列来处理性能问题(本人也不是做C++,不是很熟悉队列的实现和线程的控制)。欢迎大家提供好的建议和修改意见,有时间会及时完善。联系邮箱:[email protected] https://blog.csdn.net/sun8532685/article/details/100703331

jrtplib4android's People

Contributors

qfsun 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.