id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
60,100
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java
CompositeType.checkForWellFormedVariableLengthDataEncoding
public void checkForWellFormedVariableLengthDataEncoding(final Node node) { final EncodedDataType lengthType = (EncodedDataType)containedTypeByNameMap.get("length"); if (lengthType == null) { XmlSchemaParser.handleError(node, "composite for variable length data encoding must hav...
java
public void checkForWellFormedVariableLengthDataEncoding(final Node node) { final EncodedDataType lengthType = (EncodedDataType)containedTypeByNameMap.get("length"); if (lengthType == null) { XmlSchemaParser.handleError(node, "composite for variable length data encoding must hav...
[ "public", "void", "checkForWellFormedVariableLengthDataEncoding", "(", "final", "Node", "node", ")", "{", "final", "EncodedDataType", "lengthType", "=", "(", "EncodedDataType", ")", "containedTypeByNameMap", ".", "get", "(", "\"length\"", ")", ";", "if", "(", "lengt...
Check the composite for being a well formed variable length data encoding. This means that there are the fields "length" and "varData" present. @param node of the XML for this composite
[ "Check", "the", "composite", "for", "being", "a", "well", "formed", "variable", "length", "data", "encoding", ".", "This", "means", "that", "there", "are", "the", "fields", "length", "and", "varData", "present", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java#L235-L268
60,101
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java
CompositeType.checkForWellFormedMessageHeader
public void checkForWellFormedMessageHeader(final Node node) { final boolean shouldGenerateInterfaces = Boolean.getBoolean(JAVA_GENERATE_INTERFACES); final EncodedDataType blockLengthType = (EncodedDataType)containedTypeByNameMap.get("blockLength"); final EncodedDataType templateIdType = (E...
java
public void checkForWellFormedMessageHeader(final Node node) { final boolean shouldGenerateInterfaces = Boolean.getBoolean(JAVA_GENERATE_INTERFACES); final EncodedDataType blockLengthType = (EncodedDataType)containedTypeByNameMap.get("blockLength"); final EncodedDataType templateIdType = (E...
[ "public", "void", "checkForWellFormedMessageHeader", "(", "final", "Node", "node", ")", "{", "final", "boolean", "shouldGenerateInterfaces", "=", "Boolean", ".", "getBoolean", "(", "JAVA_GENERATE_INTERFACES", ")", ";", "final", "EncodedDataType", "blockLengthType", "=",...
Check the composite for being a well formed message headerStructure encoding. This means that there are the fields "blockLength", "templateId" and "version" present. @param node of the XML for this composite
[ "Check", "the", "composite", "for", "being", "a", "well", "formed", "message", "headerStructure", "encoding", ".", "This", "means", "that", "there", "are", "the", "fields", "blockLength", "templateId", "and", "version", "present", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java#L304-L326
60,102
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java
CompositeType.checkForValidOffsets
public void checkForValidOffsets(final Node node) { int offset = 0; for (final Type edt : containedTypeByNameMap.values()) { final int offsetAttribute = edt.offsetAttribute(); if (-1 != offsetAttribute) { if (offsetAttribute < offset) ...
java
public void checkForValidOffsets(final Node node) { int offset = 0; for (final Type edt : containedTypeByNameMap.values()) { final int offsetAttribute = edt.offsetAttribute(); if (-1 != offsetAttribute) { if (offsetAttribute < offset) ...
[ "public", "void", "checkForValidOffsets", "(", "final", "Node", "node", ")", "{", "int", "offset", "=", "0", ";", "for", "(", "final", "Type", "edt", ":", "containedTypeByNameMap", ".", "values", "(", ")", ")", "{", "final", "int", "offsetAttribute", "=", ...
Check the composite for any specified offsets and validate they are correctly specified. @param node of the XML for this composite
[ "Check", "the", "composite", "for", "any", "specified", "offsets", "and", "validate", "they", "are", "correctly", "specified", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java#L374-L396
60,103
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java
Generators.findFirst
public static Token findFirst(final String name, final List<Token> tokens, final int index) { for (int i = index, size = tokens.size(); i < size; i++) { final Token token = tokens.get(i); if (token.name().equals(name)) { return token; }...
java
public static Token findFirst(final String name, final List<Token> tokens, final int index) { for (int i = index, size = tokens.size(); i < size; i++) { final Token token = tokens.get(i); if (token.name().equals(name)) { return token; }...
[ "public", "static", "Token", "findFirst", "(", "final", "String", "name", ",", "final", "List", "<", "Token", ">", "tokens", ",", "final", "int", "index", ")", "{", "for", "(", "int", "i", "=", "index", ",", "size", "=", "tokens", ".", "size", "(", ...
Find the first token with a given name from an index inclusive. @param name to search for. @param tokens to search. @param index from which to search. @return first found {@link Token} or throw a {@link IllegalStateException} if not found.
[ "Find", "the", "first", "token", "with", "a", "given", "name", "from", "an", "index", "inclusive", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java#L91-L103
60,104
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java
OtfHeaderDecoder.getTemplateId
public int getTemplateId(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + templateIdOffset, templateIdType, templateIdByteOrder); }
java
public int getTemplateId(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + templateIdOffset, templateIdType, templateIdByteOrder); }
[ "public", "int", "getTemplateId", "(", "final", "DirectBuffer", "buffer", ",", "final", "int", "bufferOffset", ")", "{", "return", "Types", ".", "getInt", "(", "buffer", ",", "bufferOffset", "+", "templateIdOffset", ",", "templateIdType", ",", "templateIdByteOrder...
Get the template id from the message header. @param buffer from which to read the value. @param bufferOffset in the buffer at which the message header begins. @return the value of the template id.
[ "Get", "the", "template", "id", "from", "the", "message", "header", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java#L106-L109
60,105
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java
OtfHeaderDecoder.getSchemaId
public int getSchemaId(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + schemaIdOffset, schemaIdType, schemaIdByteOrder); }
java
public int getSchemaId(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + schemaIdOffset, schemaIdType, schemaIdByteOrder); }
[ "public", "int", "getSchemaId", "(", "final", "DirectBuffer", "buffer", ",", "final", "int", "bufferOffset", ")", "{", "return", "Types", ".", "getInt", "(", "buffer", ",", "bufferOffset", "+", "schemaIdOffset", ",", "schemaIdType", ",", "schemaIdByteOrder", ")"...
Get the schema id number from the message header. @param buffer from which to read the value. @param bufferOffset in the buffer at which the message header begins. @return the value of the schema id number.
[ "Get", "the", "schema", "id", "number", "from", "the", "message", "header", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java#L118-L121
60,106
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java
OtfHeaderDecoder.getSchemaVersion
public int getSchemaVersion(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + schemaVersionOffset, schemaVersionType, schemaVersionByteOrder); }
java
public int getSchemaVersion(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + schemaVersionOffset, schemaVersionType, schemaVersionByteOrder); }
[ "public", "int", "getSchemaVersion", "(", "final", "DirectBuffer", "buffer", ",", "final", "int", "bufferOffset", ")", "{", "return", "Types", ".", "getInt", "(", "buffer", ",", "bufferOffset", "+", "schemaVersionOffset", ",", "schemaVersionType", ",", "schemaVers...
Get the schema version number from the message header. @param buffer from which to read the value. @param bufferOffset in the buffer at which the message header begins. @return the value of the schema version number.
[ "Get", "the", "schema", "version", "number", "from", "the", "message", "header", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java#L130-L133
60,107
real-logic/simple-binary-encoding
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java
OtfHeaderDecoder.getBlockLength
public int getBlockLength(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + blockLengthOffset, blockLengthType, blockLengthByteOrder); }
java
public int getBlockLength(final DirectBuffer buffer, final int bufferOffset) { return Types.getInt(buffer, bufferOffset + blockLengthOffset, blockLengthType, blockLengthByteOrder); }
[ "public", "int", "getBlockLength", "(", "final", "DirectBuffer", "buffer", ",", "final", "int", "bufferOffset", ")", "{", "return", "Types", ".", "getInt", "(", "buffer", ",", "bufferOffset", "+", "blockLengthOffset", ",", "blockLengthType", ",", "blockLengthByteO...
Get the block length of the root block in the message. @param buffer from which to read the value. @param bufferOffset in the buffer at which the message header begins. @return the length of the root block in the coming message.
[ "Get", "the", "block", "length", "of", "the", "root", "block", "in", "the", "message", "." ]
9a7be490c86d98f0e430e4189bc6c8c4fbef658b
https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/OtfHeaderDecoder.java#L142-L145
60,108
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.initialize
public static void initialize(AlbumConfig albumConfig) { if (sAlbumConfig == null) sAlbumConfig = albumConfig; else Log.w("Album", new IllegalStateException("Illegal operation, only allowed to configure once.")); }
java
public static void initialize(AlbumConfig albumConfig) { if (sAlbumConfig == null) sAlbumConfig = albumConfig; else Log.w("Album", new IllegalStateException("Illegal operation, only allowed to configure once.")); }
[ "public", "static", "void", "initialize", "(", "AlbumConfig", "albumConfig", ")", "{", "if", "(", "sAlbumConfig", "==", "null", ")", "sAlbumConfig", "=", "albumConfig", ";", "else", "Log", ".", "w", "(", "\"Album\"", ",", "new", "IllegalStateException", "(", ...
Initialize Album. @param albumConfig {@link AlbumConfig}.
[ "Initialize", "Album", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L106-L109
60,109
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.getAlbumConfig
public static AlbumConfig getAlbumConfig() { if (sAlbumConfig == null) { sAlbumConfig = AlbumConfig.newBuilder(null).build(); } return sAlbumConfig; }
java
public static AlbumConfig getAlbumConfig() { if (sAlbumConfig == null) { sAlbumConfig = AlbumConfig.newBuilder(null).build(); } return sAlbumConfig; }
[ "public", "static", "AlbumConfig", "getAlbumConfig", "(", ")", "{", "if", "(", "sAlbumConfig", "==", "null", ")", "{", "sAlbumConfig", "=", "AlbumConfig", ".", "newBuilder", "(", "null", ")", ".", "build", "(", ")", ";", "}", "return", "sAlbumConfig", ";",...
Get the album configuration.
[ "Get", "the", "album", "configuration", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L114-L119
60,110
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.camera
public static Camera<ImageCameraWrapper, VideoCameraWrapper> camera(android.support.v4.app.Fragment fragment) { return new AlbumCamera(fragment.getContext()); }
java
public static Camera<ImageCameraWrapper, VideoCameraWrapper> camera(android.support.v4.app.Fragment fragment) { return new AlbumCamera(fragment.getContext()); }
[ "public", "static", "Camera", "<", "ImageCameraWrapper", ",", "VideoCameraWrapper", ">", "camera", "(", "android", ".", "support", ".", "v4", ".", "app", ".", "Fragment", "fragment", ")", "{", "return", "new", "AlbumCamera", "(", "fragment", ".", "getContext",...
Open the camera from the activity.
[ "Open", "the", "camera", "from", "the", "activity", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L250-L252
60,111
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.image
public static Choice<ImageMultipleWrapper, ImageSingleWrapper> image(android.support.v4.app.Fragment fragment) { return new ImageChoice(fragment.getContext()); }
java
public static Choice<ImageMultipleWrapper, ImageSingleWrapper> image(android.support.v4.app.Fragment fragment) { return new ImageChoice(fragment.getContext()); }
[ "public", "static", "Choice", "<", "ImageMultipleWrapper", ",", "ImageSingleWrapper", ">", "image", "(", "android", ".", "support", ".", "v4", ".", "app", ".", "Fragment", "fragment", ")", "{", "return", "new", "ImageChoice", "(", "fragment", ".", "getContext"...
Select images.
[ "Select", "images", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L257-L259
60,112
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.video
public static Choice<VideoMultipleWrapper, VideoSingleWrapper> video(android.support.v4.app.Fragment fragment) { return new VideoChoice(fragment.getContext()); }
java
public static Choice<VideoMultipleWrapper, VideoSingleWrapper> video(android.support.v4.app.Fragment fragment) { return new VideoChoice(fragment.getContext()); }
[ "public", "static", "Choice", "<", "VideoMultipleWrapper", ",", "VideoSingleWrapper", ">", "video", "(", "android", ".", "support", ".", "v4", ".", "app", ".", "Fragment", "fragment", ")", "{", "return", "new", "VideoChoice", "(", "fragment", ".", "getContext"...
Select videos.
[ "Select", "videos", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L264-L266
60,113
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/Album.java
Album.album
public static Choice<AlbumMultipleWrapper, AlbumSingleWrapper> album(android.support.v4.app.Fragment fragment) { return new AlbumChoice(fragment.getContext()); }
java
public static Choice<AlbumMultipleWrapper, AlbumSingleWrapper> album(android.support.v4.app.Fragment fragment) { return new AlbumChoice(fragment.getContext()); }
[ "public", "static", "Choice", "<", "AlbumMultipleWrapper", ",", "AlbumSingleWrapper", ">", "album", "(", "android", ".", "support", ".", "v4", ".", "app", ".", "Fragment", "fragment", ")", "{", "return", "new", "AlbumChoice", "(", "fragment", ".", "getContext"...
Select images and videos.
[ "Select", "images", "and", "videos", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/Album.java#L271-L273
60,114
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/data/MediaReader.java
MediaReader.getAllVideo
@WorkerThread public ArrayList<AlbumFolder> getAllVideo() { Map<String, AlbumFolder> albumFolderMap = new HashMap<>(); AlbumFolder allFileFolder = new AlbumFolder(); allFileFolder.setChecked(true); allFileFolder.setName(mContext.getString(R.string.album_all_videos)); scanVid...
java
@WorkerThread public ArrayList<AlbumFolder> getAllVideo() { Map<String, AlbumFolder> albumFolderMap = new HashMap<>(); AlbumFolder allFileFolder = new AlbumFolder(); allFileFolder.setChecked(true); allFileFolder.setName(mContext.getString(R.string.album_all_videos)); scanVid...
[ "@", "WorkerThread", "public", "ArrayList", "<", "AlbumFolder", ">", "getAllVideo", "(", ")", "{", "Map", "<", "String", ",", "AlbumFolder", ">", "albumFolderMap", "=", "new", "HashMap", "<>", "(", ")", ";", "AlbumFolder", "allFileFolder", "=", "new", "Album...
Scan the list of videos in the library.
[ "Scan", "the", "list", "of", "videos", "in", "the", "library", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/data/MediaReader.java#L231-L250
60,115
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/widget/LoadingDialog.java
LoadingDialog.setupViews
public void setupViews(Widget widget) { if (widget.getUiStyle() == Widget.STYLE_LIGHT) { int color = ContextCompat.getColor(getContext(), R.color.albumLoadingDark); mProgressBar.setColorFilter(color); } else { mProgressBar.setColorFilter(widget.getToolBarColor()); ...
java
public void setupViews(Widget widget) { if (widget.getUiStyle() == Widget.STYLE_LIGHT) { int color = ContextCompat.getColor(getContext(), R.color.albumLoadingDark); mProgressBar.setColorFilter(color); } else { mProgressBar.setColorFilter(widget.getToolBarColor()); ...
[ "public", "void", "setupViews", "(", "Widget", "widget", ")", "{", "if", "(", "widget", ".", "getUiStyle", "(", ")", "==", "Widget", ".", "STYLE_LIGHT", ")", "{", "int", "color", "=", "ContextCompat", ".", "getColor", "(", "getContext", "(", ")", ",", ...
Set some properties of the view. @param widget widget.
[ "Set", "some", "properties", "of", "the", "view", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/widget/LoadingDialog.java#L50-L57
60,116
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/api/BasicGalleryWrapper.java
BasicGalleryWrapper.currentPosition
public Returner currentPosition(@IntRange(from = 0, to = Integer.MAX_VALUE) int currentPosition) { this.mCurrentPosition = currentPosition; return (Returner) this; }
java
public Returner currentPosition(@IntRange(from = 0, to = Integer.MAX_VALUE) int currentPosition) { this.mCurrentPosition = currentPosition; return (Returner) this; }
[ "public", "Returner", "currentPosition", "(", "@", "IntRange", "(", "from", "=", "0", ",", "to", "=", "Integer", ".", "MAX_VALUE", ")", "int", "currentPosition", ")", "{", "this", ".", "mCurrentPosition", "=", "currentPosition", ";", "return", "(", "Returner...
Set the show position of List. @param currentPosition the current position.
[ "Set", "the", "show", "position", "of", "List", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/api/BasicGalleryWrapper.java#L75-L78
60,117
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/SystemBar.java
SystemBar.invasionStatusBar
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static void invasionStatusBar(Window window) { View decorView = window.getDecorView(); decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FL...
java
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static void invasionStatusBar(Window window) { View decorView = window.getDecorView(); decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FL...
[ "@", "RequiresApi", "(", "api", "=", "Build", ".", "VERSION_CODES", ".", "LOLLIPOP", ")", "public", "static", "void", "invasionStatusBar", "(", "Window", "window", ")", "{", "View", "decorView", "=", "window", ".", "getDecorView", "(", ")", ";", "decorView",...
Set the content layout full the StatusBar, but do not hide StatusBar.
[ "Set", "the", "content", "layout", "full", "the", "StatusBar", "but", "do", "not", "hide", "StatusBar", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/SystemBar.java#L76-L83
60,118
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/SystemBar.java
SystemBar.setStatusBarDarkFont
public static boolean setStatusBarDarkFont(Window window, boolean darkFont) { if (setMIUIStatusBarFont(window, darkFont)) { setDefaultStatusBarFont(window, darkFont); return true; } else if (setMeizuStatusBarFont(window, darkFont)) { setDefaultStatusBarFont(window, da...
java
public static boolean setStatusBarDarkFont(Window window, boolean darkFont) { if (setMIUIStatusBarFont(window, darkFont)) { setDefaultStatusBarFont(window, darkFont); return true; } else if (setMeizuStatusBarFont(window, darkFont)) { setDefaultStatusBarFont(window, da...
[ "public", "static", "boolean", "setStatusBarDarkFont", "(", "Window", "window", ",", "boolean", "darkFont", ")", "{", "if", "(", "setMIUIStatusBarFont", "(", "window", ",", "darkFont", ")", ")", "{", "setDefaultStatusBarFont", "(", "window", ",", "darkFont", ")"...
Set the status bar to dark.
[ "Set", "the", "status", "bar", "to", "dark", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/SystemBar.java#L114-L124
60,119
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/widget/photoview/PhotoViewAttacher.java
PhotoViewAttacher.setImageViewScaleTypeMatrix
private static void setImageViewScaleTypeMatrix(ImageView imageView) { /** * PhotoView sets its own ScaleType to Matrix, then diverts all calls * setScaleType to this.setScaleType automatically. */ if (null != imageView && !(imageView instanceof IPhotoView)) { if (...
java
private static void setImageViewScaleTypeMatrix(ImageView imageView) { /** * PhotoView sets its own ScaleType to Matrix, then diverts all calls * setScaleType to this.setScaleType automatically. */ if (null != imageView && !(imageView instanceof IPhotoView)) { if (...
[ "private", "static", "void", "setImageViewScaleTypeMatrix", "(", "ImageView", "imageView", ")", "{", "/**\n * PhotoView sets its own ScaleType to Matrix, then diverts all calls\n * setScaleType to this.setScaleType automatically.\n */", "if", "(", "null", "!=", "i...
Sets the ImageView's ScaleType to Matrix.
[ "Sets", "the", "ImageView", "s", "ScaleType", "to", "Matrix", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/widget/photoview/PhotoViewAttacher.java#L105-L115
60,120
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/widget/photoview/PhotoViewAttacher.java
PhotoViewAttacher.updateBaseMatrix
private void updateBaseMatrix(Drawable d) { ImageView imageView = getImageView(); if (null == imageView || null == d) { return; } final float viewWidth = getImageViewWidth(imageView); final float viewHeight = getImageViewHeight(imageView); final int drawableW...
java
private void updateBaseMatrix(Drawable d) { ImageView imageView = getImageView(); if (null == imageView || null == d) { return; } final float viewWidth = getImageViewWidth(imageView); final float viewHeight = getImageViewHeight(imageView); final int drawableW...
[ "private", "void", "updateBaseMatrix", "(", "Drawable", "d", ")", "{", "ImageView", "imageView", "=", "getImageView", "(", ")", ";", "if", "(", "null", "==", "imageView", "||", "null", "==", "d", ")", "{", "return", ";", "}", "final", "float", "viewWidth...
Calculate Matrix for FIT_CENTER @param d - Drawable being displayed
[ "Calculate", "Matrix", "for", "FIT_CENTER" ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/widget/photoview/PhotoViewAttacher.java#L838-L900
60,121
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/api/widget/Widget.java
Widget.getDefaultWidget
public static Widget getDefaultWidget(Context context) { return Widget.newDarkBuilder(context) .statusBarColor(ContextCompat.getColor(context, R.color.albumColorPrimaryDark)) .toolBarColor(ContextCompat.getColor(context, R.color.albumColorPrimary)) .navigationBarC...
java
public static Widget getDefaultWidget(Context context) { return Widget.newDarkBuilder(context) .statusBarColor(ContextCompat.getColor(context, R.color.albumColorPrimaryDark)) .toolBarColor(ContextCompat.getColor(context, R.color.albumColorPrimary)) .navigationBarC...
[ "public", "static", "Widget", "getDefaultWidget", "(", "Context", "context", ")", "{", "return", "Widget", ".", "newDarkBuilder", "(", "context", ")", ".", "statusBarColor", "(", "ContextCompat", ".", "getColor", "(", "context", ",", "R", ".", "color", ".", ...
Create default widget.
[ "Create", "default", "widget", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/api/widget/Widget.java#L348-L365
60,122
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java
AlbumActivity.createView
private int createView() { switch (mWidget.getUiStyle()) { case Widget.STYLE_DARK: { return R.layout.album_activity_album_dark; } case Widget.STYLE_LIGHT: { return R.layout.album_activity_album_light; } default: { ...
java
private int createView() { switch (mWidget.getUiStyle()) { case Widget.STYLE_DARK: { return R.layout.album_activity_album_dark; } case Widget.STYLE_LIGHT: { return R.layout.album_activity_album_light; } default: { ...
[ "private", "int", "createView", "(", ")", "{", "switch", "(", "mWidget", ".", "getUiStyle", "(", ")", ")", "{", "case", "Widget", ".", "STYLE_DARK", ":", "{", "return", "R", ".", "layout", ".", "album_activity_album_dark", ";", "}", "case", "Widget", "."...
Use different layouts depending on the style. @return layout id.
[ "Use", "different", "layouts", "depending", "on", "the", "style", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java#L134-L146
60,123
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java
AlbumActivity.showFolderAlbumFiles
private void showFolderAlbumFiles(int position) { this.mCurrentFolder = position; AlbumFolder albumFolder = mAlbumFolders.get(position); mView.bindAlbumFolder(albumFolder); }
java
private void showFolderAlbumFiles(int position) { this.mCurrentFolder = position; AlbumFolder albumFolder = mAlbumFolders.get(position); mView.bindAlbumFolder(albumFolder); }
[ "private", "void", "showFolderAlbumFiles", "(", "int", "position", ")", "{", "this", ".", "mCurrentFolder", "=", "position", ";", "AlbumFolder", "albumFolder", "=", "mAlbumFolders", ".", "get", "(", "position", ")", ";", "mView", ".", "bindAlbumFolder", "(", "...
Update data source.
[ "Update", "data", "source", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java#L244-L248
60,124
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java
AlbumActivity.showLoadingDialog
private void showLoadingDialog() { if (mLoadingDialog == null) { mLoadingDialog = new LoadingDialog(this); mLoadingDialog.setupViews(mWidget); } if (!mLoadingDialog.isShowing()) { mLoadingDialog.show(); } }
java
private void showLoadingDialog() { if (mLoadingDialog == null) { mLoadingDialog = new LoadingDialog(this); mLoadingDialog.setupViews(mWidget); } if (!mLoadingDialog.isShowing()) { mLoadingDialog.show(); } }
[ "private", "void", "showLoadingDialog", "(", ")", "{", "if", "(", "mLoadingDialog", "==", "null", ")", "{", "mLoadingDialog", "=", "new", "LoadingDialog", "(", "this", ")", ";", "mLoadingDialog", ".", "setupViews", "(", "mWidget", ")", ";", "}", "if", "(",...
Display loading dialog.
[ "Display", "loading", "dialog", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/AlbumActivity.java#L583-L591
60,125
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/api/VideoMultipleWrapper.java
VideoMultipleWrapper.selectCount
public VideoMultipleWrapper selectCount(@IntRange(from = 1, to = Integer.MAX_VALUE) int count) { this.mLimitCount = count; return this; }
java
public VideoMultipleWrapper selectCount(@IntRange(from = 1, to = Integer.MAX_VALUE) int count) { this.mLimitCount = count; return this; }
[ "public", "VideoMultipleWrapper", "selectCount", "(", "@", "IntRange", "(", "from", "=", "1", ",", "to", "=", "Integer", ".", "MAX_VALUE", ")", "int", "count", ")", "{", "this", ".", "mLimitCount", "=", "count", ";", "return", "this", ";", "}" ]
Set the maximum number to be selected. @param count the maximum number.
[ "Set", "the", "maximum", "number", "to", "be", "selected", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/api/VideoMultipleWrapper.java#L56-L59
60,126
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/mvp/BaseActivity.java
BaseActivity.requestPermission
protected void requestPermission(String[] permissions, int code) { if (Build.VERSION.SDK_INT >= 23) { List<String> deniedPermissions = getDeniedPermissions(this, permissions); if (deniedPermissions.isEmpty()) { onPermissionGranted(code); } else { ...
java
protected void requestPermission(String[] permissions, int code) { if (Build.VERSION.SDK_INT >= 23) { List<String> deniedPermissions = getDeniedPermissions(this, permissions); if (deniedPermissions.isEmpty()) { onPermissionGranted(code); } else { ...
[ "protected", "void", "requestPermission", "(", "String", "[", "]", "permissions", ",", "int", "code", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "23", ")", "{", "List", "<", "String", ">", "deniedPermissions", "=", "getDeniedPermis...
Request permission.
[ "Request", "permission", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/mvp/BaseActivity.java#L54-L67
60,127
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java
ThumbnailBuilder.createThumbnailForImage
@WorkerThread @Nullable public String createThumbnailForImage(String imagePath) { if (TextUtils.isEmpty(imagePath)) return null; File inFile = new File(imagePath); if (!inFile.exists()) return null; File thumbnailFile = randomPath(imagePath); if (thumbnailFile.exists())...
java
@WorkerThread @Nullable public String createThumbnailForImage(String imagePath) { if (TextUtils.isEmpty(imagePath)) return null; File inFile = new File(imagePath); if (!inFile.exists()) return null; File thumbnailFile = randomPath(imagePath); if (thumbnailFile.exists())...
[ "@", "WorkerThread", "@", "Nullable", "public", "String", "createThumbnailForImage", "(", "String", "imagePath", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "imagePath", ")", ")", "return", "null", ";", "File", "inFile", "=", "new", "File", "(", ...
Create a thumbnail for the image. @param imagePath image path. @return thumbnail path.
[ "Create", "a", "thumbnail", "for", "the", "image", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java#L60-L89
60,128
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java
ThumbnailBuilder.createThumbnailForVideo
@WorkerThread @Nullable public String createThumbnailForVideo(String videoPath) { if (TextUtils.isEmpty(videoPath)) return null; File thumbnailFile = randomPath(videoPath); if (thumbnailFile.exists()) return thumbnailFile.getAbsolutePath(); try { MediaMetadataRetrie...
java
@WorkerThread @Nullable public String createThumbnailForVideo(String videoPath) { if (TextUtils.isEmpty(videoPath)) return null; File thumbnailFile = randomPath(videoPath); if (thumbnailFile.exists()) return thumbnailFile.getAbsolutePath(); try { MediaMetadataRetrie...
[ "@", "WorkerThread", "@", "Nullable", "public", "String", "createThumbnailForVideo", "(", "String", "videoPath", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "videoPath", ")", ")", "return", "null", ";", "File", "thumbnailFile", "=", "randomPath", "(...
Create a thumbnail for the video. @param videoPath video path. @return thumbnail path.
[ "Create", "a", "thumbnail", "for", "the", "video", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java#L97-L119
60,129
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java
ThumbnailBuilder.readImageFromPath
@Nullable public static Bitmap readImageFromPath(String imagePath, int width, int height) { File imageFile = new File(imagePath); if (imageFile.exists()) { try { BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(imageFile)); Bit...
java
@Nullable public static Bitmap readImageFromPath(String imagePath, int width, int height) { File imageFile = new File(imagePath); if (imageFile.exists()) { try { BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(imageFile)); Bit...
[ "@", "Nullable", "public", "static", "Bitmap", "readImageFromPath", "(", "String", "imagePath", ",", "int", "width", ",", "int", "height", ")", "{", "File", "imageFile", "=", "new", "File", "(", "imagePath", ")", ";", "if", "(", "imageFile", ".", "exists",...
Deposit in the province read images, mViewWidth is high, the greater the picture clearer, but also the memory. @param imagePath pictures in the path of the memory card. @return bitmap.
[ "Deposit", "in", "the", "province", "read", "images", "mViewWidth", "is", "high", "the", "greater", "the", "picture", "clearer", "but", "also", "the", "memory", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/app/album/data/ThumbnailBuilder.java#L132-L177
60,130
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.getAlbumRootPath
@NonNull public static File getAlbumRootPath(Context context) { if (sdCardIsAvailable()) { return new File(Environment.getExternalStorageDirectory(), CACHE_DIRECTORY); } else { return new File(context.getFilesDir(), CACHE_DIRECTORY); } }
java
@NonNull public static File getAlbumRootPath(Context context) { if (sdCardIsAvailable()) { return new File(Environment.getExternalStorageDirectory(), CACHE_DIRECTORY); } else { return new File(context.getFilesDir(), CACHE_DIRECTORY); } }
[ "@", "NonNull", "public", "static", "File", "getAlbumRootPath", "(", "Context", "context", ")", "{", "if", "(", "sdCardIsAvailable", "(", ")", ")", "{", "return", "new", "File", "(", "Environment", ".", "getExternalStorageDirectory", "(", ")", ",", "CACHE_DIRE...
Get a writable root directory. @param context context. @return {@link File}.
[ "Get", "a", "writable", "root", "directory", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L66-L73
60,131
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.sdCardIsAvailable
public static boolean sdCardIsAvailable() { if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { return Environment.getExternalStorageDirectory().canWrite(); } else return false; }
java
public static boolean sdCardIsAvailable() { if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { return Environment.getExternalStorageDirectory().canWrite(); } else return false; }
[ "public", "static", "boolean", "sdCardIsAvailable", "(", ")", "{", "if", "(", "Environment", ".", "getExternalStorageState", "(", ")", ".", "equals", "(", "Environment", ".", "MEDIA_MOUNTED", ")", ")", "{", "return", "Environment", ".", "getExternalStorageDirector...
SD card is available. @return true when available, other wise is false.
[ "SD", "card", "is", "available", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L80-L85
60,132
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.randomMediaPath
@NonNull private static String randomMediaPath(File bucket, String extension) { if (bucket.exists() && bucket.isFile()) bucket.delete(); if (!bucket.exists()) bucket.mkdirs(); String outFilePath = AlbumUtils.getNowDateTime("yyyyMMdd_HHmmssSSS") + "_" + getMD5ForString(UUID.randomUUID().toStr...
java
@NonNull private static String randomMediaPath(File bucket, String extension) { if (bucket.exists() && bucket.isFile()) bucket.delete(); if (!bucket.exists()) bucket.mkdirs(); String outFilePath = AlbumUtils.getNowDateTime("yyyyMMdd_HHmmssSSS") + "_" + getMD5ForString(UUID.randomUUID().toStr...
[ "@", "NonNull", "private", "static", "String", "randomMediaPath", "(", "File", "bucket", ",", "String", "extension", ")", "{", "if", "(", "bucket", ".", "exists", "(", ")", "&&", "bucket", ".", "isFile", "(", ")", ")", "bucket", ".", "delete", "(", ")"...
Generates a random file path using the specified suffix name in the specified directory. @param bucket specify the directory. @param extension extension. @return file path.
[ "Generates", "a", "random", "file", "path", "using", "the", "specified", "suffix", "name", "in", "the", "specified", "directory", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L252-L259
60,133
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.getMimeType
public static String getMimeType(String url) { String extension = getExtension(url); if (!MimeTypeMap.getSingleton().hasExtension(extension)) return ""; String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); return TextUtils.isEmpty(mimeType) ? "" : mimeType; ...
java
public static String getMimeType(String url) { String extension = getExtension(url); if (!MimeTypeMap.getSingleton().hasExtension(extension)) return ""; String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); return TextUtils.isEmpty(mimeType) ? "" : mimeType; ...
[ "public", "static", "String", "getMimeType", "(", "String", "url", ")", "{", "String", "extension", "=", "getExtension", "(", "url", ")", ";", "if", "(", "!", "MimeTypeMap", ".", "getSingleton", "(", ")", ".", "hasExtension", "(", "extension", ")", ")", ...
Get the mime type of the file in the url. @param url file url. @return mime type.
[ "Get", "the", "mime", "type", "of", "the", "file", "in", "the", "url", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L279-L285
60,134
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.getExtension
public static String getExtension(String url) { url = TextUtils.isEmpty(url) ? "" : url.toLowerCase(); String extension = MimeTypeMap.getFileExtensionFromUrl(url); return TextUtils.isEmpty(extension) ? "" : extension; }
java
public static String getExtension(String url) { url = TextUtils.isEmpty(url) ? "" : url.toLowerCase(); String extension = MimeTypeMap.getFileExtensionFromUrl(url); return TextUtils.isEmpty(extension) ? "" : extension; }
[ "public", "static", "String", "getExtension", "(", "String", "url", ")", "{", "url", "=", "TextUtils", ".", "isEmpty", "(", "url", ")", "?", "\"\"", ":", "url", ".", "toLowerCase", "(", ")", ";", "String", "extension", "=", "MimeTypeMap", ".", "getFileEx...
Get the file extension in url. @param url file url. @return extension.
[ "Get", "the", "file", "extension", "in", "url", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L293-L297
60,135
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.convertDuration
@NonNull public static String convertDuration(@IntRange(from = 1) long duration) { duration /= 1000; int hour = (int) (duration / 3600); int minute = (int) ((duration - hour * 3600) / 60); int second = (int) (duration - hour * 3600 - minute * 60); String hourValue = ""; ...
java
@NonNull public static String convertDuration(@IntRange(from = 1) long duration) { duration /= 1000; int hour = (int) (duration / 3600); int minute = (int) ((duration - hour * 3600) / 60); int second = (int) (duration - hour * 3600 - minute * 60); String hourValue = ""; ...
[ "@", "NonNull", "public", "static", "String", "convertDuration", "(", "@", "IntRange", "(", "from", "=", "1", ")", "long", "duration", ")", "{", "duration", "/=", "1000", ";", "int", "hour", "=", "(", "int", ")", "(", "duration", "/", "3600", ")", ";...
Time conversion. @param duration ms. @return such as: {@code 00:00:00}, {@code 00:00}.
[ "Time", "conversion", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L391-L429
60,136
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.getMD5ForString
public static String getMD5ForString(String content) { StringBuilder md5Buffer = new StringBuilder(); try { MessageDigest digest = MessageDigest.getInstance("MD5"); byte[] tempBytes = digest.digest(content.getBytes()); int digital; for (int i = 0; i < temp...
java
public static String getMD5ForString(String content) { StringBuilder md5Buffer = new StringBuilder(); try { MessageDigest digest = MessageDigest.getInstance("MD5"); byte[] tempBytes = digest.digest(content.getBytes()); int digital; for (int i = 0; i < temp...
[ "public", "static", "String", "getMD5ForString", "(", "String", "content", ")", "{", "StringBuilder", "md5Buffer", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "MessageDigest", "digest", "=", "MessageDigest", ".", "getInstance", "(", "\"MD5\"", ")", ...
Get the MD5 value of string. @param content the target string. @return the MD5 value.
[ "Get", "the", "MD5", "value", "of", "string", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L437-L457
60,137
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java
Broadcaster.stopRecording
@Override public void stopRecording() { super.stopRecording(); mSentBroadcastLiveEvent = false; if (mStream != null) { if (VERBOSE) Log.i(TAG, "Stopping Stream"); mKickflip.stopStream(mStream, new KickflipCallback() { @Override public v...
java
@Override public void stopRecording() { super.stopRecording(); mSentBroadcastLiveEvent = false; if (mStream != null) { if (VERBOSE) Log.i(TAG, "Stopping Stream"); mKickflip.stopStream(mStream, new KickflipCallback() { @Override public v...
[ "@", "Override", "public", "void", "stopRecording", "(", ")", "{", "super", ".", "stopRecording", "(", ")", ";", "mSentBroadcastLiveEvent", "=", "false", ";", "if", "(", "mStream", "!=", "null", ")", "{", "if", "(", "VERBOSE", ")", "Log", ".", "i", "("...
Stop broadcasting and release resources. After this call this Broadcaster can no longer be used.
[ "Stop", "broadcasting", "and", "release", "resources", ".", "After", "this", "call", "this", "Broadcaster", "can", "no", "longer", "be", "used", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java#L236-L254
60,138
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java
Broadcaster.queueOrSubmitUpload
private void queueOrSubmitUpload(String key, File file) { if (mReadyToBroadcast) { submitUpload(key, file); } else { if (VERBOSE) Log.i(TAG, "queueing " + key + " until S3 Credentials available"); queueUpload(key, file); } }
java
private void queueOrSubmitUpload(String key, File file) { if (mReadyToBroadcast) { submitUpload(key, file); } else { if (VERBOSE) Log.i(TAG, "queueing " + key + " until S3 Credentials available"); queueUpload(key, file); } }
[ "private", "void", "queueOrSubmitUpload", "(", "String", "key", ",", "File", "file", ")", "{", "if", "(", "mReadyToBroadcast", ")", "{", "submitUpload", "(", "key", ",", "file", ")", ";", "}", "else", "{", "if", "(", "VERBOSE", ")", "Log", ".", "i", ...
Handle an upload, either submitting to the S3 client or queueing for submission once credentials are ready @param key destination key @param file local file
[ "Handle", "an", "upload", "either", "submitting", "to", "the", "S3", "client", "or", "queueing", "for", "submission", "once", "credentials", "are", "ready" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java#L456-L463
60,139
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java
Broadcaster.queueUpload
private void queueUpload(String key, File file) { if (mUploadQueue == null) mUploadQueue = new ArrayDeque<>(); mUploadQueue.add(new Pair<>(key, file)); }
java
private void queueUpload(String key, File file) { if (mUploadQueue == null) mUploadQueue = new ArrayDeque<>(); mUploadQueue.add(new Pair<>(key, file)); }
[ "private", "void", "queueUpload", "(", "String", "key", ",", "File", "file", ")", "{", "if", "(", "mUploadQueue", "==", "null", ")", "mUploadQueue", "=", "new", "ArrayDeque", "<>", "(", ")", ";", "mUploadQueue", ".", "add", "(", "new", "Pair", "<>", "(...
Queue an upload for later submission to S3 @param key destination key @param file local file
[ "Queue", "an", "upload", "for", "later", "submission", "to", "S3" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java#L471-L475
60,140
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java
Broadcaster.submitQueuedUploadsToS3
private void submitQueuedUploadsToS3() { if (mUploadQueue == null) return; for (Pair<String, File> pair : mUploadQueue) { submitUpload(pair.first, pair.second); } }
java
private void submitQueuedUploadsToS3() { if (mUploadQueue == null) return; for (Pair<String, File> pair : mUploadQueue) { submitUpload(pair.first, pair.second); } }
[ "private", "void", "submitQueuedUploadsToS3", "(", ")", "{", "if", "(", "mUploadQueue", "==", "null", ")", "return", ";", "for", "(", "Pair", "<", "String", ",", "File", ">", "pair", ":", "mUploadQueue", ")", "{", "submitUpload", "(", "pair", ".", "first...
Submit all queued uploads to the S3 client
[ "Submit", "all", "queued", "uploads", "to", "the", "S3", "client" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Broadcaster.java#L480-L485
60,141
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.applyFilter
public void applyFilter(int filter) { Filters.checkFilterArgument(filter); mDisplayRenderer.changeFilterMode(filter); synchronized (mReadyForFrameFence) { mNewFilter = filter; } }
java
public void applyFilter(int filter) { Filters.checkFilterArgument(filter); mDisplayRenderer.changeFilterMode(filter); synchronized (mReadyForFrameFence) { mNewFilter = filter; } }
[ "public", "void", "applyFilter", "(", "int", "filter", ")", "{", "Filters", ".", "checkFilterArgument", "(", "filter", ")", ";", "mDisplayRenderer", ".", "changeFilterMode", "(", "filter", ")", ";", "synchronized", "(", "mReadyForFrameFence", ")", "{", "mNewFilt...
Apply a filter to the camera input @param filter
[ "Apply", "a", "filter", "to", "the", "camera", "input" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L329-L335
60,142
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.handleCameraPreviewTouchEvent
public void handleCameraPreviewTouchEvent(MotionEvent ev) { if (mFullScreen != null) mFullScreen.handleTouchEvent(ev); if (mDisplayRenderer != null) mDisplayRenderer.handleTouchEvent(ev); }
java
public void handleCameraPreviewTouchEvent(MotionEvent ev) { if (mFullScreen != null) mFullScreen.handleTouchEvent(ev); if (mDisplayRenderer != null) mDisplayRenderer.handleTouchEvent(ev); }
[ "public", "void", "handleCameraPreviewTouchEvent", "(", "MotionEvent", "ev", ")", "{", "if", "(", "mFullScreen", "!=", "null", ")", "mFullScreen", ".", "handleTouchEvent", "(", "ev", ")", ";", "if", "(", "mDisplayRenderer", "!=", "null", ")", "mDisplayRenderer",...
Notify the preview and encoder programs of a touch event. Used by GLCameraEncoderView @param ev onTouchEvent event to handle
[ "Notify", "the", "preview", "and", "encoder", "programs", "of", "a", "touch", "event", ".", "Used", "by", "GLCameraEncoderView" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L344-L347
60,143
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.startRecording
public void startRecording() { if (mState != STATE.INITIALIZED) { Log.e(TAG, "startRecording called in invalid state. Ignoring"); return; } synchronized (mReadyForFrameFence) { mFrameNum = 0; mRecording = true; mState = STATE.RECORDING;...
java
public void startRecording() { if (mState != STATE.INITIALIZED) { Log.e(TAG, "startRecording called in invalid state. Ignoring"); return; } synchronized (mReadyForFrameFence) { mFrameNum = 0; mRecording = true; mState = STATE.RECORDING;...
[ "public", "void", "startRecording", "(", ")", "{", "if", "(", "mState", "!=", "STATE", ".", "INITIALIZED", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"startRecording called in invalid state. Ignoring\"", ")", ";", "return", ";", "}", "synchronized", "(", ...
Called from UI thread
[ "Called", "from", "UI", "thread" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L363-L373
60,144
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.onFrameAvailable
@Override public void onFrameAvailable(SurfaceTexture surfaceTexture) { // Pass SurfaceTexture to Encoding thread via Handler // Then Encode and display frame mHandler.sendMessage(mHandler.obtainMessage(MSG_FRAME_AVAILABLE, surfaceTexture)); }
java
@Override public void onFrameAvailable(SurfaceTexture surfaceTexture) { // Pass SurfaceTexture to Encoding thread via Handler // Then Encode and display frame mHandler.sendMessage(mHandler.obtainMessage(MSG_FRAME_AVAILABLE, surfaceTexture)); }
[ "@", "Override", "public", "void", "onFrameAvailable", "(", "SurfaceTexture", "surfaceTexture", ")", "{", "// Pass SurfaceTexture to Encoding thread via Handler", "// Then Encode and display frame", "mHandler", ".", "sendMessage", "(", "mHandler", ".", "obtainMessage", "(", "...
Called on an "arbitrary thread" @param surfaceTexture the SurfaceTexture initiating the call
[ "Called", "on", "an", "arbitrary", "thread" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L466-L471
60,145
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.prepareEncoder
private void prepareEncoder(EGLContext sharedContext, int width, int height, int bitRate, Muxer muxer) throws IOException { mVideoEncoder = new VideoEncoderCore(width, height, bitRate, muxer); if (mEglCore == null) { // This is the first prepare called for thi...
java
private void prepareEncoder(EGLContext sharedContext, int width, int height, int bitRate, Muxer muxer) throws IOException { mVideoEncoder = new VideoEncoderCore(width, height, bitRate, muxer); if (mEglCore == null) { // This is the first prepare called for thi...
[ "private", "void", "prepareEncoder", "(", "EGLContext", "sharedContext", ",", "int", "width", ",", "int", "height", ",", "int", "bitRate", ",", "Muxer", "muxer", ")", "throws", "IOException", "{", "mVideoEncoder", "=", "new", "VideoEncoderCore", "(", "width", ...
Called with the display EGLContext current, on Encoder thread @param sharedContext The display EGLContext to be shared with the Encoder Surface's context. @param width the desired width of the encoder's video output @param height the desired height of the encoder's video output @param bitRate the ...
[ "Called", "with", "the", "display", "EGLContext", "current", "on", "Encoder", "thread" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L692-L708
60,146
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.releaseEglResources
private void releaseEglResources() { mReadyForFrames = false; if (mInputWindowSurface != null) { mInputWindowSurface.release(); mInputWindowSurface = null; } if (mFullScreen != null) { mFullScreen.release(); mFullScreen = null; } ...
java
private void releaseEglResources() { mReadyForFrames = false; if (mInputWindowSurface != null) { mInputWindowSurface.release(); mInputWindowSurface = null; } if (mFullScreen != null) { mFullScreen.release(); mFullScreen = null; } ...
[ "private", "void", "releaseEglResources", "(", ")", "{", "mReadyForFrames", "=", "false", ";", "if", "(", "mInputWindowSurface", "!=", "null", ")", "{", "mInputWindowSurface", ".", "release", "(", ")", ";", "mInputWindowSurface", "=", "null", ";", "}", "if", ...
Release all recording-specific resources. The Encoder, EGLCore and FullFrameRect are tied to capture resolution, and other parameters.
[ "Release", "all", "recording", "-", "specific", "resources", ".", "The", "Encoder", "EGLCore", "and", "FullFrameRect", "are", "tied", "to", "capture", "resolution", "and", "other", "parameters", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L719-L735
60,147
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.releaseCamera
private void releaseCamera() { if (mDisplayView != null) releaseDisplayView(); if (mCamera != null) { if (VERBOSE) Log.d(TAG, "releasing camera"); mCamera.stopPreview(); mCamera.release(); mCamera = null; } }
java
private void releaseCamera() { if (mDisplayView != null) releaseDisplayView(); if (mCamera != null) { if (VERBOSE) Log.d(TAG, "releasing camera"); mCamera.stopPreview(); mCamera.release(); mCamera = null; } }
[ "private", "void", "releaseCamera", "(", ")", "{", "if", "(", "mDisplayView", "!=", "null", ")", "releaseDisplayView", "(", ")", ";", "if", "(", "mCamera", "!=", "null", ")", "{", "if", "(", "VERBOSE", ")", "Log", ".", "d", "(", "TAG", ",", "\"releas...
Stops camera preview, and releases the camera to the system.
[ "Stops", "camera", "preview", "and", "releases", "the", "camera", "to", "the", "system", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L846-L855
60,148
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.configureDisplayView
private void configureDisplayView() { if (mDisplayView instanceof GLCameraEncoderView) ((GLCameraEncoderView) mDisplayView).setCameraEncoder(this); else if (mDisplayView instanceof GLCameraView) ((GLCameraView) mDisplayView).setCamera(mCamera); }
java
private void configureDisplayView() { if (mDisplayView instanceof GLCameraEncoderView) ((GLCameraEncoderView) mDisplayView).setCameraEncoder(this); else if (mDisplayView instanceof GLCameraView) ((GLCameraView) mDisplayView).setCamera(mCamera); }
[ "private", "void", "configureDisplayView", "(", ")", "{", "if", "(", "mDisplayView", "instanceof", "GLCameraEncoderView", ")", "(", "(", "GLCameraEncoderView", ")", "mDisplayView", ")", ".", "setCameraEncoder", "(", "this", ")", ";", "else", "if", "(", "mDisplay...
Communicate camera-ready state to our display view. This method allows us to handle custom subclasses
[ "Communicate", "camera", "-", "ready", "state", "to", "our", "display", "view", ".", "This", "method", "allows", "us", "to", "handle", "custom", "subclasses" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L861-L866
60,149
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java
CameraEncoder.releaseDisplayView
private void releaseDisplayView() { if (mDisplayView instanceof GLCameraEncoderView) { ((GLCameraEncoderView) mDisplayView).releaseCamera(); } else if (mDisplayView instanceof GLCameraView) ((GLCameraView) mDisplayView).releaseCamera(); }
java
private void releaseDisplayView() { if (mDisplayView instanceof GLCameraEncoderView) { ((GLCameraEncoderView) mDisplayView).releaseCamera(); } else if (mDisplayView instanceof GLCameraView) ((GLCameraView) mDisplayView).releaseCamera(); }
[ "private", "void", "releaseDisplayView", "(", ")", "{", "if", "(", "mDisplayView", "instanceof", "GLCameraEncoderView", ")", "{", "(", "(", "GLCameraEncoderView", ")", "mDisplayView", ")", ".", "releaseCamera", "(", ")", ";", "}", "else", "if", "(", "mDisplayV...
Communicate camera-released state to our display view.
[ "Communicate", "camera", "-", "released", "state", "to", "our", "display", "view", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L871-L876
60,150
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java
GlUtil.createProgram
public static int createProgram(String vertexSource, String fragmentSource) { int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource); if (vertexShader == 0) { return 0; } int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource); if (pixelS...
java
public static int createProgram(String vertexSource, String fragmentSource) { int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource); if (vertexShader == 0) { return 0; } int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource); if (pixelS...
[ "public", "static", "int", "createProgram", "(", "String", "vertexSource", ",", "String", "fragmentSource", ")", "{", "int", "vertexShader", "=", "loadShader", "(", "GLES20", ".", "GL_VERTEX_SHADER", ",", "vertexSource", ")", ";", "if", "(", "vertexShader", "=="...
Creates a new program from the supplied vertex and fragment shaders. @return A handle to the program, or 0 on failure.
[ "Creates", "a", "new", "program", "from", "the", "supplied", "vertex", "and", "fragment", "shaders", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L50-L79
60,151
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java
GlUtil.loadShader
public static int loadShader(int shaderType, String source) { int shader = GLES20.glCreateShader(shaderType); checkGlError("glCreateShader type=" + shaderType); GLES20.glShaderSource(shader, source); GLES20.glCompileShader(shader); int[] compiled = new int[1]; GLES20.glGe...
java
public static int loadShader(int shaderType, String source) { int shader = GLES20.glCreateShader(shaderType); checkGlError("glCreateShader type=" + shaderType); GLES20.glShaderSource(shader, source); GLES20.glCompileShader(shader); int[] compiled = new int[1]; GLES20.glGe...
[ "public", "static", "int", "loadShader", "(", "int", "shaderType", ",", "String", "source", ")", "{", "int", "shader", "=", "GLES20", ".", "glCreateShader", "(", "shaderType", ")", ";", "checkGlError", "(", "\"glCreateShader type=\"", "+", "shaderType", ")", "...
Compiles the provided shader source. @return A handle to the shader, or 0 on failure.
[ "Compiles", "the", "provided", "shader", "source", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L86-L100
60,152
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java
GlUtil.checkGlError
public static void checkGlError(String op) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { String msg = op + ": glError 0x" + Integer.toHexString(error); Log.e(TAG, msg); throw new RuntimeException(msg); } }
java
public static void checkGlError(String op) { int error = GLES20.glGetError(); if (error != GLES20.GL_NO_ERROR) { String msg = op + ": glError 0x" + Integer.toHexString(error); Log.e(TAG, msg); throw new RuntimeException(msg); } }
[ "public", "static", "void", "checkGlError", "(", "String", "op", ")", "{", "int", "error", "=", "GLES20", ".", "glGetError", "(", ")", ";", "if", "(", "error", "!=", "GLES20", ".", "GL_NO_ERROR", ")", "{", "String", "msg", "=", "op", "+", "\": glError ...
Checks to see if a GLES error has been raised.
[ "Checks", "to", "see", "if", "a", "GLES", "error", "has", "been", "raised", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L105-L112
60,153
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java
GlUtil.createFloatBuffer
public static FloatBuffer createFloatBuffer(float[] coords) { // Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it. ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * SIZEOF_FLOAT); bb.order(ByteOrder.nativeOrder()); FloatBuffer fb = bb.asFloatBuffer()...
java
public static FloatBuffer createFloatBuffer(float[] coords) { // Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it. ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * SIZEOF_FLOAT); bb.order(ByteOrder.nativeOrder()); FloatBuffer fb = bb.asFloatBuffer()...
[ "public", "static", "FloatBuffer", "createFloatBuffer", "(", "float", "[", "]", "coords", ")", "{", "// Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it.", "ByteBuffer", "bb", "=", "ByteBuffer", ".", "allocateDirect", "(", "coords", ".", "lengt...
Allocates a direct float buffer, and populates it with the float array data.
[ "Allocates", "a", "direct", "float", "buffer", "and", "populates", "it", "with", "the", "float", "array", "data", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L129-L137
60,154
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java
GlUtil.logVersionInfo
public static void logVersionInfo() { Log.i(TAG, "vendor : " + GLES20.glGetString(GLES20.GL_VENDOR)); Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER)); Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION)); if (false) { int[] values = new int[1];...
java
public static void logVersionInfo() { Log.i(TAG, "vendor : " + GLES20.glGetString(GLES20.GL_VENDOR)); Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER)); Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION)); if (false) { int[] values = new int[1];...
[ "public", "static", "void", "logVersionInfo", "(", ")", "{", "Log", ".", "i", "(", "TAG", ",", "\"vendor : \"", "+", "GLES20", ".", "glGetString", "(", "GLES20", ".", "GL_VENDOR", ")", ")", ";", "Log", ".", "i", "(", "TAG", ",", "\"renderer: \"", "+",...
Writes GL version info to the log.
[ "Writes", "GL", "version", "info", "to", "the", "log", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L142-L157
60,155
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.getConfig
private EGLConfig getConfig(int flags, int version) { int renderableType = EGL14.EGL_OPENGL_ES2_BIT; if (version >= 3) { renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR; } // The actual surface is generally RGBA or RGBX, so situationally omitting alpha // doesn't rea...
java
private EGLConfig getConfig(int flags, int version) { int renderableType = EGL14.EGL_OPENGL_ES2_BIT; if (version >= 3) { renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR; } // The actual surface is generally RGBA or RGBX, so situationally omitting alpha // doesn't rea...
[ "private", "EGLConfig", "getConfig", "(", "int", "flags", ",", "int", "version", ")", "{", "int", "renderableType", "=", "EGL14", ".", "EGL_OPENGL_ES2_BIT", ";", "if", "(", "version", ">=", "3", ")", "{", "renderableType", "|=", "EGLExt", ".", "EGL_OPENGL_ES...
Finds a suitable EGLConfig. @param flags Bit flags from constructor. @param version Must be 2 or 3.
[ "Finds", "a", "suitable", "EGLConfig", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L143-L175
60,156
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.release
public void release() { if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { // Android is unusual in that it uses a reference-counted EGLDisplay. So for // every eglInitialize() we need an eglTerminate(). EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, E...
java
public void release() { if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { // Android is unusual in that it uses a reference-counted EGLDisplay. So for // every eglInitialize() we need an eglTerminate(). EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, E...
[ "public", "void", "release", "(", ")", "{", "if", "(", "mEGLDisplay", "!=", "EGL14", ".", "EGL_NO_DISPLAY", ")", "{", "// Android is unusual in that it uses a reference-counted EGLDisplay. So for", "// every eglInitialize() we need an eglTerminate().", "EGL14", ".", "eglMakeCu...
Discard all resources held by this class, notably the EGL context.
[ "Discard", "all", "resources", "held", "by", "this", "class", "notably", "the", "EGL", "context", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L180-L193
60,157
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.createOffscreenSurface
public EGLSurface createOffscreenSurface(int width, int height) { int[] surfaceAttribs = { EGL14.EGL_WIDTH, width, EGL14.EGL_HEIGHT, height, EGL14.EGL_NONE }; EGLSurface eglSurface = EGL14.eglCreatePbufferSurface(mEGLDisplay, mEGLConfig, ...
java
public EGLSurface createOffscreenSurface(int width, int height) { int[] surfaceAttribs = { EGL14.EGL_WIDTH, width, EGL14.EGL_HEIGHT, height, EGL14.EGL_NONE }; EGLSurface eglSurface = EGL14.eglCreatePbufferSurface(mEGLDisplay, mEGLConfig, ...
[ "public", "EGLSurface", "createOffscreenSurface", "(", "int", "width", ",", "int", "height", ")", "{", "int", "[", "]", "surfaceAttribs", "=", "{", "EGL14", ".", "EGL_WIDTH", ",", "width", ",", "EGL14", ".", "EGL_HEIGHT", ",", "height", ",", "EGL14", ".", ...
Creates an EGL surface associated with an offscreen buffer.
[ "Creates", "an", "EGL", "surface", "associated", "with", "an", "offscreen", "buffer", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L245-L258
60,158
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.makeCurrent
public void makeCurrent(EGLSurface eglSurface) { if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { // called makeCurrent() before create? Log.d(TAG, "NOTE: makeCurrent w/o display"); } if (!EGL14.eglMakeCurrent(mEGLDisplay, eglSurface, eglSurface, mEGLContext)) { thr...
java
public void makeCurrent(EGLSurface eglSurface) { if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { // called makeCurrent() before create? Log.d(TAG, "NOTE: makeCurrent w/o display"); } if (!EGL14.eglMakeCurrent(mEGLDisplay, eglSurface, eglSurface, mEGLContext)) { thr...
[ "public", "void", "makeCurrent", "(", "EGLSurface", "eglSurface", ")", "{", "if", "(", "mEGLDisplay", "==", "EGL14", ".", "EGL_NO_DISPLAY", ")", "{", "// called makeCurrent() before create?", "Log", ".", "d", "(", "TAG", ",", "\"NOTE: makeCurrent w/o display\"", ")"...
Makes our EGL context current, using the supplied surface for both "draw" and "read".
[ "Makes", "our", "EGL", "context", "current", "using", "the", "supplied", "surface", "for", "both", "draw", "and", "read", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L263-L271
60,159
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.makeCurrent
public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) { if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { // called makeCurrent() before create? Log.d(TAG, "NOTE: makeCurrent w/o display"); } if (!EGL14.eglMakeCurrent(mEGLDisplay, drawSurface, readSurface, mEGL...
java
public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) { if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { // called makeCurrent() before create? Log.d(TAG, "NOTE: makeCurrent w/o display"); } if (!EGL14.eglMakeCurrent(mEGLDisplay, drawSurface, readSurface, mEGL...
[ "public", "void", "makeCurrent", "(", "EGLSurface", "drawSurface", ",", "EGLSurface", "readSurface", ")", "{", "if", "(", "mEGLDisplay", "==", "EGL14", ".", "EGL_NO_DISPLAY", ")", "{", "// called makeCurrent() before create?", "Log", ".", "d", "(", "TAG", ",", "...
Makes our EGL context current, using the supplied "draw" and "read" surfaces.
[ "Makes", "our", "EGL", "context", "current", "using", "the", "supplied", "draw", "and", "read", "surfaces", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L276-L284
60,160
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.makeNothingCurrent
public void makeNothingCurrent() { if (!EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT)) { throw new RuntimeException("eglMakeCurrent failed"); } }
java
public void makeNothingCurrent() { if (!EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT)) { throw new RuntimeException("eglMakeCurrent failed"); } }
[ "public", "void", "makeNothingCurrent", "(", ")", "{", "if", "(", "!", "EGL14", ".", "eglMakeCurrent", "(", "mEGLDisplay", ",", "EGL14", ".", "EGL_NO_SURFACE", ",", "EGL14", ".", "EGL_NO_SURFACE", ",", "EGL14", ".", "EGL_NO_CONTEXT", ")", ")", "{", "throw", ...
Makes no context current.
[ "Makes", "no", "context", "current", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L289-L294
60,161
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.isCurrent
public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
java
public boolean isCurrent(EGLSurface eglSurface) { return mEGLContext.equals(EGL14.eglGetCurrentContext()) && eglSurface.equals(EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW)); }
[ "public", "boolean", "isCurrent", "(", "EGLSurface", "eglSurface", ")", "{", "return", "mEGLContext", ".", "equals", "(", "EGL14", ".", "eglGetCurrentContext", "(", ")", ")", "&&", "eglSurface", ".", "equals", "(", "EGL14", ".", "eglGetCurrentSurface", "(", "E...
Returns true if our context and the specified surface are current.
[ "Returns", "true", "if", "our", "context", "and", "the", "specified", "surface", "are", "current", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L315-L318
60,162
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.querySurface
public int querySurface(EGLSurface eglSurface, int what) { int[] value = new int[1]; EGL14.eglQuerySurface(mEGLDisplay, eglSurface, what, value, 0); return value[0]; }
java
public int querySurface(EGLSurface eglSurface, int what) { int[] value = new int[1]; EGL14.eglQuerySurface(mEGLDisplay, eglSurface, what, value, 0); return value[0]; }
[ "public", "int", "querySurface", "(", "EGLSurface", "eglSurface", ",", "int", "what", ")", "{", "int", "[", "]", "value", "=", "new", "int", "[", "1", "]", ";", "EGL14", ".", "eglQuerySurface", "(", "mEGLDisplay", ",", "eglSurface", ",", "what", ",", "...
Performs a simple surface query.
[ "Performs", "a", "simple", "surface", "query", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L323-L327
60,163
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.logCurrent
public static void logCurrent(String msg) { EGLDisplay display; EGLContext context; EGLSurface surface; display = EGL14.eglGetCurrentDisplay(); context = EGL14.eglGetCurrentContext(); surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); Log.i(TAG, "Current EGL (...
java
public static void logCurrent(String msg) { EGLDisplay display; EGLContext context; EGLSurface surface; display = EGL14.eglGetCurrentDisplay(); context = EGL14.eglGetCurrentContext(); surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); Log.i(TAG, "Current EGL (...
[ "public", "static", "void", "logCurrent", "(", "String", "msg", ")", "{", "EGLDisplay", "display", ";", "EGLContext", "context", ";", "EGLSurface", "surface", ";", "display", "=", "EGL14", ".", "eglGetCurrentDisplay", "(", ")", ";", "context", "=", "EGL14", ...
Writes the current display, context, and surface to the log.
[ "Writes", "the", "current", "display", "context", "and", "surface", "to", "the", "log", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L339-L349
60,164
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/EglCore.java
EglCore.checkEglError
private void checkEglError(String msg) { int error; if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) { throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error)); } }
java
private void checkEglError(String msg) { int error; if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) { throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error)); } }
[ "private", "void", "checkEglError", "(", "String", "msg", ")", "{", "int", "error", ";", "if", "(", "(", "error", "=", "EGL14", ".", "eglGetError", "(", ")", ")", "!=", "EGL14", ".", "EGL_SUCCESS", ")", "{", "throw", "new", "RuntimeException", "(", "ms...
Checks for EGL errors.
[ "Checks", "for", "EGL", "errors", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L354-L359
60,165
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/MicrophoneEncoder.java
MicrophoneEncoder.getJitterFreePTS
private long getJitterFreePTS(long bufferPts, long bufferSamplesNum) { long correctedPts = 0; long bufferDuration = (1000000 * bufferSamplesNum) / (mEncoderCore.mSampleRate); bufferPts -= bufferDuration; // accounts for the delay of acquiring the audio buffer if (totalSamplesNum == 0) { ...
java
private long getJitterFreePTS(long bufferPts, long bufferSamplesNum) { long correctedPts = 0; long bufferDuration = (1000000 * bufferSamplesNum) / (mEncoderCore.mSampleRate); bufferPts -= bufferDuration; // accounts for the delay of acquiring the audio buffer if (totalSamplesNum == 0) { ...
[ "private", "long", "getJitterFreePTS", "(", "long", "bufferPts", ",", "long", "bufferSamplesNum", ")", "{", "long", "correctedPts", "=", "0", ";", "long", "bufferDuration", "=", "(", "1000000", "*", "bufferSamplesNum", ")", "/", "(", "mEncoderCore", ".", "mSam...
Ensures that each audio pts differs by a constant amount from the previous one. @param bufferPts presentation timestamp in us @param bufferSamplesNum the number of samples of the buffer's frame @return
[ "Ensures", "that", "each", "audio", "pts", "differs", "by", "a", "constant", "amount", "from", "the", "previous", "one", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/MicrophoneEncoder.java#L207-L225
60,166
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java
FullFrameRect.adjustForVerticalVideo
public void adjustForVerticalVideo(SCREEN_ROTATION orientation, boolean scaleToFit) { synchronized (mDrawLock) { mCorrectVerticalVideo = true; mScaleToFit = scaleToFit; requestedOrientation = orientation; Matrix.setIdentityM(IDENTITY_MATRIX, 0); switch...
java
public void adjustForVerticalVideo(SCREEN_ROTATION orientation, boolean scaleToFit) { synchronized (mDrawLock) { mCorrectVerticalVideo = true; mScaleToFit = scaleToFit; requestedOrientation = orientation; Matrix.setIdentityM(IDENTITY_MATRIX, 0); switch...
[ "public", "void", "adjustForVerticalVideo", "(", "SCREEN_ROTATION", "orientation", ",", "boolean", "scaleToFit", ")", "{", "synchronized", "(", "mDrawLock", ")", "{", "mCorrectVerticalVideo", "=", "true", ";", "mScaleToFit", "=", "scaleToFit", ";", "requestedOrientati...
Adjust the MVP Matrix to rotate and crop the texture to make vertical video appear upright
[ "Adjust", "the", "MVP", "Matrix", "to", "rotate", "and", "crop", "the", "texture", "to", "make", "vertical", "video", "appear", "upright" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java#L70-L100
60,167
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java
FullFrameRect.drawFrame
public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. synchronized (mDrawLock) { if (mCorrectVerticalVideo && !mScaleToFit && (requestedOrientation == SCREEN_ROTATION.VERTICAL || requestedOrientation == SCR...
java
public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. synchronized (mDrawLock) { if (mCorrectVerticalVideo && !mScaleToFit && (requestedOrientation == SCREEN_ROTATION.VERTICAL || requestedOrientation == SCR...
[ "public", "void", "drawFrame", "(", "int", "textureId", ",", "float", "[", "]", "texMatrix", ")", "{", "// Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.", "synchronized", "(", "mDrawLock", ")", "{", "if", "(", "mCorrectVerticalVideo", "&&"...
Draws a viewport-filling rect, texturing it with the specified texture object.
[ "Draws", "a", "viewport", "-", "filling", "rect", "texturing", "it", "with", "the", "specified", "texture", "object", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FullFrameRect.java#L137-L148
60,168
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/fragment/GlassBroadcastFragment.java
GlassBroadcastFragment.stopBroadcasting
public void stopBroadcasting() { if (mBroadcaster.isRecording()) { mBroadcaster.stopRecording(); mBroadcaster.release(); } else { Log.e(TAG, "stopBroadcasting called but mBroadcaster not broadcasting"); } }
java
public void stopBroadcasting() { if (mBroadcaster.isRecording()) { mBroadcaster.stopRecording(); mBroadcaster.release(); } else { Log.e(TAG, "stopBroadcasting called but mBroadcaster not broadcasting"); } }
[ "public", "void", "stopBroadcasting", "(", ")", "{", "if", "(", "mBroadcaster", ".", "isRecording", "(", ")", ")", "{", "mBroadcaster", ".", "stopRecording", "(", ")", ";", "mBroadcaster", ".", "release", "(", ")", ";", "}", "else", "{", "Log", ".", "e...
Force this fragment to stop broadcasting. Useful if your application wants to stop broadcasting when a user leaves the Activity hosting this fragment
[ "Force", "this", "fragment", "to", "stop", "broadcasting", ".", "Useful", "if", "your", "application", "wants", "to", "stop", "broadcasting", "when", "a", "user", "leaves", "the", "Activity", "hosting", "this", "fragment" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/fragment/GlassBroadcastFragment.java#L242-L249
60,169
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/OAuthClient.java
OAuthClient.acquireAccessToken
protected void acquireAccessToken(final OAuthCallback cb) { if (isAccessTokenCached()) { // Execute the callback immediately with cached OAuth credentials if (VERBOSE) Log.d(TAG, "Access token cached"); if (cb != null) { // Ensure networking occurs off the mai...
java
protected void acquireAccessToken(final OAuthCallback cb) { if (isAccessTokenCached()) { // Execute the callback immediately with cached OAuth credentials if (VERBOSE) Log.d(TAG, "Access token cached"); if (cb != null) { // Ensure networking occurs off the mai...
[ "protected", "void", "acquireAccessToken", "(", "final", "OAuthCallback", "cb", ")", "{", "if", "(", "isAccessTokenCached", "(", ")", ")", "{", "// Execute the callback immediately with cached OAuth credentials", "if", "(", "VERBOSE", ")", "Log", ".", "d", "(", "TAG...
Asynchronously attempt to acquire an OAuth Access Token @param cb called when AccessToken is acquired. Always called on a background thread suitable for networking.
[ "Asynchronously", "attempt", "to", "acquire", "an", "OAuth", "Access", "Token" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/OAuthClient.java#L96-L154
60,170
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/OAuthClient.java
OAuthClient.executeQueuedCallbacks
protected void executeQueuedCallbacks() { if (VERBOSE) Log.i(TAG, String.format("Executing %d queued callbacks", mCallbackQueue.size())); for (OAuthCallback cb : mCallbackQueue) { cb.onSuccess(getRequestFactoryFromCachedCredentials()); } }
java
protected void executeQueuedCallbacks() { if (VERBOSE) Log.i(TAG, String.format("Executing %d queued callbacks", mCallbackQueue.size())); for (OAuthCallback cb : mCallbackQueue) { cb.onSuccess(getRequestFactoryFromCachedCredentials()); } }
[ "protected", "void", "executeQueuedCallbacks", "(", ")", "{", "if", "(", "VERBOSE", ")", "Log", ".", "i", "(", "TAG", ",", "String", ".", "format", "(", "\"Executing %d queued callbacks\"", ",", "mCallbackQueue", ".", "size", "(", ")", ")", ")", ";", "for"...
Execute queued callbacks once valid OAuth credentials are acquired.
[ "Execute", "queued", "callbacks", "once", "valid", "OAuth", "credentials", "are", "acquired", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/OAuthClient.java#L214-L220
60,171
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java
FFmpegMuxer.captureH264MetaData
private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264MetaSize = bufferInfo.size; mH264Keyframe = ByteBuffer.allocateDirect(encodedData.capacity()); byte[] videoConfig = new byte[bufferInfo.size]; encodedData.get(videoConfig, bufferInfo.offset,...
java
private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264MetaSize = bufferInfo.size; mH264Keyframe = ByteBuffer.allocateDirect(encodedData.capacity()); byte[] videoConfig = new byte[bufferInfo.size]; encodedData.get(videoConfig, bufferInfo.offset,...
[ "private", "void", "captureH264MetaData", "(", "ByteBuffer", "encodedData", ",", "MediaCodec", ".", "BufferInfo", "bufferInfo", ")", "{", "mH264MetaSize", "=", "bufferInfo", ".", "size", ";", "mH264Keyframe", "=", "ByteBuffer", ".", "allocateDirect", "(", "encodedDa...
Should only be called once, when the encoder produces an output buffer with the BUFFER_FLAG_CODEC_CONFIG flag. For H264 output, this indicates the Sequence Parameter Set and Picture Parameter Set are contained in the buffer. These NAL units are required before every keyframe to ensure playback is possible in a segmente...
[ "Should", "only", "be", "called", "once", "when", "the", "encoder", "produces", "an", "output", "buffer", "with", "the", "BUFFER_FLAG_CODEC_CONFIG", "flag", ".", "For", "H264", "output", "this", "indicates", "the", "Sequence", "Parameter", "Set", "and", "Picture...
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java#L296-L305
60,172
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java
FFmpegMuxer.packageH264Keyframe
private void packageH264Keyframe(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264Keyframe.position(mH264MetaSize); mH264Keyframe.put(encodedData); // BufferOverflow }
java
private void packageH264Keyframe(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) { mH264Keyframe.position(mH264MetaSize); mH264Keyframe.put(encodedData); // BufferOverflow }
[ "private", "void", "packageH264Keyframe", "(", "ByteBuffer", "encodedData", ",", "MediaCodec", ".", "BufferInfo", "bufferInfo", ")", "{", "mH264Keyframe", ".", "position", "(", "mH264MetaSize", ")", ";", "mH264Keyframe", ".", "put", "(", "encodedData", ")", ";", ...
Adds the SPS + PPS data to the ByteBuffer containing a h264 keyframe @param encodedData @param bufferInfo
[ "Adds", "the", "SPS", "+", "PPS", "data", "to", "the", "ByteBuffer", "containing", "a", "h264", "keyframe" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java#L313-L316
60,173
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java
Texture2dProgram.handleTouchEvent
public void handleTouchEvent(MotionEvent ev){ if(ev.getAction() == MotionEvent.ACTION_MOVE){ // A finger is dragging about if(mTexHeight != 0 && mTexWidth != 0){ mSummedTouchPosition[0] += (2 * (ev.getX() - mLastTouchPosition[0])) / mTexWidth; mSummedTouch...
java
public void handleTouchEvent(MotionEvent ev){ if(ev.getAction() == MotionEvent.ACTION_MOVE){ // A finger is dragging about if(mTexHeight != 0 && mTexWidth != 0){ mSummedTouchPosition[0] += (2 * (ev.getX() - mLastTouchPosition[0])) / mTexWidth; mSummedTouch...
[ "public", "void", "handleTouchEvent", "(", "MotionEvent", "ev", ")", "{", "if", "(", "ev", ".", "getAction", "(", ")", "==", "MotionEvent", ".", "ACTION_MOVE", ")", "{", "// A finger is dragging about", "if", "(", "mTexHeight", "!=", "0", "&&", "mTexWidth", ...
Configures the effect offset This only has an effect for programs that use positional effects like SQUEEZE and MIRROR
[ "Configures", "the", "effect", "offset" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java#L468-L482
60,174
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java
Texture2dProgram.setKernel
public void setKernel(float[] values, float colorAdj) { if (values.length != KERNEL_SIZE) { throw new IllegalArgumentException("Kernel size is " + values.length + " vs. " + KERNEL_SIZE); } System.arraycopy(values, 0, mKernel, 0, KERNEL_SIZE); mColorAdjust ...
java
public void setKernel(float[] values, float colorAdj) { if (values.length != KERNEL_SIZE) { throw new IllegalArgumentException("Kernel size is " + values.length + " vs. " + KERNEL_SIZE); } System.arraycopy(values, 0, mKernel, 0, KERNEL_SIZE); mColorAdjust ...
[ "public", "void", "setKernel", "(", "float", "[", "]", "values", ",", "float", "colorAdj", ")", "{", "if", "(", "values", ".", "length", "!=", "KERNEL_SIZE", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Kernel size is \"", "+", "values", "."...
Configures the convolution filter values. This only has an effect for programs that use the FRAGMENT_SHADER_EXT_FILT Fragment shader. @param values Normalized filter values; must be KERNEL_SIZE elements.
[ "Configures", "the", "convolution", "filter", "values", ".", "This", "only", "has", "an", "effect", "for", "programs", "that", "use", "the", "FRAGMENT_SHADER_EXT_FILT", "Fragment", "shader", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java#L491-L499
60,175
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java
Texture2dProgram.setTexSize
public void setTexSize(int width, int height) { mTexHeight = height; mTexWidth = width; float rw = 1.0f / width; float rh = 1.0f / height; // Don't need to create a new array here, but it's syntactically convenient. mTexOffset = new float[] { -rw, -rh, ...
java
public void setTexSize(int width, int height) { mTexHeight = height; mTexWidth = width; float rw = 1.0f / width; float rh = 1.0f / height; // Don't need to create a new array here, but it's syntactically convenient. mTexOffset = new float[] { -rw, -rh, ...
[ "public", "void", "setTexSize", "(", "int", "width", ",", "int", "height", ")", "{", "mTexHeight", "=", "height", ";", "mTexWidth", "=", "width", ";", "float", "rw", "=", "1.0f", "/", "width", ";", "float", "rh", "=", "1.0f", "/", "height", ";", "// ...
Sets the size of the texture. This is used to find adjacent texels when filtering.
[ "Sets", "the", "size", "of", "the", "texture", ".", "This", "is", "used", "to", "find", "adjacent", "texels", "when", "filtering", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java#L504-L517
60,176
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java
Texture2dProgram.draw
public void draw(float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex, int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix, FloatBuffer texBuffer, int textureId, int texStride) { GlUtil.checkGlError("draw start"); // Select the pro...
java
public void draw(float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex, int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix, FloatBuffer texBuffer, int textureId, int texStride) { GlUtil.checkGlError("draw start"); // Select the pro...
[ "public", "void", "draw", "(", "float", "[", "]", "mvpMatrix", ",", "FloatBuffer", "vertexBuffer", ",", "int", "firstVertex", ",", "int", "vertexCount", ",", "int", "coordsPerVertex", ",", "int", "vertexStride", ",", "float", "[", "]", "texMatrix", ",", "Flo...
Issues the draw call. Does the full setup on every call. @param mvpMatrix The 4x4 projection matrix. @param vertexBuffer Buffer with vertex position data. @param firstVertex Index of first vertex to use in vertexBuffer. @param vertexCount Number of vertices in vertexBuffer. @param coordsPerVertex The number of coordi...
[ "Issues", "the", "draw", "call", ".", "Does", "the", "full", "setup", "on", "every", "call", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Texture2dProgram.java#L533-L593
60,177
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/location/DeviceLocation.java
DeviceLocation.getLastKnownLocation
public static void getLastKnownLocation(Context context, boolean waitForGpsFix, final LocationResult cb) { DeviceLocation deviceLocation = new DeviceLocation(); LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); Location last_loc; last_loc = lm.ge...
java
public static void getLastKnownLocation(Context context, boolean waitForGpsFix, final LocationResult cb) { DeviceLocation deviceLocation = new DeviceLocation(); LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); Location last_loc; last_loc = lm.ge...
[ "public", "static", "void", "getLastKnownLocation", "(", "Context", "context", ",", "boolean", "waitForGpsFix", ",", "final", "LocationResult", "cb", ")", "{", "DeviceLocation", "deviceLocation", "=", "new", "DeviceLocation", "(", ")", ";", "LocationManager", "lm", ...
Get the last known location. If one is not available, fetch a fresh location @param context @param waitForGpsFix @param cb
[ "Get", "the", "last", "known", "location", ".", "If", "one", "is", "not", "available", "fetch", "a", "fresh", "location" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/location/DeviceLocation.java#L41-L55
60,178
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/Kickflip.java
Kickflip.getApiClient
public static KickflipApiClient getApiClient(Context context, KickflipCallback callback) { checkNotNull(sClientKey); checkNotNull(sClientSecret); if (sKickflip == null || !sKickflip.getConfig().getClientId().equals(sClientKey)) { sKickflip = new KickflipApiClient(context, sClientKey,...
java
public static KickflipApiClient getApiClient(Context context, KickflipCallback callback) { checkNotNull(sClientKey); checkNotNull(sClientSecret); if (sKickflip == null || !sKickflip.getConfig().getClientId().equals(sClientKey)) { sKickflip = new KickflipApiClient(context, sClientKey,...
[ "public", "static", "KickflipApiClient", "getApiClient", "(", "Context", "context", ",", "KickflipCallback", "callback", ")", "{", "checkNotNull", "(", "sClientKey", ")", ";", "checkNotNull", "(", "sClientSecret", ")", ";", "if", "(", "sKickflip", "==", "null", ...
Create a new instance of the KickflipApiClient if one hasn't yet been created, or the provided API keys don't match the existing client. @param context the context of the host application @param callback an optional callback to be notified with the Kickflip user corresponding to the provided API keys. @return
[ "Create", "a", "new", "instance", "of", "the", "KickflipApiClient", "if", "one", "hasn", "t", "yet", "been", "created", "or", "the", "provided", "API", "keys", "don", "t", "match", "the", "existing", "client", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/Kickflip.java#L336-L345
60,179
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java
KickflipApiClient.loginUser
public void loginUser(String username, final String password, final KickflipCallback cb) { GenericData data = new GenericData(); data.put("username", username); data.put("password", password); post(GET_USER_PRIVATE, new UrlEncodedContent(data), User.class, new KickflipCallback() { ...
java
public void loginUser(String username, final String password, final KickflipCallback cb) { GenericData data = new GenericData(); data.put("username", username); data.put("password", password); post(GET_USER_PRIVATE, new UrlEncodedContent(data), User.class, new KickflipCallback() { ...
[ "public", "void", "loginUser", "(", "String", "username", ",", "final", "String", "password", ",", "final", "KickflipCallback", "cb", ")", "{", "GenericData", "data", "=", "new", "GenericData", "(", ")", ";", "data", ".", "put", "(", "\"username\"", ",", "...
Login an exiting Kickflip User and make it active. @param username The Kickflip user's username @param password The Kickflip user's password @param cb This callback will receive a User in {@link io.kickflip.sdk.api.KickflipCallback#onSuccess(io.kickflip.sdk.api.json.Response)} or an Exception {@link io.kickflip....
[ "Login", "an", "exiting", "Kickflip", "User", "and", "make", "it", "active", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L214-L234
60,180
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java
KickflipApiClient.setUserInfo
public void setUserInfo(final String newPassword, String email, String displayName, Map extraInfo, final KickflipCallback cb) { if (!assertActiveUserAvailable(cb)) return; GenericData data = new GenericData(); final String finalPassword; if (newPassword != null){ data.put("ne...
java
public void setUserInfo(final String newPassword, String email, String displayName, Map extraInfo, final KickflipCallback cb) { if (!assertActiveUserAvailable(cb)) return; GenericData data = new GenericData(); final String finalPassword; if (newPassword != null){ data.put("ne...
[ "public", "void", "setUserInfo", "(", "final", "String", "newPassword", ",", "String", "email", ",", "String", "displayName", ",", "Map", "extraInfo", ",", "final", "KickflipCallback", "cb", ")", "{", "if", "(", "!", "assertActiveUserAvailable", "(", "cb", ")"...
Set the current active user's meta info. Pass a null argument to leave it as-is. @param newPassword the user's new password @param email the user's new email address @param displayName The desired display name @param extraInfo Arbitrary String data to associate with this user. @param cb This callback ...
[ "Set", "the", "current", "active", "user", "s", "meta", "info", ".", "Pass", "a", "null", "argument", "to", "leave", "it", "as", "-", "is", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L246-L275
60,181
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java
KickflipApiClient.getUserInfo
public void getUserInfo(String username, final KickflipCallback cb) { if (!assertActiveUserAvailable(cb)) return; GenericData data = new GenericData(); data.put("username", username); post(GET_USER_PUBLIC, new UrlEncodedContent(data), User.class, new KickflipCallback() { @Ov...
java
public void getUserInfo(String username, final KickflipCallback cb) { if (!assertActiveUserAvailable(cb)) return; GenericData data = new GenericData(); data.put("username", username); post(GET_USER_PUBLIC, new UrlEncodedContent(data), User.class, new KickflipCallback() { @Ov...
[ "public", "void", "getUserInfo", "(", "String", "username", ",", "final", "KickflipCallback", "cb", ")", "{", "if", "(", "!", "assertActiveUserAvailable", "(", "cb", ")", ")", "return", ";", "GenericData", "data", "=", "new", "GenericData", "(", ")", ";", ...
Get public user info @param username The Kickflip user's username @param cb This callback will receive a User in {@link io.kickflip.sdk.api.KickflipCallback#onSuccess(io.kickflip.sdk.api.json.Response)} or an Exception {@link io.kickflip.sdk.api.KickflipCallback#onError(io.kickflip.sdk.exception.KickflipExceptio...
[ "Get", "public", "user", "info" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L284-L303
60,182
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java
KickflipApiClient.stopStream
private void stopStream(User user, Stream stream, final KickflipCallback cb) { checkNotNull(stream); // TODO: Add start / stop lat lon to Stream? GenericData data = new GenericData(); data.put("stream_id", stream.getStreamId()); data.put("uuid", user.getUUID()); if (strea...
java
private void stopStream(User user, Stream stream, final KickflipCallback cb) { checkNotNull(stream); // TODO: Add start / stop lat lon to Stream? GenericData data = new GenericData(); data.put("stream_id", stream.getStreamId()); data.put("uuid", user.getUUID()); if (strea...
[ "private", "void", "stopStream", "(", "User", "user", ",", "Stream", "stream", ",", "final", "KickflipCallback", "cb", ")", "{", "checkNotNull", "(", "stream", ")", ";", "// TODO: Add start / stop lat lon to Stream?", "GenericData", "data", "=", "new", "GenericData"...
Stop a Stream owned by the given Kickflip User. @param cb This callback will receive a Stream subclass in #onSuccess(response) depending on the Kickflip account type. Implementors should check if the response is instanceof HlsStream, etc.
[ "Stop", "a", "Stream", "owned", "by", "the", "given", "Kickflip", "User", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L370-L383
60,183
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java
KickflipApiClient.handleKickflipResponse
private void handleKickflipResponse(HttpResponse response, Class<? extends Response> responseClass, KickflipCallback cb) throws IOException { if (cb == null) return; HashMap responseMap = null; Response kickFlipResponse = response.parseAs(responseClass); if (VERBOSE) Log.i(TA...
java
private void handleKickflipResponse(HttpResponse response, Class<? extends Response> responseClass, KickflipCallback cb) throws IOException { if (cb == null) return; HashMap responseMap = null; Response kickFlipResponse = response.parseAs(responseClass); if (VERBOSE) Log.i(TA...
[ "private", "void", "handleKickflipResponse", "(", "HttpResponse", "response", ",", "Class", "<", "?", "extends", "Response", ">", "responseClass", ",", "KickflipCallback", "cb", ")", "throws", "IOException", "{", "if", "(", "cb", "==", "null", ")", "return", "...
Parse the HttpResponse as the appropriate Response subclass @param response @param responseClass @param cb @throws IOException
[ "Parse", "the", "HttpResponse", "as", "the", "appropriate", "Response", "subclass" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L699-L721
60,184
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/FileUtils.java
FileUtils.getRootStorageDirectory
public static File getRootStorageDirectory(Context c, String directory_name){ File result; // First, try getting access to the sdcard partition if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){ Log.d(TAG,"Using sdcard"); result = new File(Enviro...
java
public static File getRootStorageDirectory(Context c, String directory_name){ File result; // First, try getting access to the sdcard partition if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){ Log.d(TAG,"Using sdcard"); result = new File(Enviro...
[ "public", "static", "File", "getRootStorageDirectory", "(", "Context", "c", ",", "String", "directory_name", ")", "{", "File", "result", ";", "// First, try getting access to the sdcard partition", "if", "(", "Environment", ".", "getExternalStorageState", "(", ")", ".",...
Returns a Java File initialized to a directory of given name at the root storage location, with preference to external storage. If the directory did not exist, it will be created at the conclusion of this call. If a file with conflicting name exists, this method returns null; @param c the context to determine the inte...
[ "Returns", "a", "Java", "File", "initialized", "to", "a", "directory", "of", "given", "name", "at", "the", "root", "storage", "location", "with", "preference", "to", "external", "storage", ".", "If", "the", "directory", "did", "not", "exist", "it", "will", ...
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/FileUtils.java#L54-L73
60,185
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/FileUtils.java
FileUtils.getStorageDirectory
public static File getStorageDirectory(File parent_directory, String new_child_directory_name){ File result = new File(parent_directory, new_child_directory_name); if(!result.exists()) if(result.mkdir()) return result; else{ Log.e("getStorageDirec...
java
public static File getStorageDirectory(File parent_directory, String new_child_directory_name){ File result = new File(parent_directory, new_child_directory_name); if(!result.exists()) if(result.mkdir()) return result; else{ Log.e("getStorageDirec...
[ "public", "static", "File", "getStorageDirectory", "(", "File", "parent_directory", ",", "String", "new_child_directory_name", ")", "{", "File", "result", "=", "new", "File", "(", "parent_directory", ",", "new_child_directory_name", ")", ";", "if", "(", "!", "resu...
Returns a Java File initialized to a directory of given name within the given location. @param parent_directory a File representing the directory in which the new child will reside @return a File pointing to the desired directory, or null if a file with conflicting name exists or if getRootStorageDirectory was not cal...
[ "Returns", "a", "Java", "File", "initialized", "to", "a", "directory", "of", "given", "name", "within", "the", "given", "location", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/FileUtils.java#L83-L99
60,186
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/FileUtils.java
FileUtils.createTempFile
public static File createTempFile(Context c, File root, String filename, String extension){ File output = null; try { if(filename != null){ if(!extension.contains(".")) extension = "." + extension; output = new File(root, filename + extensi...
java
public static File createTempFile(Context c, File root, String filename, String extension){ File output = null; try { if(filename != null){ if(!extension.contains(".")) extension = "." + extension; output = new File(root, filename + extensi...
[ "public", "static", "File", "createTempFile", "(", "Context", "c", ",", "File", "root", ",", "String", "filename", ",", "String", "extension", ")", "{", "File", "output", "=", "null", ";", "try", "{", "if", "(", "filename", "!=", "null", ")", "{", "if"...
Returns a TempFile with given root, filename, and extension. The resulting TempFile is safe for use with Android's MediaRecorder @param c @param root @param filename @param extension @return
[ "Returns", "a", "TempFile", "with", "given", "root", "filename", "and", "extension", ".", "The", "resulting", "TempFile", "is", "safe", "for", "use", "with", "Android", "s", "MediaRecorder" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/FileUtils.java#L110-L126
60,187
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/FileUtils.java
FileUtils.tail2
public static String tail2( File file, int lines) { lines++; // Read # lines inclusive java.io.RandomAccessFile fileHandler = null; try { fileHandler = new java.io.RandomAccessFile( file, "r" ); long fileLength = fileHandler.length() - 1; ...
java
public static String tail2( File file, int lines) { lines++; // Read # lines inclusive java.io.RandomAccessFile fileHandler = null; try { fileHandler = new java.io.RandomAccessFile( file, "r" ); long fileLength = fileHandler.length() - 1; ...
[ "public", "static", "String", "tail2", "(", "File", "file", ",", "int", "lines", ")", "{", "lines", "++", ";", "// Read # lines inclusive", "java", ".", "io", ".", "RandomAccessFile", "fileHandler", "=", "null", ";", "try", "{", "fileHandler", "=", "new", ...
Read the last few lines of a file @param file the source file @param lines the number of lines to read @return the String result
[ "Read", "the", "last", "few", "lines", "of", "a", "file" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/FileUtils.java#L182-L226
60,188
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/FileUtils.java
FileUtils.deleteDirectory
public static void deleteDirectory(File fileOrDirectory) { if (fileOrDirectory.isDirectory()) for (File child : fileOrDirectory.listFiles()) deleteDirectory(child); fileOrDirectory.delete(); }
java
public static void deleteDirectory(File fileOrDirectory) { if (fileOrDirectory.isDirectory()) for (File child : fileOrDirectory.listFiles()) deleteDirectory(child); fileOrDirectory.delete(); }
[ "public", "static", "void", "deleteDirectory", "(", "File", "fileOrDirectory", ")", "{", "if", "(", "fileOrDirectory", ".", "isDirectory", "(", ")", ")", "for", "(", "File", "child", ":", "fileOrDirectory", ".", "listFiles", "(", ")", ")", "deleteDirectory", ...
Delete a directory and all its contents
[ "Delete", "a", "directory", "and", "all", "its", "contents" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/FileUtils.java#L231-L237
60,189
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Muxer.java
Muxer.getNextRelativePts
protected long getNextRelativePts(long absPts, int trackIndex) { if (mFirstPts == 0) { mFirstPts = absPts; return 0; } return getSafePts(absPts - mFirstPts, trackIndex); }
java
protected long getNextRelativePts(long absPts, int trackIndex) { if (mFirstPts == 0) { mFirstPts = absPts; return 0; } return getSafePts(absPts - mFirstPts, trackIndex); }
[ "protected", "long", "getNextRelativePts", "(", "long", "absPts", ",", "int", "trackIndex", ")", "{", "if", "(", "mFirstPts", "==", "0", ")", "{", "mFirstPts", "=", "absPts", ";", "return", "0", ";", "}", "return", "getSafePts", "(", "absPts", "-", "mFir...
Return a relative pts given an absolute pts and trackIndex. This method advances the state of the Muxer, and must only be called once per call to {@link #writeSampleData(android.media.MediaCodec, int, int, java.nio.ByteBuffer, android.media.MediaCodec.BufferInfo)}.
[ "Return", "a", "relative", "pts", "given", "an", "absolute", "pts", "and", "trackIndex", "." ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Muxer.java#L164-L170
60,190
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Muxer.java
Muxer.getSafePts
private long getSafePts(long pts, int trackIndex) { if (mLastPts[trackIndex] >= pts) { // Enforce a non-zero minimum spacing // between pts mLastPts[trackIndex] += 9643; return mLastPts[trackIndex]; } mLastPts[trackIndex] = pts; return pts;...
java
private long getSafePts(long pts, int trackIndex) { if (mLastPts[trackIndex] >= pts) { // Enforce a non-zero minimum spacing // between pts mLastPts[trackIndex] += 9643; return mLastPts[trackIndex]; } mLastPts[trackIndex] = pts; return pts;...
[ "private", "long", "getSafePts", "(", "long", "pts", ",", "int", "trackIndex", ")", "{", "if", "(", "mLastPts", "[", "trackIndex", "]", ">=", "pts", ")", "{", "// Enforce a non-zero minimum spacing", "// between pts", "mLastPts", "[", "trackIndex", "]", "+=", ...
Sometimes packets with non-increasing pts are dequeued from the MediaCodec output buffer. This method ensures that a crash won't occur due to non monotonically increasing packet timestamp.
[ "Sometimes", "packets", "with", "non", "-", "increasing", "pts", "are", "dequeued", "from", "the", "MediaCodec", "output", "buffer", ".", "This", "method", "ensures", "that", "a", "crash", "won", "t", "occur", "due", "to", "non", "monotonically", "increasing",...
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Muxer.java#L176-L185
60,191
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/Filters.java
Filters.updateFilter
public static void updateFilter(FullFrameRect rect, int newFilter) { Texture2dProgram.ProgramType programType; float[] kernel = null; float colorAdj = 0.0f; if (VERBOSE) Log.d(TAG, "Updating filter to " + newFilter); switch (newFilter) { case FILTER_NONE: ...
java
public static void updateFilter(FullFrameRect rect, int newFilter) { Texture2dProgram.ProgramType programType; float[] kernel = null; float colorAdj = 0.0f; if (VERBOSE) Log.d(TAG, "Updating filter to " + newFilter); switch (newFilter) { case FILTER_NONE: ...
[ "public", "static", "void", "updateFilter", "(", "FullFrameRect", "rect", ",", "int", "newFilter", ")", "{", "Texture2dProgram", ".", "ProgramType", "programType", ";", "float", "[", "]", "kernel", "=", "null", ";", "float", "colorAdj", "=", "0.0f", ";", "if...
Updates the filter on the provided FullFrameRect @return the int code of the new filter
[ "Updates", "the", "filter", "on", "the", "provided", "FullFrameRect" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Filters.java#L47-L136
60,192
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/SizeableFrameRect.java
SizeableFrameRect.drawFrame
public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0, mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(), ...
java
public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0, mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(), ...
[ "public", "void", "drawFrame", "(", "int", "textureId", ",", "float", "[", "]", "texMatrix", ")", "{", "// Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.", "mProgram", ".", "draw", "(", "IDENTITY_MATRIX", ",", "mRectDrawable", ".", "getVert...
Draws a rectangle in an area defined by TEX_COORDS
[ "Draws", "a", "rectangle", "in", "an", "area", "defined", "by", "TEX_COORDS" ]
af3aae5f1128d7376e67aefe11a3a1a3844be734
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/SizeableFrameRect.java#L97-L103
60,193
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java
PgStatement.isOneShotQuery
protected boolean isOneShotQuery(CachedQuery cachedQuery) { if (cachedQuery == null) { return true; } cachedQuery.increaseExecuteCount(); if ((mPrepareThreshold == 0 || cachedQuery.getExecuteCount() < mPrepareThreshold) && !getForceBinaryTransfer()) { return true; } return fa...
java
protected boolean isOneShotQuery(CachedQuery cachedQuery) { if (cachedQuery == null) { return true; } cachedQuery.increaseExecuteCount(); if ((mPrepareThreshold == 0 || cachedQuery.getExecuteCount() < mPrepareThreshold) && !getForceBinaryTransfer()) { return true; } return fa...
[ "protected", "boolean", "isOneShotQuery", "(", "CachedQuery", "cachedQuery", ")", "{", "if", "(", "cachedQuery", "==", "null", ")", "{", "return", "true", ";", "}", "cachedQuery", ".", "increaseExecuteCount", "(", ")", ";", "if", "(", "(", "mPrepareThreshold",...
Returns true if query is unlikely to be reused. @param cachedQuery to check (null if current query) @return true if query is unlikely to be reused
[ "Returns", "true", "if", "query", "is", "unlikely", "to", "be", "reused", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java#L355-L365
60,194
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java
PgStatement.setQueryTimeoutMs
public void setQueryTimeoutMs(long millis) throws SQLException { checkClosed(); if (millis < 0) { throw new PSQLException(GT.tr("Query timeout must be a value greater than or equals to 0."), PSQLState.INVALID_PARAMETER_VALUE); } timeout = millis; }
java
public void setQueryTimeoutMs(long millis) throws SQLException { checkClosed(); if (millis < 0) { throw new PSQLException(GT.tr("Query timeout must be a value greater than or equals to 0."), PSQLState.INVALID_PARAMETER_VALUE); } timeout = millis; }
[ "public", "void", "setQueryTimeoutMs", "(", "long", "millis", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "if", "(", "millis", "<", "0", ")", "{", "throw", "new", "PSQLException", "(", "GT", ".", "tr", "(", "\"Query timeout must be a va...
Sets the queryTimeout limit. @param millis - the new query timeout limit in milliseconds @throws SQLException if a database access error occurs
[ "Sets", "the", "queryTimeout", "limit", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java#L556-L564
60,195
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java
PGPooledConnection.close
@Override public void close() throws SQLException { if (last != null) { last.close(); if (!con.isClosed()) { if (!con.getAutoCommit()) { try { con.rollback(); } catch (SQLException ignored) { } } } } try { con.close(); }...
java
@Override public void close() throws SQLException { if (last != null) { last.close(); if (!con.isClosed()) { if (!con.getAutoCommit()) { try { con.rollback(); } catch (SQLException ignored) { } } } } try { con.close(); }...
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "SQLException", "{", "if", "(", "last", "!=", "null", ")", "{", "last", ".", "close", "(", ")", ";", "if", "(", "!", "con", ".", "isClosed", "(", ")", ")", "{", "if", "(", "!", "co...
Closes the physical database connection represented by this PooledConnection. If any client has a connection based on this PooledConnection, it is forcibly closed as well.
[ "Closes", "the", "physical", "database", "connection", "represented", "by", "this", "PooledConnection", ".", "If", "any", "client", "has", "a", "connection", "based", "on", "this", "PooledConnection", "it", "is", "forcibly", "closed", "as", "well", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java#L82-L100
60,196
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java
PGPooledConnection.getConnection
@Override public Connection getConnection() throws SQLException { if (con == null) { // Before throwing the exception, let's notify the registered listeners about the error PSQLException sqlException = new PSQLException(GT.tr("This PooledConnection has already been closed."), P...
java
@Override public Connection getConnection() throws SQLException { if (con == null) { // Before throwing the exception, let's notify the registered listeners about the error PSQLException sqlException = new PSQLException(GT.tr("This PooledConnection has already been closed."), P...
[ "@", "Override", "public", "Connection", "getConnection", "(", ")", "throws", "SQLException", "{", "if", "(", "con", "==", "null", ")", "{", "// Before throwing the exception, let's notify the registered listeners about the error", "PSQLException", "sqlException", "=", "new...
Gets a handle for a client to use. This is a wrapper around the physical connection, so the client can call close and it will just return the connection to the pool without really closing the pgysical connection. <p> According to the JDBC 2.0 Optional Package spec (6.2.3), only one client may have an active handle to ...
[ "Gets", "a", "handle", "for", "a", "client", "to", "use", ".", "This", "is", "a", "wrapper", "around", "the", "physical", "connection", "so", "the", "client", "can", "call", "close", "and", "it", "will", "just", "return", "the", "connection", "to", "the"...
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java#L113-L157
60,197
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java
PGPooledConnection.fireConnectionClosed
void fireConnectionClosed() { ConnectionEvent evt = null; // Copy the listener list so the listener can remove itself during this method call ConnectionEventListener[] local = listeners.toArray(new ConnectionEventListener[0]); for (ConnectionEventListener listener : local) { if (evt == nul...
java
void fireConnectionClosed() { ConnectionEvent evt = null; // Copy the listener list so the listener can remove itself during this method call ConnectionEventListener[] local = listeners.toArray(new ConnectionEventListener[0]); for (ConnectionEventListener listener : local) { if (evt == nul...
[ "void", "fireConnectionClosed", "(", ")", "{", "ConnectionEvent", "evt", "=", "null", ";", "// Copy the listener list so the listener can remove itself during this method call", "ConnectionEventListener", "[", "]", "local", "=", "listeners", ".", "toArray", "(", "new", "Con...
Used to fire a connection closed event to all listeners.
[ "Used", "to", "fire", "a", "connection", "closed", "event", "to", "all", "listeners", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPooledConnection.java#L162-L173
60,198
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/largeobject/BlobInputStream.java
BlobInputStream.read
public int read() throws java.io.IOException { checkClosed(); try { if (limit > 0 && apos >= limit) { return -1; } if (buffer == null || bpos >= buffer.length) { buffer = lo.read(bsize); bpos = 0; } // Handle EOF if (bpos >= buffer.length) { r...
java
public int read() throws java.io.IOException { checkClosed(); try { if (limit > 0 && apos >= limit) { return -1; } if (buffer == null || bpos >= buffer.length) { buffer = lo.read(bsize); bpos = 0; } // Handle EOF if (bpos >= buffer.length) { r...
[ "public", "int", "read", "(", ")", "throws", "java", ".", "io", ".", "IOException", "{", "checkClosed", "(", ")", ";", "try", "{", "if", "(", "limit", ">", "0", "&&", "apos", ">=", "limit", ")", "{", "return", "-", "1", ";", "}", "if", "(", "bu...
The minimum required to implement input stream.
[ "The", "minimum", "required", "to", "implement", "input", "stream", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/largeobject/BlobInputStream.java#L84-L112
60,199
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/LruCache.java
LruCache.borrow
public synchronized Value borrow(Key key) throws SQLException { Value value = cache.remove(key); if (value == null) { return createAction.create(key); } currentSize -= value.getSize(); return value; }
java
public synchronized Value borrow(Key key) throws SQLException { Value value = cache.remove(key); if (value == null) { return createAction.create(key); } currentSize -= value.getSize(); return value; }
[ "public", "synchronized", "Value", "borrow", "(", "Key", "key", ")", "throws", "SQLException", "{", "Value", "value", "=", "cache", ".", "remove", "(", "key", ")", ";", "if", "(", "value", "==", "null", ")", "{", "return", "createAction", ".", "create", ...
Borrows an entry from the cache. @param key cache key @return entry from cache or newly created entry if cache does not contain given key. @throws SQLException if entry creation fails
[ "Borrows", "an", "entry", "from", "the", "cache", "." ]
95ba7b261e39754674c5817695ae5ebf9a341fae
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/LruCache.java#L112-L119