替换Homebrew源为中科大镜像

国内homebrew使用体验很的很差,主要问题是访问github速度太慢,经常卡死在update.

国内homebrew使用体验很的很差,主要问题是访问github速度太慢,经常卡死在update.
替换为中科大镜像,立即起飞.
首先替换Git repo

然后替换Bottles

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: 替换Homebrew源为中科大镜像

macOS 10.12 Sierra上开启原生NTFS写入

Mac上自动挂载的磁盘本身是不允许NTFS写入的。
本文使用osxfuse和ntfs-3g免费原生支持

Mac上自动挂载的磁盘本身是不允许NTFS写入的。
有几款商用软件,像Tuxera NTFS和Paragon NTFS,如果喜欢正版可以支持。
这里介绍一种免费的方式,ntfs-3g 继续阅读“macOS 10.12 Sierra上开启原生NTFS写入”

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: macOS 10.12 Sierra上开启原生NTFS写入

在Android端SDK实现了RTMFP协议

做直播这门也有个5年多了,RTMFP协议是梦寐以求的移动客户端实现.在今天,还是成功实现到Android上了.

注意,不是flash,不是AIR哦,而是真正原生c\c++实现.

rtmfp是个激动人心的技术,udp传输\p2p连接\NetGroup,很可能改变直播行业的现状.

欢迎尝鲜:https://github.com/NodeMedia/NodeMediaClient-Android/releases/tag/v2.0.1

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: 在Android端SDK实现了RTMFP协议

Eclipse开发Android-NDK项目自动生成javah头文件

博主双修Android,iOS底层库开发也有好几年了,一直盼望Android平台能有Xcode那样强大的IDE,尽管Eclipse的ADT插件也能很好的代码提示,自动补全,但每次新开类生成javah文件也是比较头疼的。

Android Studio从1.3版本开始说是加强NDK的接入,引入了『com.android.tools.build:gradle-experimental』,从功能使用上来看还是挺好的,比如能在java层自动生成对应的jni方法,并能在java和c\c++之间函数跳转,还能自动生成一些简单的env操作,比如转换String类。但是,这个gradle-experimental的写法和默认的gradle差别太大,到博主发这篇帖子是,AS2.1.2仍然还在开发这个插件。AS 2.2 preview版已经可以支持cmake和mk的编译了,而且cmake作为新建项目时勾选c++支持的默认形式了,难道要放弃gradle-experimental 🙁 。目前还不支持代码提示,跳转这些基本操作,后面的版本应该会加强吧。

另外还有一个比较严重的问题,Android Studio好慢,越来越慢了,经常导入一个项目卡半天,最后只能强制退出。项目编译起来,i7-4790都觉得用起来卡。博主到现在仍然使用最经典的Eclipse Indigo,哈哈。

废话完了,现在帖正题,Eclipse其实也是很强大的,我这里利用Ant脚本来实现自动化编译javah头文件。 继续阅读“Eclipse开发Android-NDK项目自动生成javah头文件”

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Eclipse开发Android-NDK项目自动生成javah头文件

Android使用EGL_image从GPU中读取渲染后的画面,部分手机花屏错位的问题

你已经能使用EGL_image扩展从GPU中读取渲染后的画面了。但你可能会发现,参数一样,有些手机预览时都是正确的,但输出的画面,呈现很有规律的错位花屏,像这样:
预览—-
QQ20160612-0

输出—-
QQ20160612-1

很典型的由于图片stride 和width不同造成的,比较常规的解决方案是

 

[转]Using GL_OES_EGL_image_external on Android

1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.

2. In the fragment shader define a requirement to use the extension:#extension GL_OES_EGL_image_external : require

3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D. Everything below here is all in the C code, no more Java.

4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.

5. Now, this is android specific, as GraphicBuffer.h is defined in the android native source code. new a GraphicBuffer object, and init with with the width, height, pixel format, etc… this is where we’ll be writing the pixels to. Also, the android’s GraphicBuffer object is the one that will allocate the memory for us i.e. call gralloc.

6. To write pixels to the GraphicBuffer, lock it via graphicBuffer->lock(GRALLOC_USAGE_SW_WRITE_RARELY, (void **) &pixels), lock() will give you the address to write the pixels to in the 2nd parameter. Once you have the address, now, you can freely write the data to the address pixels.

