Example #1
0
        private int RealProSourceCallBack(EASY_CALLBACK_TYPE_ENUM callbackType, int channelId, IntPtr userPtr, MEDIA_TYPE mediaType, IntPtr pBuf, IntPtr _frameInfo)
        {
            if (EasyPlayerProSDK.EASY_CALLBACK_TYPE_ENUM.EASY_TYPE_CODEC_DATA == callbackType)
            {
                EASY_FRAME_INFO frameInfo = new EASY_FRAME_INFO();
                byte[]          pByte     = new byte[512];
                if (_frameInfo != IntPtr.Zero)
                {
                    Marshal.Copy(_frameInfo, pByte, 0, Marshal.SizeOf(typeof(EASY_FRAME_INFO)));
                    frameInfo = (EASY_FRAME_INFO)BytesToStruct(pByte, frameInfo.GetType());
                }
                if (mediaType == EasyPlayerProSDK.MEDIA_TYPE.MEDIA_TYPE_VIDEO)
                {
                    Console.WriteLine("FrameInfo: 视频==========分辨率:[" + frameInfo.width + "," + frameInfo.height + "]====Fps: " + frameInfo.fps + "====码率:" + frameInfo.bitrate);
                }
                else if (mediaType == EasyPlayerProSDK.MEDIA_TYPE.MEDIA_TYPE_AUDIO)
                {
                    Console.WriteLine("FrameInfo: 音频==========采样率:[" + frameInfo.sample_rate + "]====通道数: " + frameInfo.channels + "====采样位宽:" + frameInfo.bits_per_sample);
                }
            }

            return(0);
        }
Example #2
0
 int MediaSourceCallBack(int _channelId, ref int _channelPtr, int _frameType, string pBuf, ref EASY_FRAME_INFO _frameInfo)
 {
     if (_frameType == EASY_SDK_EVENT_FRAME_FLAG)
     {
     }
     return(0);
 }
Example #3
0
 private int RealProSourceCallBack(EASY_CALLBACK_TYPE_ENUM callbackType, int channelId, IntPtr userPtr, MEDIA_TYPE mediaType, IntPtr pBuf, ref EASY_FRAME_INFO _frameInfo)
 {
     return(0);
 }