package com.platform.plugs.live.handlers;

import com.platform.plugs.common.rpc.RpcResponse;
import com.platform.plugs.live.annotation.RpcParam;
import com.platform.plugs.live.config.LiveRecordConfig;
import com.platform.plugs.live.responseEntity.LiveRecordVodConfig;

import java.util.Date;
import java.util.List;

/**
 * @Author TONG
 * @Date 2019/3/6 15:17
 **/
public interface ILiveRecordHandler {

    LiveRecordConfig getLiveRecordConfig();

    void configLiveRecord(LiveRecordConfig liveRecordConfig);

    /**
     * 配置 APP 录制，输出内容保存到 OSS 中,并开启在线流录制
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse addLiveAppRecordConfigAndStartOnlineSteamRecords(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 配置 APP 录制，输出内容保存到 OSS 中
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse addLiveAppRecordConfig(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 配置 APP 录制，输出内容保存到 OSS 中
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse addLiveAppRecordConfig(String appName, String streamName, Date endDate);

    /**
     * 配置 APP 录制，输出内容保存到 OSS 中
     * @param appName
     * @param streamName
     * @param startTime
     * @param endTime
     * @return
     */
    RpcResponse addLiveAppRecordConfig(String appName, String streamName, Date startTime, Date endTime);

    /**
     * 删除录制配置并停止所有在线流录制,已在录制的流会继续录制完毕，由于配置已删除，所以没有回调
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse deleteLiveAppRecordConfigAndStopOnlineSteamRecords(String appName, String streamName);

    /**
     * 删除录制配置
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse deleteLiveAppRecordConfig(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 启动录制
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse startRealTimeRecordCommand(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 停止录制
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse stopRealTimeRecordCommand(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 添加直播录制转点播配置
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse addLiveRecordVodMp4Config(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 添加直播录制转点播配置
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse addLiveRecordVodMp3Config(@RpcParam String appName, @RpcParam String streamName);
    /**
     * 删除直播录制转点播配置
     * @param appName
     * @param streamName
     * @return
     */
    RpcResponse deleteLiveRecordVodConfig(@RpcParam String appName, @RpcParam String streamName);

    /**
     * 查询直转点配置列表
     * @return
     */
    RpcResponse<List<LiveRecordVodConfig>> describeLiveRecordVodConfigs();
    
    /**
     * 查询现场直转点配置列表
     * @return
     */
    RpcResponse<List<LiveRecordVodConfig>> describeLiveRecordVodConfig(@RpcParam String appName);
}
