Skip to content

Instantly share code, notes, and snippets.

View rogerou's full-sized avatar
💭
I may be slow to respond.

Roger Ou rogerou

💭
I may be slow to respond.
  • Netease
  • GuangZhou
View GitHub Profile
@rogerou
rogerou / gist:88622f3525a3bd58251b4e357fb11735
Created November 25, 2020 08:04 — forked from RangelReale/gist:3e6392289d8ba1a52b6e70cdd7e10282
How to compile ffmpeg + x264 using Visual Studio 2015
##### How to compile ffmpeg + x264 using Visual Studio 2015 #####
##### Building this way will make the DLLs compatible with SEH, so there will be no need to use /SAFESEH:NO when compiling your code #####
##### SOURCES:
### https://pracucci.com/compile-ffmpeg-on-windows-with-visual-studio-compiler.html
### https://gist.github.com/sailfish009/8d6761474f87c074703e187a2bc90bbc
### http://roxlu.com/2016/057/compiling-x264-on-windows-with-msvc
* Download "MSYS2 x86_64" from "http://msys2.github.io" and install into "C:\workspace\windows\msys64"
@rogerou
rogerou / MediaPlayerProxy
Last active January 14, 2017 04:14
A proxy to deal with the android MediaPlayer
package com.opencom.dgc.channel.fm;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.opencom.cache.DiskLruCacheHelper;
import com.opencom.dgc.UrlApi;
import com.opencom.dgc.util.FileIOUtils;
import com.opencom.http.APiException;
@rogerou
rogerou / MusicService
Last active January 14, 2017 04:15
A Service plays music by mediaplayer
package com.opencom.dgc.channel.fm;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.IBinder;
@rogerou
rogerou / PlayerController
Last active January 14, 2017 03:13
A PlayerController
package com.opencom.dgc.channel.fm;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import com.opencom.dgc.entity.Song;
import java.io.IOException;
import java.lang.ref.WeakReference;
@rogerou
rogerou / MediaPlayerStateWrapper.java
Last active January 9, 2017 07:18 — forked from bitops/MediaPlayerStateWrapper.java
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
package com.opencom.dgc.channel.fm;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnInfoListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.util.Log;