Ejemplo n.º 1
0
        public static string StopPlaySDK(string app, string stream)
        {
            string key = GetKey(app, stream);

            if (!dic_playProxy_media.ContainsKey(key))
            {
                return(key + ":未找到");
            }
            bool   ret       = CHCNetSDK.NET_DVR_StopRealPlay(dic_playProxy_media[key].playHandle);
            IntPtr playProxy = dic_playProxy_media[key].ctx;

            MediaServer.mk_media_release(playProxy);
            dic_playProxy_media.Remove(key);


            if (RedisHelper.GetDatabase().HashExists("live", key))
            {
                bool ret1 = RedisHelper.GetDatabase().HashDelete("live", key);
                Console.WriteLine("删除" + key + ":" + ret1);
            }
            else
            {
                Console.WriteLine($"redis中未找到hash(live),HashFiled:{key}");
            }
            return(key + ":停止拉流");
        }