自学内容网 自学内容网

视频监控相关笔记

一、QT 之 QTreeWidget 树形控件

Qt编程指南,Qt新手教程,Qt Programming Guide

二、视频播放

1. 主辅码流区别

2.  RTSP

3.  SDK的调用案例:

#pragma once

#include <memory>
#ifdef _WINDOWS
#include <Windows.h>
#ifdef  LIBRTSPCLINET_SDK_EXPORTS
#define LIBRTSPCLINET_API __declspec(dllexport)
#else
#define LIBRTSPCLINET_API __declspec(dllimport)
#endif
#else  
#define LIBRTSPCLINET_API
#endif

#include "Common.h"

using namespace std;

class LIBRTSPCLINET_API LibRtspClientManager
{
public:
    static LibRtspClientManager& getInstance() {
        static LibRtspClientManager instance;
        return instance;
    }

    /* @ 初始化SDK:
       @ 参数:
        onLibRtspClientDateCB 数据回调函数地址
        onLibRtspClientMsgCB  消息回调函数地址
       @ 返回: bool
    */
    bool Init();

    /* @ 反初始化SDK:
       @ 参数:
       @ 返回: void
    */
    void UnInit();

    /* @ 创建RTSP Client:
       @ 参数:
            std::string url : rtsp url
            TransProtocol trans_protocol : 0-udp, 1-tcp
            int timeout : 超时时间,单位秒
       @ 返回: int32_t rtsp session id
    */
    uint32_t CreateRtspClient(std::string url,
        std::string username, std::string password,
        TransProtocol trans_protocol, RtspCallBack* callback, int timeout);

    bool ReleaseRtspClient(uint32_t session_id);

    /* @ 连接服务器
     * @ 异步通知,rtsp连接情况在onLibRtspClientMsgCB反馈
    */
    bool Connect(uint32_t session_id);

    bool Play(uint32_t session_id, std::string params_json);

    bool Control(uint32_t session_id, std::string params_json);

    bool Pause(uint32_t session_id);

    // 恢复播放
    bool Resume(uint32_t session_id);

    // 从指定位置恢复播放
    bool Resume(uint32_t session_id, float npt);

    bool Stop(uint32_t session_id);

    void WaitForStop(uint32_t session_id);
private:
    LibRtspClientManager();

    virtual ~LibRtspClientManager();

    class LibRtspClientPriv;
    std::shared_ptr<LibRtspClientPriv> m_priv;
};

4. 


原文地址:https://blog.csdn.net/sinat_20962951/article/details/142454696

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!