text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>L14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT); } if (surface != null && !surface.equals(EGL14.EGL_NO_SURFACE)) { EGL14.eglDestroySurface(display, surface); } if (context != null) { EGL14.eglDestroyContext(display, context); } // EGL14.eglReleaseThread could ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> releaseInternal(); } catch (Throwable e) { Log.e(TAG, "Failed to release placeholder surface", e); } finally { quit(); } return true; default: ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.player; import android.content.ContentResolver; import android.content.Context; import android.media.AudioManager; import android.net.Uri; import android.os.Bundle; import android.os.Message; import android.os.ParcelFileDescriptor; import android.text.TextUtils; import an...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>tch (IllegalAccessException e) { e.printStackTrace(); } return null; } } <|fim_prefix|>package com.shuyu.gs<|fim_middle|>yvideoplayer.player; /** * 播放内核工厂 * Created by guoshuyu on 2018/5/21. */ public class PlayerFactory { private static Class<? extends IPlayerMan...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.player; import android.content.Context; import android.media.AudioManager; import android.media.PlaybackParams; import a<|fim_suffix|>ong nowTimeStamp = System.currentTimeMillis(); long calculationTime = (nowTimeStamp - lastTimeStamp); if (calculationTime ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.preview; /** * Thumbnail metadata for a <|fim_suffix|>Ms = endTimeMs; this.imageUrl = imageUrl; this.cropX = cropX; this.cropY = cropY; this.cropWidth = cropWidth; this.cropHeight = cropHeight; } public long getStartTimeMs...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.preview; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * A simple immutable preview provider backed by sorted frame metadata. */ public class GSYVideoPreviewListProvider implements GSYVideoPreviewProvider { pri...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.preview; import java.util.List; /** * Provides preview frame metadata for a video position. */ public interface GSYVideoPreviewProvider { GSYVideoPreviewFrame getPreviewFrame(long positionMs); List<GSYVideoP<|fim_suffix|>d release(); } <|fim_middle|>reviewFra...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>tatic GSYVideoPreviewProvider parse(String vttContent, String baseUrl) { return new GSYVideoPreviewListProvider(parseFrames(vttContent, baseUrl)); } public static List<GSYVideoPreviewFrame> parseFrames(String vttContent, String baseUrl) { List<GSYVideoPreviewFrame> frames = new Ar...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>* 设置滤镜效果 */ public void setEffectFilter(GSYVideoGLView.ShaderInterface effectFilter) { if (mShowView != null) mShowView.setGLEffectFilter(effectFilter); } /*************************ShowView function end *************************/ /*************************commo...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Attempts to auto-fix the video based on histogram equalization. * * @author sheraz.khilji */ public class AutoFixEffect implements S...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView; /** * Barrel类型模糊 * Created by guoshuyu on 2017/9/16. */ public class BarrelBlurEffect implements GSYVideoGLView.ShaderInterface { private int countLevel = 5; ...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * 黑白滤镜, * Converts the video into black and white colors * * @author sheraz.khilji */ public class BlackAndWhiteEffect implements ShaderInterface ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Adjusts the brightness of the video. * * @author sheraz.khilji */ public class BrightnessEffect implements ShaderInterface { p...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLVi<|fim_suffix|>lic class ContrastEffect implements ShaderInterface { private float contrast; /** * Initialize Effect * * @param contrast Ra...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfac<|fim_suffix|>sTexture;\n" + "varying vec2 vTextureCoord;\n" + "void main() {\n" + " vec4 color = texture2D(sTexture, vTextureCoord);\n" + " vec3 ncolor = vec3(0.0, 0.0, 0.0);\n...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; import java.util.Date; import java.util.Random; /** * Applies black and white documentary style effect on video.. * * @author sheraz.khilji */ public ...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.graphics.Color; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Representation of video using only two color tones. * * @author sheraz.khilji */ public class DuotoneEffect imple...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>f / faded; String multString = "mult = " + mult + ";\n"; String igammaString = "igamma = " + igamma + ";\n"; String shader = "#extension GL_OES_EGL_image_external : require\n" + "precision mediump float;\n" + "uniform samplerExternalOES sTexture;\n...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Apply Gamma Effect on Video being played */ public class GammaEffect implements ShaderInterface { private float gammaValue; /** * Ini...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * 高斯模糊 * Created by guoshuyu on 2017/9/17. */ public class GaussianBlurEffect implements ShaderInterface { public final static int TYPEX = 1; ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> + stepY + " float noise = rand(vTextureCoord + seed + vec2(-stepX, -stepY)) * 0.224;\n" + " noise += rand(vTextureCoord + seed + vec2(-stepX, stepY)) * 0.224;\n" + " noise += rand(vTextureCoord + seed + vec2(stepX, -stepY)) * 0.224;\n" ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>getShader(GLSurfaceView mGlSurfaceView) { String shader = "#extension GL_OES_EGL_image_external : require\n" + "precision mediump float;\n" + "uniform samplerExternalOES sTexture;\n" + "varying vec2 vTextureCoord;\n" + "void main() {\n" ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> + "vec4 color = texture2D(sTexture, vTextureCoord);\n" + "float YPrime = dot(color, kRGBToYPrime);\n" + "float I = dot(color, kRGBToI);\n" + "float Q = dot(color, kRGBToQ);\n" + "float chroma = sqrt (I * I + Q * Q);\n" ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView<|fim_suffix|> = (1.0 - color.r) / 1.0;\n" + " float colorG = (1.0 - color.g) / 1.0;\n" + " float colorB = (1.0 - color.b) / 1...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>x = vTextureCoord.x - 0.5 * stepsizeX;\n" + " coord.y = vTextureCoord.y - stepsizeY;\n" + " nbr_color += texture2D(sTexture, coord).rgb - color.rgb;\n" + " coord.x = vTextureCoord.x - stepsizeX;\n" + " coord.y = vTextureCoord.y + 0.5 * st...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> "#extension GL_OES_EGL_image_external : require\n" + "precision mediump float;\n" + "varying vec2 vTextureCoord;\n" + "uniform samplerExternalOES sTexture;\n" + "void main() {\n" + " gl_FragColor = texture2D(sTexture, vTextureCoord);\n" ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> \n" + " } "; } } <|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView; /** * 重叠 * Created by guoshuyu on 2017/9/17. */ public class OverlayEffect implements GSYV...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Applies Posterization effect to video. * * @author sheraz.khilji */ public class PosterizeEffect implements ShaderInterface { ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView; /** * 简单模糊 * Created by guoshuyu on 2017/9/17. */ public class SampleBlurEffect implements GSYVideoGLView.ShaderInterface { float blur = 1f; pub...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Adjusts color saturation of video. There is still some issue with this * effect. * * @author sheraz.khilji */ public class SaturationEffect impl...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> + matrixString[0] + matrixString[1] + matrixString[2] + matrixString[3] + matrixString[4] + matrixString[5] + matrixString[6] + matrixString[7] + matrixString[8] + " vec4 color = texture2D(sTexture, vTextureCoord);\n" + " vec3 new_co...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.effect; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Sharpens the video. * * @author sheraz.khilji */ public class SharpnessEffect implements ShaderInterface { private int mWidth; private in...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>c4 color = texture2D(sTexture, vTextureCoord);\n" + " vec3 new_color = color.rgb;\n" + " new_color.r = color.r + color.r * ( 1.0 - color.r) * scale;\n" + " new_color.b = color.b - color.b * ( 1.0 - color.b) * scale;\n" + " if (scale > 0.0...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>pa<|fim_suffix|>.graphics.Color; import android.opengl.GLSurfaceView; import com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView.ShaderInterface; /** * Tints the video with specified color.. * * @author sheraz.khilji */ public class TintEffect implements ShaderInterface { private int mTint = 0...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> + (1.30f - (float) Math.sqrt(mScale) * 0.7f) + ";\n"; String shader = "#extension GL_OES_EGL_image_external : require\n" + "precision mediump float;\n" + "uniform samplerExternalOES sTexture;\n" + " float range;\n" + "...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.glrender; import android.annotation.SuppressLint; import android.graphics.Bitmap; import android.graphics.SurfaceTexture; import android.opengl.GLES20; import android.opengl.GLException; import android.opengl.GLSurfaceView; import android.opengl.Matrix; import andr...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.glrender; import android.annotation.SuppressLint; import android.graphics.Bitmap; import android.graphics.SurfaceTexture; import android.opengl.GLES20; import android.opengl.Matrix; import android.view.Surface; import com.shuyu.gsyvideoplayer.render.view.GSYVideoG...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.view; import android.c<|fim_suffix|>aseRenderAll now"); } @Override public void setRenderMode(int mode) { Debuger.printfLog(getClass().getSimpleName() + " not support setRenderMode now"); } @Override public void setRenderTransform...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.view; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.SurfaceTexture; import android.util.AttributeSet; import android.view.Surface; import android.view.TextureView; import android.view.View; i...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.render.view; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Matrix; import android.opengl.GLSurfaceView; import android.util.AttributeSet; import android.view.Surface; import android.view.View; import andr...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.view; import android.graphics.Bitmap; import android.graphics.Matrix; import android.view.View; import com.shuyu.gsyvideoplayer.listener.GSYVideoShotListener; import com.shuyu.gsyvideoplayer.listener.GSYVideoShotSaveListener; import com.shuyu.gsyvideoplayer.rende...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>urfaceAvailable(Surface surface); }<|fim_prefix|>pac<|fim_middle|>kage com.shuyu.gsyvideoplayer.render.view.listener; import android.view.Surface; /** * GLSurfaceView surface 状态变化回调 * Created by guoshuyu on 2018/1/29. */ public interface GLSurfaceListener { void onS<|endoftext|>
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.view.listener; import com.shuyu.gsyvideoplayer.render.glrender.GSYVi<|fim_suffix|> * @param Error 错误文本 * @param code 错误代码 * @param byChangedRenderError 错误是因为切换effect导致的 */ void onError(GSYVideoGLViewBaseRender render, String Error, int code, ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.render.view.listener; import android.view.Surface; /** * Sur<|fim_suffix|>id onSurfaceAvailable(Surface surface); void onSurfaceSizeChanged(Surface surface, int width, int height); boolean onSurfaceDestroyed(Surface surface); void onSurfaceUpdated(Surface...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class GSYSrtSubtitleParser implements GSYSubtitleParser { @Override public List<GSYSubtitleCue> parse(String text) { List<GSYSubtitleCue> cues = new ArrayLi...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> } GSYSubtitleSource first = sources.get(0); for (GSYSubtitleSource source : sources) { if (source.isDefault()) { first = source; break; } } loadSource(first); } private void loadSource(final GSYSubtitle...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>p<|fim_suffix|>rn 1; } return 0; } } <|fim_middle|>ackage com.shuyu.gsyvideoplayer.subtitle; public class GSYSubtitleCue implements Comparable<GSYSubtitleCue> { private final long startTimeMs; private final long endTimeMs; private final String text; public GSYSubtitl...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import android.content.Context; import android.net.Uri; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import com.shuyu.gsyvideoplayer.utils.Debuger; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream;...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import java.util.Locale; public final class GSYSubtitleMime { public static final String APPLICATION_SUBRIP = "application/x-subrip"; public static final String TEXT_VTT = "text/vtt"; private GSYSubtitleMime() { } public static String inf...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>eCue> parse(String text); } <|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import java.util.List; pu<|fim_middle|>blic interface GSYSubtitleParser { List<GSYSubtitl<|endoftext|>
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>atic GSYSubtitleParser create(String mimeType) { if (GSYSubtitleMime.isWebVtt(mimeType)) { return new GSYWebVttSubtitleParser(); } return new GSYSrtSubtitleParser(); } } <|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; public final class GSYSubtitleParserFa...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class GSYSubtitleProvider { private final List<GSYSubtitleCue> cues; public GSYSubtitleProvider(List<GSYSubtitleCue> cues) { this.cues = cues == null ? new...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>return this; } public Builder setDefault(boolean aDefault) { isDefault = aDefault; return this; } public Builder setHeaders(Map<String, String> headers) { if (headers != null) { this.headers = new HashMap<>(headers); ...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.subtitle; import android.graphics.Color; import android.view.Gravity; public class GSYSubtitleStyle { private final int textColor; private final float textSizeSp; private final int backgroundColor; private final int shadowColor; private final float shadowRadius; ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>().replace(',', '.'); String[] parts = normalized.split(":"); if (parts.length < 2) { return 0; } long hours = 0; long minutes; String secondsPart; if (parts.length == 3) { hours = parseLong(parts[0]); minutes = p...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>plyDimension( TypedValue.COMPLEX_UNIT_DIP, style.getHorizontalMarginDp(), getResources().getDisplayMetrics()); int verticalMargin = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, style.getVerticalMarginDp(), get...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class GSYWebVttSubtitleParser implements GSYSubtitleParser { @Override public List<GSYSubtitleCue> parse(String text) { List<GSYSubtitleCue> cues = new Arra...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>ount > 0) { outs.write(a_count); outs.write(accum, 0, a_count); a_count = 0; } } final int MAXCODE(int n_bits) { return (1 << n_bits) - 1; } // ---------------------------------------------------------------------------- // Return t...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>rapper(context).getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav // bar | View.SYSTEM_UI_FLAG_IMMERSIVE); } else { C...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> if (DEBUG_TAG) { if (!TextUtils.isEmpty(log)) Log.e(LOG_TAG, log); } } public static void printfError(String Tag, String log) { if (DEBUG_TAG) { if (!TextUtils.isEmpty(log)) Log.e(Tag, log); } } publi...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> if (!f.isDirectory() && f.exists()) { // 判断是否存在 try { f.delete(); } catch (Exception e) { e.printStackTrace(); } } } } } public static void saveBi...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import android.content.Context; import android.media.AudioManager; import android.os.Handler; import android.os.Looper; import java.lang.ref.WeakReference; /** * 音频焦点管理器 - 解决内存泄漏和重复请求问题 * Audio Focus Manager - Solves memory leaks and duplicate request issues *...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>d onAudioFocusGain() { gotGain = true; Debuger.printfLog(TAG + ": Test listener received audio focus gain"); } @Override public void onAudioFocusLoss() { gotLoss = true; Debuger.printfLog(TAG + ": Test listener received audio...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>oolean isPlayView(int position, String tag) { return mPlayPosition == position && TAG.equals(tag); } private boolean isCurrentViewPlaying(int position, String tag) { return isPlayView(position, tag); } private boolean removeWindowContainer() { if (mWindowViewConta...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>ART_MEDIA_CODEC_FLAG = false; } /** * 使能硬解码渲染优化 */ public static void enableMediaCodecTexture() { sTextureMediaPlay = true; } /** * 关闭硬解码渲染优化 */ public static void disableMediaCodecTexture() { sTextureMediaPlay = false; } /** * 是否...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.ThumbnailUtils; import com.shuyu.gsyvideoplayer.listener.GSYVideoGifSaveListener; import com.shuyu.gsyvideoplayer.listener.GSYVideoShotSaveListener; import com.shuyu.gsyvid...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.Point; import android.os.Handler; import android.text.TextUtils; import android.view.Gravity; import android.view.View; import android.view.ViewGroup...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>ideoHeight > 0) { int widthSpecMode = View.MeasureSpec.getMode(widthMeasureSpec); int widthSpecSize = View.MeasureSpec.getSize(widthMeasureSpec); int heightSpecMode = View.MeasureSpec.getMode(heightMeasureSpec); int heightSpecSize = View.MeasureSpec.getSize(...
fim
CarGuo/GSYVideoPlayer
java
package com.shuyu.gsyvideoplayer.utils; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.net.NetworkInfo; import androidx.core.net.ConnectivityManagerCompat; /** * Modu...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> } else { netType = NETWORK_UNKNOWN; } break; } } else { netType = NETWORK_UNKNOWN; } } return netType; } /** * 获取当前的网络类型(WIFI,2G,3G,...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; /** * 处理屏幕旋转的配置 */ public class OrientationOption { private int mNormalLandAngleStart = 230; private int mNormalLandAngleEnd = 310; private int mNormalPortraitAngleStart = 30; private int mNormalPortraitAngleEnd = 330; private int mReverse...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; import android.os.Build; import android.provider.Settings; import android.view.OrientationEventListener; import android.view...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import android.content.Context; import android.content.res.AssetFileDescriptor; import android.net.Uri; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import tv.danmaku.ijk.media...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.utils; import java.io.BufferedInputStream; import java.io.IOException; import tv.danmaku.ijk.media.player.misc.IMediaDataSource; /** * @author : Gouzhong * 视频元数据输入流数据源 */ public class StreamDataSourceProvider implements IMediaDataSource { private final BufferedI...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>d removeFullWindowViewOnly() { ViewGroup vp = (ViewGroup) (CommonUtil.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT); View old = vp.findViewById(getFullId()); if (old != null) { if (old.getParent() != null) { ViewGroup viewGroup =...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video; import android.content.Context; import android.graphics.Color; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.s...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>osition); mSaveChangeViewTIme = 0; setUp(mUriList, mCache, mPlayPosition, null, mMapHeadData, false); if (!TextUtils.isEmpty(gsyVideoModel.getTitle()) && mTitleTextView != null) { mTitleTextView.setText(gsyVideoModel.getTitle()); } ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video; import android.content.Context; import android.util.AttributeSet; import android.widget.ImageView; import com.shuyu.gsyvideoplayer.R; /** * Created by guoshuyu on 2017/4/1. * 使用正常播放按键和loading的播放器 */ public class NormalGSYVideoPlayer extends StandardGSYVideoPl...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> setViewShowState(mTopContainer, INVISIBLE); setViewShowState(mBottomContainer, INVISIBLE); setViewShowState(mStartButton, INVISIBLE); setViewShowState(mLoadingProgressBar, INVISIBLE); setViewShowState(mThumbImageViewLayout, INVISIBLE); setViewShowState(mBottom...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video.base; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Color; import android.graphics.Point; import android.os.Handler; import android.util.Attribut...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video.base; import android.content.Context; import android.graphics.Bitmap; import androidx.annotation.AttrRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.Surface; import android.view.Text...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video.base; import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.os.Handler; import android.os.Looper; import androidx.annotation.AttrRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video.base; import android.content.Context; import android.util.AttributeSet; import com.shuyu.gsyvideoplayer.GSYVideoManager; /** * 兼容的空View,目前用于 GSYVideoManager的设置 * Created by shu<|fim_suffix|> super(context, attrs, defStyleAttr); } /******************...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.video.base; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.RectF; import android.media.AudioManager; import android.media.MediaPlayer; import android.os.Build; import andro...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>ayer(); /** * 针对某些内核,缓冲百分比 */ int getBufferedPercentage(); /** * 是否播放器 */ void releaseMediaPlayer(); void setCurrentVideoHeight(int currentVideoHeight); void setCurrentVideoWidth(int currentVideoWidth); int getCurrentVideoWidth(); int getCurrentVid...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.view; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer; /** * 小窗口触摸移动 */ public class Small<|fim_suffix|>arams.leftMargin >= mMarginLeft) { l...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> " mb"; case KB: return " kb"; case B: return " b"; } return " b"; } public void setDownloadConfig(int downloadTime, double downloadFileSize, DownloadUnit unit) { mDownloadTime = downloadTime; mTotalSize = dow...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|> //mDstPath.lineTo(0 ,0); mPathMeasure.getSegment(10 * mCircleRadius * (mFraction - 1) , mPathLength , mDstPath, true); canvas.drawPath(mDstPath, mPaint); } } public void play() { if (mCurrentState == STATE...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>se( vtt, "https://stdlwcdn.lwcdn.com/i/asset/160p.vtt"); Assert.assertEquals(2, provider.getFrames().size()); GSYVideoPreviewFrame frame = provider.getPreviewFrame(1500); Assert.assertNotNull(frame); Assert.assertEquals("https://stdlwcdn.lwc...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.shuyu.gsyvideoplayer.subtitle; import org.junit.Assert; import org.junit.Test; import java.util.List; public class GSYSubtitleParserTest { @Test public void parseSrtWithCommaTime() { String srt = "1\n" + "00:00:01,000 --> 00:00:02,500\n" + "hello\n" ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>pa<|fim_suffix|>e; import java.io.ByteArrayInputStream; import java.util.Arrays; /** * Simple memory based {@link Cache} implementation. * * @author Alexey Danilov (danikula@gmail.com). */ public class ByteArrayCache implements Cache { private volatile byte[] data; private volatile boolean ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.danikula.videocache; import java.io.ByteArrayInputStream; /** * Simple memory based {@link Source} implementation. * * @author Alexey Danilov (danikula@gmail.com). */ public class ByteArraySource implements Source { private final byte[] data; private ByteArrayInputStream arrayIn...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.danikula.videocache; /** * Cache for proxy. * * @author Alexey Danilov (danikula@gmail.com). */ public interface Cache { long available() throws ProxyCacheExc<|fim_suffix|> void close() throws ProxyCacheException; void complete() throws ProxyCacheException; boolean isCom...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>File, String url, int percentsAvailable); } <|fim_prefix|>package com.danikula.videocache; import java.io.File; /** * Listener for cache availability. * * @author Egor Makovsky (yahor.makouski@gmail.com) * @author Alexey Danilov (danikula@gmail.com). */ public interface Ca<|fim_middle|>cheListener ...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>nfig(File cacheRoot, FileNameGenerator fileNameGenerator, DiskUsage diskUsage, SourceInfoStorage sourceInfoStorage, HeaderInjector headerInjector, HostnameVerifier v, TrustManager[] trustAllCerts) { this.cacheRoot = cacheRoot; this.fileNameGenerator = fileNameGenerator; this.diskUs...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.danikula.videocache; import static com.danikula.videocache.Preconditions.checkNotNull; import android.text.TextUtils; import androidx.annotation.NonNull; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.danikula.videocache; import static com.danikula.videocache.ProxyCacheUtils.DEFAULT_BUFFER_SIZE; import android.text.TextUtils; import com.danikula.videocache.file.FileCache; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.Socket...
fim
CarGuo/GSYVideoPlayer
java
<|fim_prefix|>package com.danikula.videocache; import android.app.Activity; import android.text.TextUtils; import android.util.Log; import android.widget.Toast; /** * Created by guoshuyu on 2018/2/7. */ public class HttpProxyCacheDebuger { static final String LOG_TAG = "HttpProxyCacheDebuger"; static boo...
fim
CarGuo/GSYVideoPlayer
java
<|fim_suffix|>(cacheListener); } catch (ProxyCacheException e) { HttpProxyCacheDebuger.printfWarning("Error registering cache listener", e.getMessage()); } } } public void unregisterCacheListener(CacheListener cacheListener, String url) { checkAllNotNull(...
fim
CarGuo/GSYVideoPlayer
java