• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ObjectMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.red5.io.utils.ObjectMap的典型用法代码示例。如果您正苦于以下问题:Java ObjectMap类的具体用法?Java ObjectMap怎么用?Java ObjectMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectMap类属于org.red5.io.utils包,在下文中一共展示了ObjectMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readMap

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public Object readMap() {
    // the maximum number used in this mixed array
    int maxNumber = buf.getInt();
    log.debug("Read start mixed array: {}", maxNumber);
    ObjectMap<Object, Object> result = new ObjectMap<Object, Object>();
    // we must store the reference before we deserialize any items in it to ensure that reference IDs are correct
    int reference = storeReference(result);
    while (hasMoreProperties()) {
        String key = getString();
        Object item = Deserializer.deserialize(this, Object.class);
        log.debug("item: {}", item);
        if (!NumberUtils.isParsable(key)) {
            result.put(key, item);
        } else {
            result.put(Integer.valueOf(key), item);
        }
    }
    result.remove("length");
    // replace the original reference with the final result
    storeReference(reference, result);
    return result;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:24,代码来源:Input.java


示例2: onStreamEvent

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void onStreamEvent(Notify notify) {
    log.debug("onStreamEvent: {}", notify);
    ObjectMap<?, ?> map = (ObjectMap<?, ?>) notify.getCall().getArguments()[0];
    String code = (String) map.get("code");
    log.debug("<:{}", code);
    if (StatusCodes.NS_PUBLISH_START.equals(code)) {
        setState(StreamState.PUBLISHED);
        IMessage message = null;
        while ((message = frameBuffer.poll()) != null) {
            rtmpClient.publishStreamData(streamId, message);
        }
    } else if (StatusCodes.NS_UNPUBLISHED_SUCCESS.equals(code)) {
        setState(StreamState.UNPUBLISHED);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:17,代码来源:StreamingProxy.java


示例3: makeDefaultConnectionParams

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Creates the default connection parameters collection. Many implementations of this handler will create a tcUrl if not found, it is
 * created with the current server url.
 * 
 * @param server
 *            the server location
 * @param port
 *            the port for the protocol
 * @param application
 *            the application name at the given server
 * @return connection parameters map
 */
@Override
public Map<String, Object> makeDefaultConnectionParams(String server, int port, String application) {
    Map<String, Object> params = new ObjectMap<>();
    params.put("app", application);
    params.put("objectEncoding", Integer.valueOf(0));
    params.put("fpad", Boolean.FALSE);
    params.put("flashVer", "WIN 11,2,202,235");
    params.put("audioCodecs", Integer.valueOf(3575));
    params.put("videoFunction", Integer.valueOf(1));
    params.put("pageUrl", null);
    params.put("path", application);
    params.put("capabilities", Integer.valueOf(15));
    params.put("swfUrl", null);
    params.put("videoCodecs", Integer.valueOf(252));
    return params;
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:29,代码来源:BaseRTMPClientHandler.java


示例4: writeObjectType

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Write typed object to the output
 * 
 * @param out
 *            Output writer
 * @param obj
 *            Object type to write
 * @return <tt>true</tt> if the object has been written, otherwise <tt>false</tt>
 */
@SuppressWarnings("all")
protected static boolean writeObjectType(Output out, Object obj) {
	if (obj instanceof ObjectMap || obj instanceof BeanMap) {
		out.writeObject((Map) obj);
	} else if (obj instanceof Map) {
		out.writeMap((Map) obj);
	} else if (obj instanceof RecordSet) {
		out.writeRecordSet((RecordSet) obj);
	} else {
		out.writeObject(obj);
	}
	return true;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:23,代码来源:Serializer.java


示例5: readSimpleObject

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Reads the input as a map and returns a Map
 *
 * @return                 Read map
 */
protected Map<String, Object> readSimpleObject() {
	log.debug("read map");
	Map<String, Object> result = new ObjectMap<String, Object>();
	readKeyValues(result);
	storeReference(result);
	return result;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:13,代码来源:Input.java


示例6: onStreamEvent

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void onStreamEvent(Notify notify) {
	log.debug( "onStreamEvent " + notify );

	@SuppressWarnings("rawtypes")
	ObjectMap map = (ObjectMap) notify.getCall().getArguments()[0];
	String code = (String) map.get("code");

	if (StatusCodes.NS_PUBLISH_START.equals(code)) {
		log.debug( "onStreamEvent Publish start" );
		getCapture().setStartPublish(true);
		setReadyToRecord(true);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:15,代码来源:Core.java


示例7: sendOnPlayStatus

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Sends an onPlayStatus message.
 * 
 * http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
 * 
 * @param code
 * @param duration
 * @param bytes
 */
private void sendOnPlayStatus(String code, int duration, long bytes) {
    if (log.isDebugEnabled()) {
        log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
    }
    // create the buffer
    IoBuffer buf = IoBuffer.allocate(102);
    buf.setAutoExpand(true);
    Output out = new Output(buf);
    out.writeString("onPlayStatus");
    ObjectMap<Object, Object> args = new ObjectMap<>();
    args.put("code", code);
    args.put("level", Status.STATUS);
    args.put("duration", duration);
    args.put("bytes", bytes);
    if (StatusCodes.NS_PLAY_TRANSITION_COMPLETE.equals(code)) {
        args.put("clientId", streamId);
        args.put("details", currentItem.getName());
        args.put("description", String.format("Transitioned to %s", currentItem.getName()));
        args.put("isFastPlay", false);
    }
    out.writeObject(args);
    buf.flip();
    Notify event = new Notify(buf, "onPlayStatus");
    if (lastMessageTs > 0) {
        event.setTimestamp(lastMessageTs);
    } else {
        event.setTimestamp(0);
    }
    RTMPMessage msg = RTMPMessage.build(event);
    doPushMessage(msg);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:41,代码来源:PlayEngine.java


示例8: play2

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Dynamic streaming play method. This is a convenience method.
 * 
 * @param params
 *            play parameters
 */
@SuppressWarnings("rawtypes")
public void play2(ObjectMap params) {
    log.debug("play2 options: {}", params);
    Map<String, Object> playOptions = new HashMap<String, Object>();
    for (Object key : params.keySet()) {
        String k = key.toString();
        log.trace("Parameter: {}", k);
        playOptions.put(k, params.get(k));
    }
    play2(playOptions);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:18,代码来源:StreamService.java


示例9: run

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
public void run() {

		done = false;

		connection.ping();
		deltaDown = connection.getWrittenBytes();
		deltaUp = connection.getReadBytes();
		endpoint().invoke("onBWStart");

		try {
			Thread.sleep(duration);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		done = true;

		connection.removeAttribute("bwChecker");

		ObjectMap<Object, Object> map = new ObjectMap<Object, Object>();
		map.put("bytesDown", bytesDown);
		map.put("bytesUp", bytesUp);
		map.put("messages", messages);
		map.put("chunks", messages);
		map.put("ping", connection.getLastPingTime());

		endpoint().invoke("onBWDone", new Object[] { map });

	}
 
开发者ID:Red5,项目名称:red5-rtsp-restreamer,代码行数:29,代码来源:BandwidthChecker.java


示例10: writeObjectType

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Write typed object to the output
 * 
 * @param out
 *            Output writer
 * @param obj
 *            Object type to write
 * @return <tt>true</tt> if the object has been written, otherwise <tt>false</tt>
 */
@SuppressWarnings("all")
protected static boolean writeObjectType(Output out, Object obj) {
    if (obj instanceof ObjectMap || obj instanceof BeanMap) {
        out.writeObject((Map) obj);
    } else if (obj instanceof Map) {
        out.writeMap((Map) obj);
    } else if (obj instanceof RecordSet) {
        out.writeRecordSet((RecordSet) obj);
    } else {
        out.writeObject(obj);
    }
    return true;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:23,代码来源:Serializer.java


示例11: readSimpleObject

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Reads the input as a map and returns a Map
 *
 * @return Read map
 */
protected Map<String, Object> readSimpleObject() {
    log.debug("readSimpleObject");
    Map<String, Object> result = new ObjectMap<>();
    readKeyValues(result);
    storeReference(result);
    return result;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:13,代码来源:Input.java


示例12: testOnStreamSendMap

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Test
public void testOnStreamSendMap() {
    // 02 = string
    // 08 = mixed array (map) max number = 0
    
    IoBuffer data = IoBuffer.wrap(IOUtils.hexStringToByteArray("02 00 0c 6f 6e 53 74 72 65 61 6d 53 65 6e 64 08 00000000 00 05 76 616c7565 02 00 01 31 00 00 09"));
    Input in0 = new Input(data);
    assertEquals(DataTypes.CORE_STRING, in0.readDataType());
    String method = in0.readString();
    assertEquals("onStreamSend", method);
    assertEquals(DataTypes.CORE_MAP, in0.readDataType());
    @SuppressWarnings("rawtypes")
    ObjectMap map = (ObjectMap) in0.readMap();
    assertEquals(map.get("value"), "1");
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:16,代码来源:InputTest.java


示例13: testZeroBasedEcmaArray

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Test
public void testZeroBasedEcmaArray() {
    // { '0': 'hello', '1': 'world' }
    byte[] stream = new byte[] { 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x30, 0x02, 0x00, 0x05, 'h', 'e', 'l', 'l', 'o', 0x00, 0x01, 0x31, 0x02, 0x00, 0x05, 'w', 'o', 'r', 'l', 'd', 0x00, 0x00, 0x09 };
    Input input = new Input(IoBuffer.wrap(stream));
    Object actual = input.readMap();

    ObjectMap<Object, Object> expected = new ObjectMap<>();
    expected.put(0, "hello");
    expected.put(1, "world");

    assertEquals(expected, actual);
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:14,代码来源:InputTest.java


示例14: resultReceived

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void resultReceived(IPendingServiceCall call) {
    log.debug("resultReceived", call);
    if (call.getResult() instanceof ObjectMap<?, ?>) {
        ObjectMap<?, ?> map = (ObjectMap<?, ?>) call.getResult();
        if (map.containsKey("code")) {
            String code = (String) map.get("code");
            log.debug("Code: {}", code);
            if (StatusCodes.NS_PLAY_START.equals(code)) {
                subscribed = true;
            }
        }
    }
    wrapped.resultReceived(call);
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:16,代码来源:BaseRTMPClientHandler.java


示例15: resultReceived

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void resultReceived(IPendingServiceCall call) {
    System.out.println("connectCallback");
    ObjectMap<?, ?> map = (ObjectMap<?, ?>) call.getResult();
    String code = (String) map.get("code");
    System.out.printf("Response code: %s\n", code);
    if ("NetConnection.Connect.Rejected".equals(code)) {
        System.out.printf("Rejected: %s\n", map.get("description"));
        disconnect();
        finished = true;
    } else if ("NetConnection.Connect.Success".equals(code)) {
        invoke("demoService.getListOfAvailableFLVs", new Object[] {}, methodCallCallback);
        createStream(createStreamCallback);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:16,代码来源:ClientTest.java


示例16: resultReceived

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void resultReceived(IPendingServiceCall call) {
    log.debug("Received pending call: {}", call);
    Object result = call.getResult();
    if (result instanceof ObjectMap) {
        obj = getSharedObject(soName, false);
        obj.connect(Red5.getConnectionLocal());
        obj.addSharedObjectListener(this);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:11,代码来源:SharedObjectClient.java


示例17: onStatus

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
public void onStatus(IConnection conn, ObjectMap<String, Object> status) {
    log.debug("onStatus: {}", status);
    
    String code = status.get("code").toString();
    if ("NetStream.Play.Stop".equals(code)) {
        log.debug("Playback stopped");
        conn.close();
    }
    
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:11,代码来源:ClientMethodHander.java


示例18: resultReceived

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void resultReceived(IPendingServiceCall call) {
    System.out.println("connectCallback");
    ObjectMap<?, ?> map = (ObjectMap<?, ?>) call.getResult();
    String code = (String) map.get("code");
    System.out.printf("Response code: %s\n", code);
    if ("NetConnection.Connect.Rejected".equals(code)) {
        System.out.printf("Rejected: %s\n", map.get("description"));
        disconnect();
        synchronized (RTMPTSClientTest.class) {
            finished = true;
            RTMPTSClientTest.class.notifyAll();
        }
    } else if ("NetConnection.Connect.Failed".equals(code)) {
        System.out.printf("Failed: %s\n", map.get("description"));
        disconnect();
        synchronized (RTMPTSClientTest.class) {
            finished = true;
            RTMPTSClientTest.class.notifyAll();
        }
    } else if ("NetConnection.Connect.Success".equals(code)) {
        test();
        createStream(createStreamCallback);
    } else {
        System.out.printf("Unhandled response code: %s\n", code);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:28,代码来源:RTMPTSClientTest.java


示例19: resultReceived

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
@Override
public void resultReceived(IPendingServiceCall call) {
    System.out.println("connectCallback");
    ObjectMap<?, ?> map = (ObjectMap<?, ?>) call.getResult();
    String code = (String) map.get("code");
    System.out.printf("Response code: %s\n", code);
    if ("NetConnection.Connect.Rejected".equals(code)) {
        System.out.printf("Rejected: %s\n", map.get("description"));
        disconnect();
        synchronized (RTMPTClientTest.class) {
            finished = true;
            RTMPTClientTest.class.notifyAll();
        }
    } else if ("NetConnection.Connect.Failed".equals(code)) {
        System.out.printf("Failed: %s\n", map.get("description"));
        disconnect();
        synchronized (RTMPTClientTest.class) {
            finished = true;
            RTMPTClientTest.class.notifyAll();
        }
    } else if ("NetConnection.Connect.Success".equals(code)) {
        test();
        createStream(createStreamCallback);
    } else {
        System.out.printf("Unhandled response code: %s\n", code);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:28,代码来源:RTMPTClientTest.java


示例20: play2

import org.red5.io.utils.ObjectMap; //导入依赖的package包/类
/**
 * Dynamic streaming play method. This is a convenience method.
 * 
 * @param params
 */
@SuppressWarnings("rawtypes")
public void play2(ObjectMap params) {
	log.debug("play2 options: {}", params);
	Map<String, Object> playOptions = new HashMap<String, Object>();
	for (Object key : params.keySet()) {
		String k = key.toString();
		log.trace("Parameter: {}", k);
		playOptions.put(k, params.get(k));
	}
	play2(playOptions);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:17,代码来源:StreamService.java



注:本文中的org.red5.io.utils.ObjectMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultPlaceRequest类代码示例发布时间:2022-05-23
下一篇:
Java MathRuntimeException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap