proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
weibocom_motan | motan/motan-manager/src/main/java/com/weibo/utils/ZkClientWrapper.java | ZkClientWrapper | init | class ZkClientWrapper {
@Value("${registry.url}")
private String registryUrl;
private ZkClient zkClient;
@PostConstruct
void init() {<FILL_FUNCTION_BODY>}
@PreDestroy
void destory() {
zkClient = null;
}
public ZkClient getZkClient() {
return zkClient;
}
} |
try {
zkClient = new ZkClient(registryUrl, 10000, 10000, new StringSerializer());
} catch (Exception e) {
throw new MotanFrameworkException("Fail to connect zookeeper, cause: " + e.getMessage());
}
| 113 | 77 | 190 | <no_super_class> |
weibocom_motan | motan/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulHeartbeatManager.java | ConsulHeartbeatManager | start | class ConsulHeartbeatManager {
private MotanConsulClient client;
// 所有需要进行心跳的serviceid.
private ConcurrentHashSet<String> serviceIds = new ConcurrentHashSet<String>();
private ThreadPoolExecutor jobExecutor;
private ScheduledExecutorService heartbeatExecutor;
// 上一次心跳开关的状态
private boolean lastHeartBeatSwitcherS... |
heartbeatExecutor.scheduleAtFixedRate(
new Runnable() {
@Override
public void run() {
// 由于consul的check set pass会导致consul
// server的写磁盘操作,过于频繁的心跳会导致consul
// 性能问题,只能将心跳方式改为较长的周期进行一次探测。又因为想在关闭心跳开关后尽快感知
// 就将心跳改为以较小周期检测心跳开关是否变动,连续检测多次后给consul server发送一次心跳。
// TODO 改为开关listen... | 970 | 417 | 1,387 | <no_super_class> |
weibocom_motan | motan/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulRegistryFactory.java | ConsulRegistryFactory | createRegistry | class ConsulRegistryFactory extends AbstractRegistryFactory {
@Override
protected Registry createRegistry(URL url) {<FILL_FUNCTION_BODY>}
} |
String host = ConsulConstants.DEFAULT_HOST;
int port = ConsulConstants.DEFAULT_PORT;
if (StringUtils.isNotBlank(url.getHost())) {
host = url.getHost();
}
if (url.getPort() > 0) {
port = url.getPort();
}
//可以使用不同的client实现
MotanConsu... | 43 | 126 | 169 | <methods>public non-sealed void <init>() ,public com.weibo.api.motan.registry.Registry getRegistry(com.weibo.api.motan.rpc.URL) <variables>private static final java.util.concurrent.locks.ReentrantLock lock,private static final ConcurrentHashMap<java.lang.String,com.weibo.api.motan.registry.Registry> registries |
weibocom_motan | motan/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/ConsulUtils.java | ConsulUtils | buildService | class ConsulUtils {
/**
* 判断两个list中的url是否一致。 如果任意一个list为空,则返回false; 此方法并未做严格互相判等
*
* @param urls1
* @param urls2
* @return
*/
public static boolean isSame(List<URL> urls1, List<URL> urls2) {
if (urls1 == null || urls2 == null) {
return false;
}
... |
ConsulService service = new ConsulService();
service.setAddress(url.getHost());
service.setId(ConsulUtils.convertConsulSerivceId(url));
service.setName(ConsulUtils.convertGroupToServiceName(url.getGroup()));
service.setPort(url.getPort());
service.setTtl(ConsulConstants.... | 1,113 | 191 | 1,304 | <no_super_class> |
weibocom_motan | motan/motan-registry-consul/src/main/java/com/weibo/api/motan/registry/consul/client/ConsulEcwidClient.java | ConsulEcwidClient | lookupHealthService | class ConsulEcwidClient extends MotanConsulClient {
protected ConsulClient client;
public ConsulEcwidClient(String host, int port) {
super(host, port);
client = new ConsulClient(host, port);
LoggerUtil.info("ConsulEcwidClient init finish. client host:" + host
+ ", port:"... |
QueryParams queryParams = new QueryParams(
ConsulConstants.CONSUL_BLOCK_TIME_SECONDS, lastConsulIndex);
Response<List<HealthService>> orgResponse = client.getHealthServices(
serviceName, true, queryParams);
ConsulResponse<List<ConsulService>> newResponse = null;
... | 680 | 411 | 1,091 | <methods>public void <init>(java.lang.String, int) ,public abstract void checkFail(java.lang.String) ,public abstract void checkPass(java.lang.String) ,public abstract java.lang.String lookupCommand(java.lang.String) ,public abstract ConsulResponse<List<com.weibo.api.motan.registry.consul.ConsulService>> lookupHealthSe... |
weibocom_motan | motan/motan-registry-weibomesh/src/main/java/com/weibo/api/motan/registry/weibomesh/DefaultHttpMeshTransport.java | DefaultHttpMeshTransport | postManageRequest | class DefaultHttpMeshTransport implements MeshTransport {
private HttpClient httpClient;
private static final int DEFAULT_TIMEOUT = 5000;
public DefaultHttpMeshTransport() {
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
connectionManager.se... |
HttpPost httpPost = new HttpPost(url);
if (content != null) {
try {
httpPost.setEntity(new StringEntity(content, "UTF-8"));
} catch (UnsupportedCharsetException e) {
throw new MotanServiceException("DefaultHttpMeshTransport convert post parmas fai... | 759 | 107 | 866 | <no_super_class> |
weibocom_motan | motan/motan-registry-weibomesh/src/main/java/com/weibo/api/motan/registry/weibomesh/MeshRegistryFactory.java | MeshRegistryFactory | getRegistryUri | class MeshRegistryFactory extends AbstractRegistryFactory {
@Override
protected Registry createRegistry(URL url) {
return new MeshRegistry(url, new DefaultHttpMeshTransport());
}
@Override
protected String getRegistryUri(URL url) {<FILL_FUNCTION_BODY>}
} |
// registry uri with proxy registry
String proxyRegistry = url.getParameter(URLParamType.proxyRegistryUrlString.name());
if (StringUtils.isBlank(proxyRegistry)) {
proxyRegistry = url.getParameter(url.getParameter(URLParamType.meshRegistryName.name()));
}
String regis... | 78 | 105 | 183 | <methods>public non-sealed void <init>() ,public com.weibo.api.motan.registry.Registry getRegistry(com.weibo.api.motan.rpc.URL) <variables>private static final java.util.concurrent.locks.ReentrantLock lock,private static final ConcurrentHashMap<java.lang.String,com.weibo.api.motan.registry.Registry> registries |
weibocom_motan | motan/motan-registry-weibomesh/src/main/java/com/weibo/api/motan/registry/weibomesh/MeshRegistryListener.java | MeshRegistryListener | doNotify | class MeshRegistryListener implements NotifyListener {
private static int DEFAULT_COPY = 2;
private MeshRegistry meshRegistry;
private ConcurrentHashSet<NotifyListener> listeners = new ConcurrentHashSet<>();
private ImmutableList<URL> meshNodes;
private URL subscribeUrl;
private List<URL> backup... |
for (NotifyListener listener : listeners) {
try {
if (useMesh) {
listener.notify(meshRegistry.getUrl(), meshNodes);
} else {
if (CollectionUtil.isEmpty(backupNodes)) {
LoggerUtil.info("mesh registry back... | 652 | 173 | 825 | <no_super_class> |
weibocom_motan | motan/motan-registry-zookeeper/src/main/java/com/weibo/api/motan/registry/zookeeper/StringSerializer.java | StringSerializer | deserialize | class StringSerializer extends SerializableSerializer {
@Override
public Object deserialize(byte[] bytes) throws ZkMarshallingError {<FILL_FUNCTION_BODY>}
@Override
public byte[] serialize(Object obj) throws ZkMarshallingError {
try {
return obj.toString().getBytes("UTF-8");
... |
if (bytes == null){
return null;
}
try {
if (bytes.length > 1 && ByteUtil.bytes2short(bytes, 0) == ObjectStreamConstants.STREAM_MAGIC) {
return super.deserialize(bytes);
}
return new String(bytes, "UTF-8");
} catch (Unsuppo... | 120 | 114 | 234 | <no_super_class> |
weibocom_motan | motan/motan-registry-zookeeper/src/main/java/com/weibo/api/motan/registry/zookeeper/ZookeeperRegistryFactory.java | ZookeeperRegistryFactory | createRegistry | class ZookeeperRegistryFactory extends AbstractRegistryFactory {
@Override
protected Registry createRegistry(URL registryUrl) {<FILL_FUNCTION_BODY>}
protected ZkClient createInnerZkClient(String zkServers, int sessionTimeout, int connectionTimeout) {
return new ZkClient(zkServers, sessionTimeout, c... |
try {
int timeout = registryUrl.getIntParameter(URLParamType.connectTimeout.getName(), URLParamType.connectTimeout.getIntValue());
int sessionTimeout = registryUrl.getIntParameter(URLParamType.registrySessionTimeout.getName(), URLParamType.registrySessionTimeout.getIntValue());
... | 94 | 173 | 267 | <methods>public non-sealed void <init>() ,public com.weibo.api.motan.registry.Registry getRegistry(com.weibo.api.motan.rpc.URL) <variables>private static final java.util.concurrent.locks.ReentrantLock lock,private static final ConcurrentHashMap<java.lang.String,com.weibo.api.motan.registry.Registry> registries |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/BasicRefererConfigBean.java | BasicRefererConfigBean | extractRegistries | class BasicRefererConfigBean extends BasicRefererInterfaceConfig implements BeanNameAware, InitializingBean, BeanFactoryAware {
private String protocolNames;
private String registryNames;
private BeanFactory beanFactory;
@Override
public void setBeanName(String name) {
setId(name);
... |
if (registries != null && registries.length() > 0) {
List<RegistryConfig> registryConfigList = SpringBeanUtil.getMultiBeans(beanFactory, registries,
SpringBeanUtil.COMMA_SPLIT_PATTERN, RegistryConfig.class);
return registryConfigList;
} else {
ret... | 457 | 92 | 549 | <methods>public non-sealed void <init>() ,public java.lang.Boolean isDefault() ,public void setDefault(boolean) <variables>private java.lang.Boolean isDefault,private static final long serialVersionUID |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/BasicServiceConfigBean.java | BasicServiceConfigBean | extractProtocols | class BasicServiceConfigBean extends BasicServiceInterfaceConfig implements BeanNameAware,
InitializingBean, BeanFactoryAware {
private String registryNames;
BeanFactory beanFactory;
@Override
public void setBeanName(String name) {
setId(name);
MotanNamespaceHandler.basicSer... |
if (protocols != null && protocols.length() > 0) {
List<ProtocolConfig> protocolConfigList = SpringBeanUtil.getMultiBeans(beanFactory, protocols,
SpringBeanUtil.COMMA_SPLIT_PATTERN, ProtocolConfig.class);
return protocolConfigList;
} else {
retur... | 503 | 91 | 594 | <methods>public non-sealed void <init>() ,public java.lang.Boolean isDefault() ,public void setDefault(boolean) <variables>private java.lang.Boolean isDefault,private static final long serialVersionUID |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/MotanNamespaceHandler.java | MotanNamespaceHandler | init | class MotanNamespaceHandler extends NamespaceHandlerSupport {
public final static Set<String> protocolDefineNames = new ConcurrentHashSet<>();
public final static Set<String> registryDefineNames = new ConcurrentHashSet<>();
public final static Set<String> basicServiceConfigDefineNames = new ConcurrentHashSe... |
registerBeanDefinitionParser("referer", new MotanBeanDefinitionParser(RefererConfigBean.class, false));
registerBeanDefinitionParser("service", new MotanBeanDefinitionParser(ServiceConfigBean.class, true));
registerBeanDefinitionParser("protocol", new MotanBeanDefinitionParser(ProtocolConfig.cl... | 127 | 251 | 378 | <no_super_class> |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/RefererConfigBean.java | RefererConfigBean | checkAndConfigBasicConfig | class RefererConfigBean<T> extends RefererConfig<T> implements FactoryBean<T>, BeanFactoryAware, InitializingBean, DisposableBean {
private static final long serialVersionUID = 8381310907161365567L;
private transient BeanFactory beanFactory;
@Override
public T getObject() throws Exception {
r... |
if (getBasicReferer() == null) {
if (MotanNamespaceHandler.basicRefererConfigDefineNames.size() == 0) {
if (beanFactory instanceof ListableBeanFactory) {
ListableBeanFactory listableBeanFactory = (ListableBeanFactory) beanFactory;
String[] bas... | 1,151 | 283 | 1,434 | <methods>public non-sealed void <init>() ,public synchronized void destroy() ,public com.weibo.api.motan.config.BasicRefererInterfaceConfig getBasicReferer() ,public List<ClusterSupport<T>> getClusterSupports() ,public java.lang.String getDirectUrl() ,public java.util.concurrent.atomic.AtomicBoolean getInitialized() ,p... |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/ServiceConfigBean.java | ServiceConfigBean | checkAndConfigExport | class ServiceConfigBean<T> extends ServiceConfig<T>
implements
BeanFactoryAware,
InitializingBean,
DisposableBean,
ApplicationListener<ContextRefreshedEvent> {
private static final long serialVersionUID = -7247592395983804440L;
private transient BeanFactory beanFactory;... |
if (StringUtils.isBlank(getExport()) && getBasicService() != null
&& !StringUtils.isBlank(getBasicService().getExport())) {
setExport(getBasicService().getExport());
if (getBasicService().getProtocols() != null) {
setProtocols(new ArrayList<ProtocolConfig... | 927 | 446 | 1,373 | <methods>public non-sealed void <init>() ,public synchronized void export() ,public com.weibo.api.motan.config.BasicServiceInterfaceConfig getBasicService() ,public static ConcurrentHashSet<java.lang.String> getExistingServices() ,public java.util.concurrent.atomic.AtomicBoolean getExported() ,public List<Exporter<T>> ... |
weibocom_motan | motan/motan-springsupport/src/main/java/com/weibo/api/motan/config/springsupport/util/SpringBeanUtil.java | SpringBeanUtil | getMultiBeans | class SpringBeanUtil {
public static final String COMMA_SPLIT_PATTERN = "\\s*[,]+\\s*";
public static <T> List<T> getMultiBeans(BeanFactory beanFactory, String names, String pattern, Class<T> clazz) {<FILL_FUNCTION_BODY>}
public static void addRegistryParamBean(RegistryConfig registryConfig, BeanFactory b... |
String[] nameArr = names.split(pattern);
List<T> beans = new ArrayList<T>();
for (String name : nameArr) {
if (name != null && name.length() > 0) {
beans.add(beanFactory.getBean(name, clazz));
}
}
return beans;
| 326 | 88 | 414 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyChannel.java | NettyChannel | request | class NettyChannel implements com.weibo.api.motan.transport.Channel {
private volatile ChannelState state = ChannelState.UNINIT;
private NettyClient nettyClient;
private org.jboss.netty.channel.Channel channel = null;
private InetSocketAddress remoteAddress;
private InetSocketAddress localAddress... |
int timeout = 0;
if (request.getAttachments().get(MotanConstants.M2_TIMEOUT) != null) { // timeout from request
timeout = MathUtil.parseInt(request.getAttachments().get(MotanConstants.M2_TIMEOUT), 0);
}
if (timeout == 0) { // timeout from url
timeout = nettyClien... | 1,199 | 648 | 1,847 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyChannelFactory.java | NettyChannelFactory | activateObject | class NettyChannelFactory extends BasePoolableObjectFactory {
private String factoryName;
private NettyClient nettyClient;
public NettyChannelFactory(NettyClient nettyClient) {
super();
this.nettyClient = nettyClient;
this.factoryName = "NettyChannelFactory_" + nettyClient.getUrl()... |
if (obj instanceof NettyChannel) {
final NettyChannel client = (NettyChannel) obj;
if (!client.isAvailable()) {
client.open();
}
}
| 450 | 51 | 501 | <methods>public void <init>() ,public void activateObject(java.lang.Object) throws java.lang.Exception,public void destroyObject(java.lang.Object) throws java.lang.Exception,public abstract java.lang.Object makeObject() throws java.lang.Exception,public void passivateObject(java.lang.Object) throws java.lang.Exception,... |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyChannelHandler.java | NettyChannelHandler | exceptionCaught | class NettyChannelHandler extends SimpleChannelHandler implements StatisticCallback {
private ThreadPoolExecutor threadPoolExecutor;
private MessageHandler messageHandler;
private Channel serverChannel;
private AtomicInteger rejectCounter = new AtomicInteger(0);
public NettyChannelHandler(Channel s... |
LoggerUtil.error("NettyChannelHandler exceptionCaught: remote=" + ctx.getChannel().getRemoteAddress()
+ " local=" + ctx.getChannel().getLocalAddress() + " event=" + e.getCause(), e.getCause());
ctx.getChannel().close();
| 1,661 | 77 | 1,738 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyDecoder.java | NettyDecoder | decode | class NettyDecoder extends FrameDecoder {
private Codec codec;
private com.weibo.api.motan.transport.Channel client;
private int maxContentLength = 0;
public NettyDecoder(Codec codec, com.weibo.api.motan.transport.Channel client, int maxContentLength) {
this.codec = codec;
this.client ... |
//根据版本号决定走哪个分支
if (buffer.readableBytes() <= MotanConstants.NETTY_HEADER) {
return null;
}
buffer.markReaderIndex();
int startIndex = buffer.readerIndex();
short type = buffer.readShort();
if (type != MotanConstants.NETTY_MAGIC_TYPE) {
bu... | 1,345 | 475 | 1,820 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyEncoder.java | NettyEncoder | getType | class NettyEncoder extends OneToOneEncoder {
private Codec codec;
private com.weibo.api.motan.transport.Channel client;
public NettyEncoder(Codec codec, com.weibo.api.motan.transport.Channel client) {
this.codec = codec;
this.client = client;
}
@Override
protected Object encode... |
if (message instanceof Request) {
return MotanConstants.FLAG_REQUEST;
} else if (message instanceof Response) {
return MotanConstants.FLAG_RESPONSE;
} else {
return MotanConstants.FLAG_OTHER;
}
| 857 | 68 | 925 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyServer.java | NettyServer | close | class NettyServer extends AbstractServer implements StatisticCallback {
// default io thread is Runtime.getRuntime().availableProcessors() * 2
private final static ChannelFactory channelFactory = new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(new DefaultThreadFactory("nettyServerBo... |
if (state.isCloseState()) {
return;
}
try {
cleanup();
if (state.isUnInitState()) {
LoggerUtil.info("NettyServer close fail: state={}, url={}", state.value, url.getUri());
return;
}
// 设置close状态
... | 1,849 | 160 | 2,009 | <methods>public void <init>() ,public void <init>(com.weibo.api.motan.rpc.URL) ,public com.weibo.api.motan.transport.Channel getChannel(java.net.InetSocketAddress) ,public Collection<com.weibo.api.motan.transport.Channel> getChannels() ,public java.net.InetSocketAddress getLocalAddress() ,public java.net.InetSocketAddr... |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyServerChannelManage.java | NettyServerChannelManage | getChannelKey | class NettyServerChannelManage extends SimpleChannelHandler {
private ConcurrentMap<String, Channel> channels = new ConcurrentHashMap<String, Channel>();
private int maxChannel = 0;
public NettyServerChannelManage(int maxChannel) {
super();
this.maxChannel = maxChannel;
}
@Override
public void channelConne... |
String key = "";
if (local == null || local.getAddress() == null) {
key += "null-";
} else {
key += local.getAddress().getHostAddress() + ":" + local.getPort() + "-";
}
if (remote == null || remote.getAddress() == null) {
key += "null";
} else {
key += remote.getAddress().getHostAddress() + ":... | 569 | 132 | 701 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/ProtectedExecutionHandler.java | ProtectedExecutionHandler | handleUpstream | class ProtectedExecutionHandler extends ExecutionHandler {
private ThreadPoolExecutor threadPoolExecutor;
ProtectedExecutionHandler(final ThreadPoolExecutor threadPoolExecutor) {
super(threadPoolExecutor);
this.threadPoolExecutor = threadPoolExecutor;
}
/**
* if RejectedExecutionException happen, send 503 e... |
try {
super.handleUpstream(context, e);
} catch (RejectedExecutionException rejectException) {
if (e instanceof MessageEvent) {
if (((MessageEvent) e).getMessage() instanceof Request) {
Request request = (Request) ((MessageEvent) e).getMessage();
DefaultResponse response = new DefaultResponse()... | 123 | 285 | 408 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/StandardThreadExecutor.java | StandardThreadExecutor | execute | class StandardThreadExecutor extends ThreadPoolExecutor {
public static final int DEFAULT_MIN_THREADS = 20;
public static final int DEFAULT_MAX_THREADS = 200;
public static final int DEFAULT_MAX_IDLE_TIME = 60 * 1000; // 1 minutes
protected AtomicInteger submittedTasksCount; // 正在处理的任务数
private int maxSubmitted... |
int count = submittedTasksCount.incrementAndGet();
// 超过最大的并发任务限制,进行 reject
// 依赖的LinkedTransferQueue没有长度限制,因此这里进行控制
if (count > maxSubmittedTaskCount) {
submittedTasksCount.decrementAndGet();
getRejectedExecutionHandler().rejectedExecution(command, this);
}
try {
super.execute(command);
} ca... | 741 | 194 | 935 | <methods>public void <init>(int, int, long, java.util.concurrent.TimeUnit, BlockingQueue<java.lang.Runnable>) ,public void <init>(int, int, long, java.util.concurrent.TimeUnit, BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory) ,public void <init>(int, int, long, java.util.concurrent.TimeUnit, Block... |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/admin/AdminHttpServer.java | AdminHttpServer | open | class AdminHttpServer extends AbstractAdminServer {
private final static ChannelFactory channelFactory = new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(new DefaultThreadFactory("AdminHttpServerBoss", true)),
Executors.newCachedThreadPool(new DefaultThreadFactory("AdminHttpS... |
if (state.isAliveState()) {
return true;
}
final int maxContentLength = url.getIntParameter(URLParamType.maxContentLength.getName(),
URLParamType.maxContentLength.getIntValue());
standardThreadExecutor = (standardThreadExecutor != null && !standardThreadExecu... | 1,179 | 507 | 1,686 | <methods>public non-sealed void <init>() ,public com.weibo.api.motan.admin.AdminHandler getAdminHandler() ,public com.weibo.api.motan.rpc.URL getUrl() <variables>protected com.weibo.api.motan.admin.AdminHandler adminHandler,protected com.weibo.api.motan.rpc.URL url |
weibocom_motan | motan/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/admin/NettyAdminServerFactory.java | NettyAdminServerFactory | createServer | class NettyAdminServerFactory implements AdminServerFactory {
@Override
public AdminServer createServer(URL url, AdminHandler adminHandler) {<FILL_FUNCTION_BODY>}
} |
if (adminHandler == null) {
throw new MotanFrameworkException("AdminHandler can not be null");
}
String protocol = url.getProtocol();
if ("http".equals(protocol)) {
return new AdminHttpServer(url, adminHandler);
} else if ("motan2".equals(protocol)) {
... | 51 | 119 | 170 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/CodecUtil.java | CodecUtil | encodeMessage | class CodecUtil {
public static byte[] encodeObjectToBytes(Channel channel, Codec codec, Object msg) {
try {
byte[] data = encodeMessage(channel, codec, msg);
short type = ByteUtil.bytes2short(data, 0);
if (type == DefaultRpcCodec.MAGIC) {
return encodeV1(... |
byte[] data;
if (msg instanceof Response) {
try {
data = codec.encode(channel, msg);
} catch (Exception e) {
LoggerUtil.error("NettyEncoder encode error, identity=" + channel.getUrl().getIdentity(), e);
Response oriResponse = (Resp... | 562 | 233 | 795 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyChannel.java | NettyChannel | close | class NettyChannel implements Channel {
private volatile ChannelState state = ChannelState.UNINIT;
private NettyClient nettyClient;
private io.netty.channel.Channel channel = null;
private InetSocketAddress remoteAddress;
private InetSocketAddress localAddress = null;
private ReentrantLock lock ... |
try {
state = ChannelState.CLOSE;
if (channel != null) {
channel.close();
}
} catch (Exception e) {
LoggerUtil.error("NettyChannel close Error: " + nettyClient.getUrl().getUri() + " local=" + localAddress, e);
}
| 1,871 | 87 | 1,958 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyChannelFactory.java | NettyChannelFactory | rebuildObject | class NettyChannelFactory implements SharedObjectFactory<NettyChannel> {
private static final ExecutorService rebuildExecutorService = new StandardThreadExecutor(5, 30, 10L, TimeUnit.SECONDS, 100,
new DefaultThreadFactory("RebuildExecutorService", true),
new ThreadPoolExecutor.CallerRunsPoli... |
ReentrantLock lock = nettyChannel.getLock();
if (lock.tryLock()) {
try {
if (!nettyChannel.isAvailable() && !nettyChannel.isReconnect()) {
nettyChannel.reconnect();
if (async) {
rebuildExecutorService.submit(new... | 423 | 203 | 626 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyDecoder.java | NettyDecoder | decodeV2 | class NettyDecoder extends ByteToMessageDecoder {
private Codec codec;
private Channel channel;
private int maxContentLength = 0;
public NettyDecoder(Codec codec, Channel channel, int maxContentLength) {
this.codec = codec;
this.channel = channel;
this.maxContentLength = maxCont... |
long startTime = System.currentTimeMillis();
in.resetReaderIndex();
if (in.readableBytes() < 21) {
return;
}
in.skipBytes(2);
boolean isRequest = isV2Request(in.readByte());
in.skipBytes(2);
long requestId = in.readLong();
int size = 1... | 1,024 | 387 | 1,411 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyServer.java | NettyServer | open | class NettyServer extends AbstractServer implements StatisticCallback {
protected NettyServerChannelManage channelManage = null;
private EventLoopGroup bossGroup;
private EventLoopGroup workerGroup;
private Channel serverChannel;
private MessageHandler messageHandler;
private StandardThreadExecu... |
if (isAvailable()) {
LoggerUtil.warn("NettyServer ServerChannel already Open: url=" + url);
return state.isAliveState();
}
if (bossGroup == null) {
bossGroup = new NioEventLoopGroup(1);
workerGroup = new NioEventLoopGroup();
}
Log... | 968 | 942 | 1,910 | <methods>public void <init>() ,public void <init>(com.weibo.api.motan.rpc.URL) ,public com.weibo.api.motan.transport.Channel getChannel(java.net.InetSocketAddress) ,public Collection<com.weibo.api.motan.transport.Channel> getChannels() ,public java.net.InetSocketAddress getLocalAddress() ,public java.net.InetSocketAddr... |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyServerChannelManage.java | NettyServerChannelManage | close | class NettyServerChannelManage extends ChannelInboundHandlerAdapter {
private ConcurrentMap<String, Channel> channels = new ConcurrentHashMap<>();
private int maxChannel;
public NettyServerChannelManage(int maxChannel) {
super();
this.maxChannel = maxChannel;
}
@Override
publi... |
for (Map.Entry<String, Channel> entry : channels.entrySet()) {
try {
Channel channel = entry.getValue();
if (channel != null) {
channel.close();
}
} catch (Exception e) {
LoggerUtil.error("NettyServerCha... | 570 | 97 | 667 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/admin/AdminHttpServer.java | AdminHttpServer | convertRequest | class AdminHttpServer extends AbstractAdminServer {
private final Netty4HttpServer httpServer;
public AdminHttpServer(URL url, AdminHandler adminHandler) {
this.url = url;
this.adminHandler = adminHandler;
httpServer = new Netty4HttpServer(url, (channel, httpRequest) -> {
Fu... |
DefaultRequest request = new DefaultRequest();
Map<String, String> params = new ConcurrentHashMap<>();
// add headers to attachments
for (Map.Entry<String, String> entry : httpRequest.headers()) {
request.setAttachment(entry.getKey(), entry.getValue());
}
/... | 370 | 152 | 522 | <methods>public non-sealed void <init>() ,public com.weibo.api.motan.admin.AdminHandler getAdminHandler() ,public com.weibo.api.motan.rpc.URL getUrl() <variables>protected com.weibo.api.motan.admin.AdminHandler adminHandler,protected com.weibo.api.motan.rpc.URL url |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/admin/NettyAdminServerFactory.java | NettyAdminServerFactory | createServer | class NettyAdminServerFactory implements AdminServerFactory {
@Override
public AdminServer createServer(URL url, AdminHandler adminHandler) {<FILL_FUNCTION_BODY>}
} |
if (adminHandler == null) {
throw new MotanFrameworkException("AdminHandler can not be null");
}
String protocol = url.getProtocol();
if ("http".equals(protocol)) {
return new AdminHttpServer(url, adminHandler);
} else if ("motan2".equals(protocol)) {
... | 51 | 119 | 170 | <no_super_class> |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/http/Netty4HttpServer.java | Netty4HttpServer | request | class Netty4HttpServer extends AbstractServer implements StatisticCallback {
private HttpMessageHandler httpMessageHandler;
private URL url;
private Channel channel;
private EventLoopGroup bossGroup;
private EventLoopGroup workerGroup;
private StandardThreadExecutor standardThreadExecutor;
... |
throw new MotanFrameworkException("Netty4HttpServer request(Request request) method unSupport: url: " + url);
| 1,861 | 32 | 1,893 | <methods>public void <init>() ,public void <init>(com.weibo.api.motan.rpc.URL) ,public com.weibo.api.motan.transport.Channel getChannel(java.net.InetSocketAddress) ,public Collection<com.weibo.api.motan.transport.Channel> getChannels() ,public java.net.InetSocketAddress getLocalAddress() ,public java.net.InetSocketAddr... |
weibocom_motan | motan/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/http/NettyHttpUtil.java | NettyHttpUtil | addPostParams | class NettyHttpUtil {
/**
* @param uri request uri
* @param params used to save the parsed parameters
* @return request path from uri
*/
public static String addQueryParams(String uri, Map<String, String> params) {
QueryStringDecoder decoder = new QueryStringDecoder(uri);
... |
HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(request);
List<InterfaceHttpData> postList = decoder.getBodyHttpDatas();
for (InterfaceHttpData data : postList) {
if (data.getHttpDataType() == InterfaceHttpData.HttpDataType.Attribute) {
params.put(data.ge... | 320 | 101 | 421 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/AbstractBoxParser.java | AbstractBoxParser | parseBox | class AbstractBoxParser implements BoxParser {
private List<String> skippedTypes;
private static Logger LOG = LoggerFactory.getLogger(AbstractBoxParser.class.getName());
ThreadLocal<ByteBuffer> header = new ThreadLocal<ByteBuffer>() {
@Override
protected ByteBuffer initialValue() {
... |
((Buffer)header.get()).rewind().limit(8);
int bytesRead = 0;
int b;
while ((b = byteChannel.read(header.get())) + bytesRead < 8) {
if (b < 0) {
throw new EOFException();
} else {
bytesRead += b;
}
}
((B... | 300 | 714 | 1,014 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/BasicContainer.java | BasicContainer | getBoxes | class BasicContainer implements Container {
private List<Box> boxes = new ArrayList<Box>();
public BasicContainer() {
}
public BasicContainer(List<Box> boxes) {
this.boxes = boxes;
}
public List<Box> getBoxes() {
return boxes;
}
public void setBoxes(List<? extends Box... |
List<T> boxesToBeReturned = null;
T oneBox = null;
List<Box> boxes = getBoxes();
for (Box boxe : boxes) {
//clazz.isInstance(boxe) / clazz == boxe.getClass()?
// I hereby finally decide to use isInstance
if (clazz.isInstance(boxe)) {
... | 949 | 261 | 1,210 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/IsoFile.java | IsoFile | close | class IsoFile extends BasicContainer implements Closeable {
private final ReadableByteChannel readableByteChannel;
private FileInputStream fis;
public IsoFile(String file) throws IOException {
this(new File(file));
}
public IsoFile(File file) throws IOException {
this.fis = new F... |
this.readableByteChannel.close();
if (this.fis != null) {
this.fis.close();
}
for (Box box : getBoxes()) {
if (box instanceof Closeable) {
((Closeable) box).close();
}
}
| 680 | 77 | 757 | <methods>public void <init>() ,public void <init>(List<org.mp4parser.Box>) ,public void addBox(org.mp4parser.Box) ,public List<org.mp4parser.Box> getBoxes() ,public List<T> getBoxes(Class<T>) ,public List<T> getBoxes(Class<T>, boolean) ,public void initContainer(java.nio.channels.ReadableByteChannel, long, org.mp4parse... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/PropertyBoxParserImpl.java | PropertyBoxParserImpl | invoke | class PropertyBoxParserImpl extends AbstractBoxParser {
public static Properties BOX_MAP_CACHE = null;
public Properties mapping;
static String[] EMPTY_STRING_ARRAY = new String[0];
Pattern constuctorPattern = Pattern.compile("(.*)\\((.*?)\\)");
StringBuilder buildLookupStrings = new StringBuilder(... |
String constructor;
if (userType != null) {
if (!"uuid".equals((type))) {
throw new RuntimeException("we have a userType but no uuid box type. Something's wrong");
}
constructor = mapping.getProperty("uuid[" + Hex.encodeHex(userType).toUpperCase() + "... | 928 | 477 | 1,405 | <methods>public non-sealed void <init>() ,public abstract org.mp4parser.ParsableBox createBox(java.lang.String, byte[], java.lang.String) ,public org.mp4parser.ParsableBox parseBox(java.nio.channels.ReadableByteChannel, java.lang.String) throws java.io.IOException,public transient org.mp4parser.AbstractBoxParser skippi... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/RewindableReadableByteChannel.java | RewindableReadableByteChannel | read | class RewindableReadableByteChannel implements ReadableByteChannel {
private final ReadableByteChannel readableByteChannel;
private final ByteBuffer buffer;
// If 'true', there are more bytes read from |readableByteChannel| than the allocated buffer size.
// The rewind is not possible in that case.
... |
int initialDstPosition = dst.position();
// Read data from |readableByteChannel| into |buffer|.
((Buffer)buffer).limit(buffer.capacity());
((Buffer)buffer).position(nextBufferWritePosition);
if (buffer.capacity() > 0) {
readableByteChannel.read(buffer);
n... | 353 | 342 | 695 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/SkipBox.java | SkipBox | parse | class SkipBox implements ParsableBox {
private String type;
private long size;
private long sourcePosition = -1;
public SkipBox(String type, byte[] usertype, String parentType) {
this.type = type;
}
public String getType() {
return type;
}
public long getSize() {
... |
this.size = contentSize+8;
if( dataSource instanceof FileChannel ) {
FileChannel seekable = (FileChannel) dataSource;
sourcePosition = seekable.position();
long newPosition = sourcePosition + contentSize;
seekable.position(newPosition);
}... | 275 | 106 | 381 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/UserBox.java | UserBox | toString | class UserBox extends AbstractBox {
public static final String TYPE = "uuid";
byte[] data;
public UserBox(byte[] userType) {
super(TYPE, userType);
}
protected long getContentSize() {
return data.length;
}
public String toString() {<FILL_FUNCTION_BODY>}
public byte[... |
return "UserBox[type=" + (getType()) +
";userType=" + new String(getUserType()) +
";contentLength=" + data.length + "]";
| 209 | 50 | 259 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/adobe/ActionMessageFormat0SampleEntryBox.java | ActionMessageFormat0SampleEntryBox | getSize | class ActionMessageFormat0SampleEntryBox extends AbstractSampleEntry {
public static final String TYPE = "amf0";
public ActionMessageFormat0SampleEntryBox() {
super(TYPE);
}
@Override
public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser... |
long s = getContainerSize();
long t = 8; // bytes to container start
return s + t + ((largeBox || (s + t) >= (1L << 32)) ? 16 : 8);
| 308 | 56 | 364 | <methods>public abstract void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public int getDataReferenceIndex() ,public abstract void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOException,public void setDataReferenceIndex(in... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/AppleDataReferenceBox.java | AppleDataReferenceBox | _parseDetails | class AppleDataReferenceBox extends AbstractFullBox {
public static final String TYPE = "rdrf";
private int dataReferenceSize;
private String dataReferenceType;
private String dataReference;
public AppleDataReferenceBox() {
super(TYPE);
}
protected long getContentSize() {
... |
parseVersionAndFlags(content);
dataReferenceType = IsoTypeReader.read4cc(content);
dataReferenceSize = CastUtils.l2i(IsoTypeReader.readUInt32(content));
dataReference = IsoTypeReader.readString(content, dataReferenceSize);
| 270 | 74 | 344 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/AppleGPSCoordinatesBox.java | AppleGPSCoordinatesBox | _parseDetails | class AppleGPSCoordinatesBox extends AbstractBox {
public static final String TYPE = "©xyz";
private static final int DEFAULT_LANG = 5575; //Empirical
String coords;
int lang = DEFAULT_LANG; //? Docs says lang, but it doesn't match anything in the traditional language map
public AppleGPSCoordinate... |
int length = content.getShort();
lang = content.getShort(); //Not sure if this is accurate. It always seems to be 15 c7
byte bytes[] = new byte[length];
content.get(bytes);
coords = Utf8.convert(bytes);
| 326 | 72 | 398 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/AppleLosslessSpecificBox.java | AppleLosslessSpecificBox | getContent | class AppleLosslessSpecificBox extends AbstractFullBox {
public static final String TYPE = "alac";
/*
Extradata: 32bit size 32bit tag (=alac) 32bit zero?
32bit max sample per frame 8bit ?? (zero?) 8bit sample
size 8bit history mult 8bit initial history 8bit kmodifier
8bit channels? 16bit ?? 32bit m... |
writeVersionAndFlags(byteBuffer);
IsoTypeWriter.writeUInt32(byteBuffer, maxSamplePerFrame);
IsoTypeWriter.writeUInt8(byteBuffer, unknown1);
IsoTypeWriter.writeUInt8(byteBuffer, sampleSize);
IsoTypeWriter.writeUInt8(byteBuffer, historyMult);
IsoTypeWriter.writeUInt8(byteB... | 1,110 | 221 | 1,331 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/AppleRecordingYearBox.java | AppleRecordingYearBox | parseData | class AppleRecordingYearBox extends AppleDataBox {
DateFormat df;
Date date = new Date();
public AppleRecordingYearBox() {
super("©day", 1);
df = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ssZ");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
}
protected static String iso8601t... |
String dateString = IsoTypeReader.readString(data, data.remaining());
try {
date = df.parse(iso8601toRfc822Date(dateString));
} catch (ParseException e) {
throw new RuntimeException(e);
}
| 446 | 74 | 520 | <methods>public int getDataCountry() ,public int getDataLanguage() ,public int getDataType() ,public java.lang.String getLanguageString() ,public void setDataCountry(int) ,public void setDataLanguage(int) <variables>int dataCountry,int dataLanguage,int dataType,private static HashMap<java.lang.String,java.lang.String> ... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/AppleVariableSignedIntegerBox.java | AppleVariableSignedIntegerBox | setValue | class AppleVariableSignedIntegerBox extends AppleDataBox {
long value;
int intLength = 1;
protected AppleVariableSignedIntegerBox(String type) {
super(type, 15);
}
public int getIntLength() {
return intLength;
}
public void setIntLength(int intLength) {
this.intLen... |
if (value <= 127 && value > -128) {
intLength = 1;
} else if (value <= 32767 && value > -32768 && intLength < 2) {
intLength = 2;
} else if (value <= 8388607 && value > -8388608 && intLength < 3) {
intLength = 3;
} else {
intLength = 4;
... | 337 | 129 | 466 | <methods>public int getDataCountry() ,public int getDataLanguage() ,public int getDataType() ,public java.lang.String getLanguageString() ,public void setDataCountry(int) ,public void setDataLanguage(int) <variables>int dataCountry,int dataLanguage,int dataType,private static HashMap<java.lang.String,java.lang.String> ... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/BaseMediaInfoAtom.java | BaseMediaInfoAtom | getContent | class BaseMediaInfoAtom extends AbstractFullBox {
public static final String TYPE = "gmin";
short graphicsMode = 64;
int opColorR = 32768;
int opColorG = 32768;
int opColorB = 32768;
short balance;
short reserved;
public BaseMediaInfoAtom() {
super(TYPE);
}
@Override
... |
writeVersionAndFlags(byteBuffer);
byteBuffer.putShort(graphicsMode);
IsoTypeWriter.writeUInt16(byteBuffer, opColorR);
IsoTypeWriter.writeUInt16(byteBuffer, opColorG);
IsoTypeWriter.writeUInt16(byteBuffer, opColorB);
byteBuffer.putShort(balance);
byteBuffer.putSho... | 662 | 105 | 767 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/GenericMediaHeaderTextAtom.java | GenericMediaHeaderTextAtom | _parseDetails | class GenericMediaHeaderTextAtom extends AbstractBox {
public static final String TYPE = "text";
int unknown_1 = 65536;
int unknown_2;
int unknown_3;
int unknown_4;
int unknown_5 = 65536;
int unknown_6;
int unknown_7;
int unknown_8;
int unknown_9 = 1073741824;
public Gener... |
unknown_1 = content.getInt();
unknown_2 = content.getInt();
unknown_3 = content.getInt();
unknown_4 = content.getInt();
unknown_5 = content.getInt();
unknown_6 = content.getInt();
unknown_7 = content.getInt();
unknown_8 = content.getInt();
unknown... | 787 | 102 | 889 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/QuicktimeTextSampleEntry.java | QuicktimeTextSampleEntry | getSize | class QuicktimeTextSampleEntry extends AbstractSampleEntry {
public static final String TYPE = "text";
int displayFlags;
int textJustification;
int backgroundR;
int backgroundG;
int backgroundB;
long defaultTextBox;
long reserved1;
short fontNumber;
short fontFace;
byte ... |
long s = getContainerSize() + 52 + (fontName != null ? fontName.length() : 0);
s += ((largeBox || (s + 8) >= (1L << 32)) ? 16 : 8);
return s;
| 1,826 | 66 | 1,892 | <methods>public abstract void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public int getDataReferenceIndex() ,public abstract void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOException,public void setDataReferenceIndex(in... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/TrackLoadSettingsAtom.java | TrackLoadSettingsAtom | _parseDetails | class TrackLoadSettingsAtom extends AbstractBox {
public static final String TYPE = "load";
int preloadStartTime;
int preloadDuration;
int preloadFlags;
int defaultHints;
public TrackLoadSettingsAtom() {
super(TYPE);
}
@Override
protected long getContentSize() {
r... |
preloadStartTime = content.getInt();
preloadDuration = content.getInt();
preloadFlags = content.getInt();
defaultHints = content.getInt();
| 414 | 48 | 462 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/apple/Utf8AppleDataBox.java | Utf8AppleDataBox | getValue | class Utf8AppleDataBox extends AppleDataBox {
String value;
protected Utf8AppleDataBox(String type) {
super(type, 1);
}
public String getValue() {<FILL_FUNCTION_BODY>}
public void setValue(String value) {
this.value = value;
}
@DoNotParseDetail
public byte[] writeData... |
//patched by Toias Bley / UltraMixer
if (!isParsed()) {
parseDetails();
}
return value;
| 199 | 41 | 240 | <methods>public int getDataCountry() ,public int getDataLanguage() ,public int getDataType() ,public java.lang.String getLanguageString() ,public void setDataCountry(int) ,public void setDataLanguage(int) <variables>int dataCountry,int dataLanguage,int dataType,private static HashMap<java.lang.String,java.lang.String> ... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dece/AssetInformationBox.java | Entry | equals | class Entry {
public String namespace;
public String profileLevelIdc;
public String assetId;
public Entry(String namespace, String profileLevelIdc, String assetId) {
this.namespace = namespace;
this.profileLevelIdc = profileLevelIdc;
this.assetId = as... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Entry entry = (Entry) o;
if (!assetId.equals(entry.assetId)) return false;
if (!namespace.equals(entry.namespace)) return false;
if (!profileLevelIdc.equals(e... | 312 | 108 | 420 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dece/AvcNalUnitStorageBox.java | AvcNalUnitStorageBox | toString | class AvcNalUnitStorageBox extends AbstractBox {
public static final String TYPE = "avcn";
AvcDecoderConfigurationRecord avcDecoderConfigurationRecord;
public AvcNalUnitStorageBox() {
super(TYPE);
}
public AvcNalUnitStorageBox(AvcConfigurationBox avcConfigurationBox) {
super(TYPE);... |
return "AvcNalUnitStorageBox{" +
"SPS=" + avcDecoderConfigurationRecord.getSequenceParameterSetsAsStrings() +
",PPS=" + avcDecoderConfigurationRecord.getPictureParameterSetsAsStrings() +
",lengthSize=" + (avcDecoderConfigurationRecord.lengthSizeMinusOne + 1) +
... | 459 | 97 | 556 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dece/BaseLocationBox.java | BaseLocationBox | getContent | class BaseLocationBox extends AbstractFullBox {
public static final String TYPE = "bloc";
String baseLocation = "";
String purchaseLocation = "";
public BaseLocationBox() {
super(TYPE);
}
public BaseLocationBox(String baseLocation, String purchaseLocation) {
super(TYPE);
... |
writeVersionAndFlags(byteBuffer);
byteBuffer.put(Utf8.convert(baseLocation));
byteBuffer.put(new byte[256 - Utf8.utf8StringLengthInBytes(baseLocation)]); // string plus term zero
byteBuffer.put(Utf8.convert(purchaseLocation));
byteBuffer.put(new byte[256 - Utf8.utf8StringLengthI... | 662 | 129 | 791 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dece/ContentInformationBox.java | ContentInformationBox | getContent | class ContentInformationBox extends AbstractFullBox {
public static final String TYPE = "cinf";
String mimeSubtypeName;
String profileLevelIdc;
String codecs;
String protection;
String languages;
Map<String, String> brandEntries = new LinkedHashMap<String, String>();
Map<String, String... |
writeVersionAndFlags(byteBuffer);
IsoTypeWriter.writeZeroTermUtf8String(byteBuffer, mimeSubtypeName);
IsoTypeWriter.writeZeroTermUtf8String(byteBuffer, profileLevelIdc);
IsoTypeWriter.writeZeroTermUtf8String(byteBuffer, codecs);
IsoTypeWriter.writeZeroTermUtf8String(byteBuffer, ... | 1,338 | 310 | 1,648 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dece/TrickPlayBox.java | Entry | toString | class Entry {
private int value;
public Entry() {
}
public Entry(int value) {
this.value = value;
}
public int getPicType() {
return (value >> 6) & 0x03;
}
public void setPicType(int picType) {
value = value & (0xf... |
final StringBuilder sb = new StringBuilder();
sb.append("Entry");
sb.append("{picType=").append(getPicType());
sb.append(",dependencyLevel=").append(getDependencyLevel());
sb.append('}');
return sb.toString();
| 211 | 72 | 283 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dolby/AC3SpecificBox.java | AC3SpecificBox | toString | class AC3SpecificBox extends AbstractBox {
public static final String TYPE = "dac3";
int fscod;
int bsid;
int bsmod;
int acmod;
int lfeon;
int bitRateCode;
int reserved;
public AC3SpecificBox() {
super(TYPE);
}
@Override
protected long getContentSize() {
... |
return "AC3SpecificBox{" +
"fscod=" + fscod +
", bsid=" + bsid +
", bsmod=" + bsmod +
", acmod=" + acmod +
", lfeon=" + lfeon +
", bitRateCode=" + bitRateCode +
", reserved=" + reserved +
... | 774 | 104 | 878 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dolby/DoViConfigurationBox.java | DoViConfigurationBox | _parseDetails | class DoViConfigurationBox extends AbstractBox {
public static final String TYPE = "dvcC";
private int dvVersionMajor;
private int dvVersionMinor;
private int dvProfile;
private int dvLevel;
private boolean rpuPresentFlag;
private boolean elPresentFlag;
private boolean blPresentFlag;
... |
dvVersionMajor = IsoTypeReader.readUInt8(content);
dvVersionMinor = IsoTypeReader.readUInt8(content);
int x = IsoTypeReader.readUInt16(content);
dvProfile = (x >> 9) & 127;
dvLevel = (x >> 3) & 63;
rpuPresentFlag = (x & 0x4) > 0;
elPresentFlag = (x & 0x2) > 0;
... | 1,089 | 238 | 1,327 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dolby/EC3SpecificBox.java | Entry | toString | class Entry {
public int fscod;
public int bsid;
public int bsmod;
public int acmod;
public int lfeon;
public int reserved;
public int num_dep_sub;
public int chan_loc;
public int reserved2;
@Override
public String toString() {<FI... |
return "Entry{" +
"fscod=" + fscod +
", bsid=" + bsid +
", bsmod=" + bsmod +
", acmod=" + acmod +
", lfeon=" + lfeon +
", reserved=" + reserved +
", num_dep_sub=" + nu... | 104 | 130 | 234 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/dolby/MLPSpecificBox.java | MLPSpecificBox | _parseDetails | class MLPSpecificBox extends AbstractBox {
public static final String TYPE = "dmlp";
int format_info;
int peak_data_rate;
int reserved;
int reserved2;
public MLPSpecificBox() {
super(TYPE);
}
@Override
protected long getContentSize() {
return 10;
}
@Overri... |
BitReaderBuffer brb = new BitReaderBuffer(content);
format_info = brb.readBits(32);
peak_data_rate = brb.readBits(15);
reserved = brb.readBits(1);
reserved2 = brb.readBits(32);
| 466 | 80 | 546 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/BaseDescriptor.java | BaseDescriptor | getSizeSize | class BaseDescriptor {
int tag;
int sizeOfInstance;
int sizeBytes;
public BaseDescriptor() {
}
public int getTag() {
return tag;
}
public void writeSize(ByteBuffer bb, int size) {
int pos = bb.position();
int i = 0;
while (size > 0 || i < sizeBytes) {
... |
int size = getContentSize();
int i = 0;
while (size > 0 || i < sizeBytes) {
size >>>= 7;
i++;
}
return i;
| 618 | 54 | 672 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/BitReaderBuffer.java | BitReaderBuffer | readBits | class BitReaderBuffer {
int initialPos;
int position;
private ByteBuffer buffer;
public BitReaderBuffer(ByteBuffer buffer) {
this.buffer = buffer;
initialPos = buffer.position();
}
public boolean readBool() {
return readBits(1) == 1;
}
public int readBits(int ... |
byte b = buffer.get(initialPos + position / 8);
int v = b < 0 ? b + 256 : b;
int left = 8 - position % 8;
int rc;
if (i <= left) {
rc = (v << (position % 8) & 0xFF) >> ((position % 8) + (left - i));
position += i;
} else {
int now = le... | 207 | 191 | 398 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/BitWriterBuffer.java | BitWriterBuffer | writeBits | class BitWriterBuffer {
int initialPos;
int position = 0;
private ByteBuffer buffer;
public BitWriterBuffer(ByteBuffer buffer) {
this.buffer = buffer;
this.initialPos = buffer.position();
}
public void writeBool(boolean b) {
writeBits(b ? 1 : 0, 1);
}
public v... |
assert i <= ((1 << numBits) - 1) : String.format("Trying to write a value bigger (%s) than the number bits (%s) allows. " +
"Please mask the value before writing it and make your code is really working as intended.", i, (1 << numBits) - 1);
int left = 8 - position % 8;
if (numB... | 128 | 282 | 410 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/DecoderSpecificInfo.java | DecoderSpecificInfo | serialize | class DecoderSpecificInfo extends BaseDescriptor {
byte[] bytes;
public DecoderSpecificInfo() {
tag = 0x5;
}
@Override
public void parseDetail(ByteBuffer bb) throws IOException {
bytes = new byte[bb.remaining()];
bb.get(bytes);
}
public void setData(byte[] bytes) {... |
ByteBuffer out = ByteBuffer.allocate(getSize());
IsoTypeWriter.writeUInt8(out, tag);
writeSize(out, getContentSize());
out.put(bytes);
return (ByteBuffer) ((Buffer)out).rewind();
| 382 | 68 | 450 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/ExtensionDescriptor.java | ExtensionDescriptor | allTags | class ExtensionDescriptor extends BaseDescriptor {
private static Logger LOG = LoggerFactory.getLogger(ExtensionDescriptor.class.getName());
ByteBuffer data;
//todo: add this better to the tags list?
//14496-1:2010 p.20:
//0x6A-0xBF Reserved for ISO use
//0xC0-0xFE User private
//
/... |
int[] ints = new int[0xFE - 0x6A];
for (int i = 0x6A; i < 0xFE; i++) {
final int pos = i - 0x6A;
LOG.trace("pos: {}", pos);
ints[pos] = i;
}
return ints;
| 394 | 91 | 485 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/ExtensionProfileLevelDescriptor.java | ExtensionProfileLevelDescriptor | parseDetail | class ExtensionProfileLevelDescriptor extends BaseDescriptor {
byte[] bytes;
public ExtensionProfileLevelDescriptor() {
tag = 0x13;
}
@Override
public void parseDetail(ByteBuffer bb) throws IOException {<FILL_FUNCTION_BODY>}
@Override
public ByteBuffer serialize() {
throw ... |
if (getSize() > 0) {
bytes = new byte[getSize()];
bb.get(bytes);
}
| 209 | 37 | 246 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/InitialObjectDescriptor.java | InitialObjectDescriptor | parseDetail | class InitialObjectDescriptor extends ObjectDescriptorBase {
int urlFlag;
int includeInlineProfileLevelFlag;
int urlLength;
String urlString;
int oDProfileLevelIndication;
int sceneProfileLevelIndication;
int audioProfileLevelIndication;
int visualProfileLevelIndication;
int graphics... |
int data = IsoTypeReader.readUInt16(bb);
objectDescriptorId = (data & 0xFFC0) >> 6;
urlFlag = (data & 0x3F) >> 5;
includeInlineProfileLevelFlag = (data & 0x1F) >> 4;
int sizeLeft = getSize() - 2;
if (urlFlag == 1) {
urlLength = IsoTypeReader.readUInt8(bb);
... | 519 | 452 | 971 | <methods>public non-sealed void <init>() <variables> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/ObjectDescriptorFactory.java | ObjectDescriptorFactory | createFrom | class ObjectDescriptorFactory {
protected static Logger LOG = LoggerFactory.getLogger(ObjectDescriptorFactory.class);
protected static Map<Integer, Map<Integer, Class<? extends BaseDescriptor>>> descriptorRegistry = new HashMap<Integer, Map<Integer, Class<? extends BaseDescriptor>>>();
static {
Se... |
int tag = IsoTypeReader.readUInt8(bb);
Map<Integer, Class<? extends BaseDescriptor>> tagMap = descriptorRegistry.get(objectTypeIndication);
if (tagMap == null) {
tagMap = descriptorRegistry.get(-1);
}
Class<? extends BaseDescriptor> aClass = tagMap.get(tag);
// ... | 454 | 517 | 971 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/ProfileLevelIndicationDescriptor.java | ProfileLevelIndicationDescriptor | equals | class ProfileLevelIndicationDescriptor extends BaseDescriptor {
int profileLevelIndicationIndex;
public ProfileLevelIndicationDescriptor() {
tag = 0x14;
}
@Override
public void parseDetail(ByteBuffer bb) throws IOException {
profileLevelIndicationIndex = IsoTypeReader.readUInt8(bb)... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProfileLevelIndicationDescriptor that = (ProfileLevelIndicationDescriptor) o;
if (profileLevelIndicationIndex != that.profileLevelIndicationIndex) {
... | 343 | 105 | 448 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/SLConfigDescriptor.java | SLConfigDescriptor | equals | class SLConfigDescriptor extends BaseDescriptor {
int predefined;
public SLConfigDescriptor() {
tag = 0x06;
}
public int getPredefined() {
return predefined;
}
public void setPredefined(int predefined) {
this.predefined = predefined;
}
@Override
public voi... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SLConfigDescriptor that = (SLConfigDescriptor) o;
if (predefined != that.predefined) {
return false;
}
return true;
| 349 | 93 | 442 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part1/objectdescriptors/UnknownDescriptor.java | UnknownDescriptor | toString | class UnknownDescriptor extends BaseDescriptor {
private static Logger LOG = LoggerFactory.getLogger(UnknownDescriptor.class);
private ByteBuffer data;
@Override
public void parseDetail(ByteBuffer bb) throws IOException {
data = bb.slice();
}
@Override
public String toString() {<FI... |
final StringBuilder sb = new StringBuilder();
sb.append("UnknownDescriptor");
sb.append("{tag=").append(tag);
sb.append(", sizeOfInstance=").append(sizeOfInstance);
sb.append(", data=").append(data);
sb.append('}');
return sb.toString();
| 153 | 84 | 237 | <methods>public void <init>() ,public int getSize() ,public int getSizeSize() ,public int getTag() ,public final void parse(int, java.nio.ByteBuffer) throws java.io.IOException,public abstract void parseDetail(java.nio.ByteBuffer) throws java.io.IOException,public abstract java.nio.ByteBuffer serialize() ,public java.l... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/BitRateBox.java | BitRateBox | _parseDetails | class BitRateBox extends AbstractBox {
public static final String TYPE = "btrt";
private long bufferSizeDb;
private long maxBitrate;
private long avgBitrate;
public BitRateBox() {
super(TYPE);
}
protected long getContentSize() {
return 12;
}
@Override
public v... |
bufferSizeDb = IsoTypeReader.readUInt32(content);
maxBitrate = IsoTypeReader.readUInt32(content);
avgBitrate = IsoTypeReader.readUInt32(content);
| 583 | 61 | 644 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/ChunkOffset64BitBox.java | ChunkOffset64BitBox | _parseDetails | class ChunkOffset64BitBox extends ChunkOffsetBox {
public static final String TYPE = "co64";
private long[] chunkOffsets;
public ChunkOffset64BitBox() {
super(TYPE);
}
@Override
public long[] getChunkOffsets() {
return chunkOffsets;
}
@Override
public void setChunk... |
parseVersionAndFlags(content);
int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content));
chunkOffsets = new long[entryCount];
for (int i = 0; i < entryCount; i++) {
chunkOffsets[i] = IsoTypeReader.readUInt64(content);
}
| 277 | 93 | 370 | <methods>public void <init>(java.lang.String) ,public abstract long[] getChunkOffsets() ,public abstract void setChunkOffsets(long[]) ,public java.lang.String toString() <variables> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/CompositionTimeToSample.java | CompositionTimeToSample | blowupCompositionTimes | class CompositionTimeToSample extends AbstractFullBox {
public static final String TYPE = "ctts";
List<Entry> entries = Collections.emptyList();
public CompositionTimeToSample() {
super(TYPE);
}
/**
* Decompresses the list of entries and returns the list of composition times.
*
... |
long numOfSamples = 0;
for (CompositionTimeToSample.Entry entry : entries) {
numOfSamples += entry.getCount();
}
assert numOfSamples <= Integer.MAX_VALUE;
int[] decodingTime = new int[(int) numOfSamples];
int current = 0;
for (CompositionTimeToSamp... | 642 | 151 | 793 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/CompositionToDecodeBox.java | CompositionToDecodeBox | _parseDetails | class CompositionToDecodeBox extends AbstractFullBox {
public static final String TYPE = "cslg";
// A 32-bit unsigned integer that specifies the calculated value.
int compositionOffsetToDisplayOffsetShift;
// A 32-bit signed integer that specifies the calculated value.
int leastDisplayOffset;
//... |
parseVersionAndFlags(content);
compositionOffsetToDisplayOffsetShift = content.getInt();
leastDisplayOffset = content.getInt();
greatestDisplayOffset = content.getInt();
displayStartTime = content.getInt();
displayEndTime = content.getInt();
| 609 | 70 | 679 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/DataEntryUrnBox.java | DataEntryUrnBox | toString | class DataEntryUrnBox extends AbstractFullBox {
public static final String TYPE = "urn ";
private String name;
private String location;
public DataEntryUrnBox() {
super(TYPE);
}
public String getName() {
return name;
}
public String getLocation() {
return locat... |
return "DataEntryUrlBox[name=" + getName() + ";location=" + getLocation() + "]";
| 285 | 32 | 317 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/DataReferenceBox.java | DataReferenceBox | parse | class DataReferenceBox extends AbstractContainerBox implements FullBox {
public static final String TYPE = "dref";
private int version;
private int flags;
public DataReferenceBox() {
super(TYPE);
}
public int getVersion() {
return version;
}
public void setVersion(in... |
ByteBuffer versionFlagNumOfChildBoxes = ByteBuffer.allocate(8);
int required = versionFlagNumOfChildBoxes.limit();
while (required > 0){
int read = dataSource.read(versionFlagNumOfChildBoxes);
required -= read;
}
((Buffer)versionFlagNumOfChildBoxes).rewin... | 423 | 164 | 587 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/DegradationPriorityBox.java | DegradationPriorityBox | _parseDetails | class DegradationPriorityBox extends AbstractFullBox {
int[] priorities = new int[0];
public DegradationPriorityBox() {
super("stdp");
}
@Override
protected long getContentSize() {
return 4 + priorities.length * 2;
}
@Override
protected void getContent(ByteBuffer byteB... |
parseVersionAndFlags(content);
priorities = new int[content.remaining() / 2];
for (int i = 0; i < priorities.length; i++) {
priorities[i] = IsoTypeReader.readUInt16(content);
}
| 291 | 73 | 364 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/EditListBox.java | Entry | equals | class Entry {
EditListBox editListBox;
private long segmentDuration;
private long mediaTime;
private double mediaRate;
/**
* Creates a new <code>Entry</code> with all values set.
*
* @param editListBox parent <code>EditListBox</code>
* @pa... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Entry entry = (Entry) o;
if (mediaTime != entry.mediaTime) {
return false;
}
i... | 1,088 | 111 | 1,199 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/FileTypeBox.java | FileTypeBox | _parseDetails | class FileTypeBox extends AbstractBox {
public static final String TYPE = "ftyp";
private String majorBrand;
private long minorVersion;
private List<String> compatibleBrands = Collections.emptyList();
public FileTypeBox() {
super(TYPE);
}
public FileTypeBox(String majorBrand, long... |
majorBrand = IsoTypeReader.read4cc(content);
minorVersion = IsoTypeReader.readUInt32(content);
int compatibleBrandsCount = content.remaining() / 4;
compatibleBrands = new LinkedList<String>();
for (int i = 0; i < compatibleBrandsCount; i++) {
compatibleBrands.add(Iso... | 789 | 110 | 899 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/FreeBox.java | FreeBox | equals | class FreeBox implements ParsableBox {
public static final String TYPE = "free";
ByteBuffer data;
List<ParsableBox> replacers = new LinkedList<ParsableBox>();
private Container parent;
private long offset;
public FreeBox() {
this.data = ByteBuffer.wrap(new byte[0]);
}
public Fr... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FreeBox freeBox = (FreeBox) o;
if (getData() != null ? !getData().equals(freeBox.getData()) : freeBox.getData() != null) return false;
return true;
| 659 | 93 | 752 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/FreeSpaceBox.java | FreeSpaceBox | toString | class FreeSpaceBox extends AbstractBox {
public static final String TYPE = "skip";
byte[] data;
public FreeSpaceBox() {
super(TYPE);
}
protected long getContentSize() {
return data.length;
}
public byte[] getData() {
return data;
}
public void setData(byt... |
return "FreeSpaceBox[size=" + data.length + ";type=" + getType() + "]";
| 202 | 31 | 233 | <methods>public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public byte[] getUserType() ,public boolean isParsed() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) thr... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/HandlerBox.java | HandlerBox | getContent | class HandlerBox extends AbstractFullBox {
public static final String TYPE = "hdlr";
public static final Map<String, String> readableTypes;
static {
HashMap<String, String> hm = new HashMap<String, String>();
hm.put("odsm", "ObjectDescriptorStream - defined in ISO/IEC JTC1/SC29/WG11 - CODIN... |
writeVersionAndFlags(byteBuffer);
IsoTypeWriter.writeUInt32(byteBuffer, shouldBeZeroButAppleWritesHereSomeValue);
byteBuffer.put(IsoFile.fourCCtoBytes(handlerType));
IsoTypeWriter.writeUInt32(byteBuffer, a);
IsoTypeWriter.writeUInt32(byteBuffer, b);
IsoTypeWriter.writeUI... | 1,238 | 164 | 1,402 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/HintMediaHeaderBox.java | HintMediaHeaderBox | toString | class HintMediaHeaderBox extends AbstractMediaHeaderBox {
public static final String TYPE = "hmhd";
private int maxPduSize;
private int avgPduSize;
private long maxBitrate;
private long avgBitrate;
public HintMediaHeaderBox() {
super(TYPE);
}
public int getMaxPduSize() {
... |
return "HintMediaHeaderBox{" +
"maxPduSize=" + maxPduSize +
", avgPduSize=" + avgPduSize +
", maxBitrate=" + maxBitrate +
", avgBitrate=" + avgBitrate +
'}';
| 485 | 79 | 564 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/HintSampleEntry.java | HintSampleEntry | parse | class HintSampleEntry extends AbstractSampleEntry {
protected byte[] data;
public HintSampleEntry(String type) {
super(type);
}
@Override
public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {<FILL_FUNCTION_BODY>}
... |
ByteBuffer b1 = ByteBuffer.allocate(8);
dataSource.read(b1);
((Buffer)b1).position(6);
dataReferenceIndex = IsoTypeReader.readUInt16(b1);
data = new byte[CastUtils.l2i(contentSize - 8)];
dataSource.read(ByteBuffer.wrap(data));
| 315 | 95 | 410 | <methods>public abstract void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public int getDataReferenceIndex() ,public abstract void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOException,public void setDataReferenceIndex(in... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/ItemProtectionBox.java | ItemProtectionBox | getSize | class ItemProtectionBox extends AbstractContainerBox implements FullBox {
public static final String TYPE = "ipro";
private int version;
private int flags;
public ItemProtectionBox() {
super(TYPE);
}
public int getVersion() {
return version;
}
public void setVersion(i... |
long s = getContainerSize();
long t = 6; // bytes to container start
return s + t + ((largeBox || (s + t) >= (1L << 32)) ? 16 : 8);
| 567 | 56 | 623 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MediaDataBox.java | MediaDataBox | parse | class MediaDataBox implements ParsableBox, Closeable {
public static final String TYPE = "mdat";
ByteBuffer header;
File dataFile;
public String getType() {
return TYPE;
}
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
writableByteChannel.writ... |
dataFile = File.createTempFile("MediaDataBox", super.toString());
// make sure to clean up temp file
dataFile.deleteOnExit();
this.header = ByteBuffer.allocate(header.limit());
this.header.put(header);
try (RandomAccessFile raf = new RandomAccessFile(dataFile, ... | 282 | 117 | 399 | <no_super_class> |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MediaHeaderBox.java | MediaHeaderBox | getContentSize | class MediaHeaderBox extends AbstractFullBox {
public static final String TYPE = "mdhd";
private static Logger LOG = LoggerFactory.getLogger(MediaHeaderBox.class);
private Date creationTime = new Date();
private Date modificationTime = new Date();
private long timescale;
private long duration;
... |
long contentSize = 4;
if (getVersion() == 1) {
contentSize += 8 + 8 + 4 + 8;
} else {
contentSize += 4 + 4 + 4 + 4;
}
contentSize += 2;
contentSize += 2;
return contentSize;
| 1,014 | 77 | 1,091 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MediaInformationBox.java | MediaInformationBox | getMediaHeaderBox | class MediaInformationBox extends AbstractContainerBox {
public static final String TYPE = "minf";
public MediaInformationBox() {
super(TYPE);
}
public SampleTableBox getSampleTableBox() {
return Path.getPath(this, "stbl[0]");
}
public AbstractMediaHeaderBox getMediaHeaderBox(... |
for (Box box : getBoxes()) {
if (box instanceof AbstractMediaHeaderBox) {
return (AbstractMediaHeaderBox) box;
}
}
return null;
| 102 | 49 | 151 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MetaBox.java | MetaBox | parse | class MetaBox extends AbstractContainerBox {
public static final String TYPE = "meta";
private int version;
private int flags;
private boolean quickTimeFormat;
public MetaBox() {
super(TYPE);
}
public int getVersion() {
return version;
}
public void setVersion(int... |
// Read first 20 bytes to determine whether the file is formatted according to QuickTime File Format.
RewindableReadableByteChannel rewindableDataSource = new RewindableReadableByteChannel(dataSource, 20);
ByteBuffer bb = ByteBuffer.allocate(20);
int bytesRead = rewindableDataSource.rea... | 543 | 382 | 925 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MovieBox.java | MovieBox | getTrackNumbers | class MovieBox extends AbstractContainerBox {
public static final String TYPE = "moov";
public MovieBox() {
super(TYPE);
}
public int getTrackCount() {
return getBoxes(TrackBox.class).size();
}
/**
* Returns the track numbers associated with this <code>MovieBox</code>.
... |
List<TrackBox> trackBoxes = this.getBoxes(TrackBox.class);
long[] trackNumbers = new long[trackBoxes.size()];
for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
trackNumbers[trackCounter] = trackBoxes.get(trackCounter).getTrackHeaderBox().getTrackId();
... | 178 | 106 | 284 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MovieExtendsHeaderBox.java | MovieExtendsHeaderBox | _parseDetails | class MovieExtendsHeaderBox extends AbstractFullBox {
public static final String TYPE = "mehd";
private long fragmentDuration;
public MovieExtendsHeaderBox() {
super(TYPE);
}
@Override
protected long getContentSize() {
return getVersion() == 1 ? 12 : 8;
}
@Override
... |
parseVersionAndFlags(content);
fragmentDuration = getVersion() == 1 ? IsoTypeReader.readUInt64(content) : IsoTypeReader.readUInt32(content);
| 251 | 50 | 301 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MovieFragmentBox.java | MovieFragmentBox | getTrackNumbers | class MovieFragmentBox extends AbstractContainerBox {
public static final String TYPE = "moof";
public MovieFragmentBox() {
super(TYPE);
}
public List<Long> getSyncSamples(SampleDependencyTypeBox sdtp) {
List<Long> result = new ArrayList<Long>();
final List<SampleDependencyTy... |
List<TrackFragmentBox> trackBoxes = this.getBoxes(TrackFragmentBox.class, false);
long[] trackNumbers = new long[trackBoxes.size()];
for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
TrackFragmentBox trackBoxe = trackBoxes.get(trackCounter);
... | 359 | 124 | 483 | <methods>public void <init>(java.lang.String) ,public void getBox(java.nio.channels.WritableByteChannel) throws java.io.IOException,public long getSize() ,public java.lang.String getType() ,public void parse(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, long, org.mp4parser.BoxParser) throws java.io.IOExce... |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/MovieHeaderBox.java | MovieHeaderBox | _parseDetails | class MovieHeaderBox extends AbstractFullBox {
public static final String TYPE = "mvhd";
private static Logger LOG = LoggerFactory.getLogger(MovieHeaderBox.class);
private Date creationTime;
private Date modificationTime;
private long timescale;
private long duration;
private double rate = 1... |
parseVersionAndFlags(content);
if (getVersion() == 1) {
creationTime = DateHelper.convert(IsoTypeReader.readUInt64(content));
modificationTime = DateHelper.convert(IsoTypeReader.readUInt64(content));
timescale = IsoTypeReader.readUInt32(content);
duration... | 1,644 | 384 | 2,028 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/ProgressiveDownloadInformationBox.java | ProgressiveDownloadInformationBox | getContent | class ProgressiveDownloadInformationBox extends AbstractFullBox {
public static final String TYPE = "pdin";
List<Entry> entries = Collections.emptyList();
public ProgressiveDownloadInformationBox() {
super(TYPE);
}
@Override
protected long getContentSize() {
return 4 + entries... |
writeVersionAndFlags(byteBuffer);
for (Entry entry : entries) {
IsoTypeWriter.writeUInt32(byteBuffer, entry.getRate());
IsoTypeWriter.writeUInt32(byteBuffer, entry.getInitialDelay());
}
| 667 | 69 | 736 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
sannies_mp4parser | mp4parser/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/SampleAuxiliaryInformationOffsetsBox.java | SampleAuxiliaryInformationOffsetsBox | _parseDetails | class SampleAuxiliaryInformationOffsetsBox extends AbstractFullBox {
public static final String TYPE = "saio";
private long[] offsets = new long[0];
private String auxInfoType;
private String auxInfoTypeParameter;
public SampleAuxiliaryInformationOffsetsBox() {
super(TYPE);
}
@Ove... |
parseVersionAndFlags(content);
if ((getFlags() & 1) == 1) {
auxInfoType = IsoTypeReader.read4cc(content);
auxInfoTypeParameter = IsoTypeReader.read4cc(content);
}
int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content));
offsets = new long[entr... | 521 | 187 | 708 | <methods>public int getFlags() ,public int getVersion() ,public void setFlags(int) ,public void setVersion(int) <variables>protected int flags,protected int version |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.