package com.usky.sas.service.impl;

import com.usky.sas.service.SasVideoStreamService;
import com.usky.sas.service.vo.LiveStreamResponse;
import com.usky.sas.service.vo.PlaybackStreamResponse;
import com.usky.sas.service.vo.VideoStreamRequest;
import org.springframework.stereotype.Service;

/**
 * 视频流服务占位实现
 */
@Service
public class SasVideoStreamServiceImpl implements SasVideoStreamService {

    @Override
    public LiveStreamResponse liveStream(VideoStreamRequest request) {
        LiveStreamResponse resp = new LiveStreamResponse();
        resp.setRtspUrl("rtsp://example/live/" + request.getDeviceId() + ":" + request.getChannel());
        resp.setHlsUrl("http://example/hls/live_" + request.getDeviceId() + "_" + request.getChannel() + ".m3u8");
        resp.setFlvUrl("http://example/flv/live_" + request.getDeviceId() + "_" + request.getChannel() + ".flv");
        return resp;
    }

    @Override
    public PlaybackStreamResponse playbackStream(VideoStreamRequest request) {
        PlaybackStreamResponse resp = new PlaybackStreamResponse();
        resp.setRtspUrl("rtsp://example/playback/" + request.getDeviceId());
        resp.setHlsUrl("http://example/hls/playback_" + request.getDeviceId() + ".m3u8");
        resp.setFlvUrl("http://example/flv/playback_" + request.getDeviceId() + ".flv");
        return resp;
    }
}