7. After you finish writing, unlock it, graphicBuffer->unlock().

8. Now, you need the eglImage object to pass into glEGLImageTargetTexture2DOES in step 4. To create the eglImage using createEGLImageKHR(). http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_base.txt. 4th parameter to eglCreateImageKHR() takes in a EGLClientBuffer, use this (EGLClientBuffer) graphicBuffer->getNativeBuffer();

9. To clean up, use eglDestroyImageKHR(). I think that’s about it. Everything is public API: glEGLImageTargetTexture2DOES(), eglCreateEGLImageKHR(), eglDestroyImageKHR(). gralloc is used, and the implementation of GraphicsBuffer object in the android native source code does that for us.

https://gist.github.com/rexguo/6696123

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: [转]Using GL_OES_EGL_image_external on Android

Android NDK更新到 11

NDK自上次10E后已有10个月更新了11,看了下发行日志,主要这几点值得关注。

  1. 官方推荐从GCC转到Clang了,clang也更新到3.8版。
  2. GCC只保留4.9版了,也不再更新到5.x版。
  3. samples和documentation也不再包含进NDK开发包,都放在了网上。
    NDK Samples :GitHub.
    Doc:Android developer website.
  4. Added Vulkan headers and library to API level N. 这个牛B啊,这不是khronos刚推出的用来替代OpenGL和OpenGL ES的新API么。这都已经可以用啦,后面专门在研究研究。 至少需要Android N的机器。

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Android NDK更新到 11

如何方便的在iOS设备上抓包分析

以前网络协议分析经常是在Android root设备上 adb shell后 用tcpdump抓包,想来ios没越狱应该没有这种神器,可哪知苹果早就提供了方便的工具RVI(Remote Virtual Interface)

  1. 首先获取调试设备的UUID,iTunes里可以比较方便的复制
  2. 打开终端,输入 ?rvictl -s [Your Device’s UDID],成功的话,会显示
    Starting device ********** [SUCCEEDED] 继续阅读“如何方便的在iOS设备上抓包分析”

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: 如何方便的在iOS设备上抓包分析

如何多线程从apple官方下载XCode

自从出了XCodeGhost,都不能愉快的用迅雷或百度网盘下xcode了. 但App Store又更新不了或者龟速.

这个地址给出了 xcode的下载地址:https://developer.apple.com/xcode/download/
发帖时xcode7已正式发布,只能在Mac App Store下载,从给出的beta版7.1可以拿到7的地址
https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.1_beta/Xcode_7.1_beta.dmg

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7/Xcode_7.dmg

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.3/Xcode_7.3.dmg

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_8/Xcode_8.xip

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_8.1/Xcode_8.1.xip
在浏览器中打开后,会要求登陆apple账号,然后浏览器下载工具开始下载,单线程,且有可能中断,好像也有插件支持多线程,但还是…小心为好.
这时你抓包或者Chrome开发者工具的Network标签页监听,把http请求头中的cookie拿到.

在命令行中输入

好了,楼主20M联通基本上快满速.

下载完毕 做MD5 和SHA校验

小心驶得万年船.

 

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: 如何多线程从apple官方下载XCode

[转]解决更新Eclipse后,Android NDK开发找不到头文件的问题

进行Android NDK开发,最好用的还是Eclipse.新版本由于存在找不到头文件的问题,博主之前一直使用Eclipse Indigo. 使用下面的解决方法后,Juno,Kepler,Luna都正常了。

以下摘录自stackoverflow

原帖地址:http://stackoverflow.com/questions/23122934/eclipse-adt-unresolved-inclusion-jni-h

I ran into a similar problem with a working project with Android NDK-based code after updating to Eclipse Kepler. I observed similar things: the header files would correctly be listed under “includes” in the project, the actual build (via ndk-build) worked fine, but Eclipse’s editor couldn’t locate any headers in standard system directories (all headers with < > brackets). 继续阅读“[转]解决更新Eclipse后,Android NDK开发找不到头文件的问题”

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: [转]解决更新Eclipse后,Android NDK开发找不到头文件的问题