Example #1
0
        //public HttpResponseMessage Get(string fileName)
        //{
        //    var resp = Request.CreateResponse();
        //    resp.Content=new PushStreamContent( (stream,content,context)=>{
        //        byte[] bytes=new byte[5000];
        //       FileStream f= System.IO.File.OpenRead(fileName);
        //       int length=(int)f.Length;
        //        while(length > 0)
        //        {
        //        var bytesRead=f.Read(bytes,0,Math.Min(length,bytes.Length));
        //            stream.WriteAsync(bytes,0,bytesRead);
        //            length-=bytesRead;

        //        }

        //    },new MediaTypeHeaderValue("video/mp4"));
        //    return resp;



        //}

        public HttpResponseMessage Get(string filename, string ext)
        {
            var response = Request.CreateResponse();
            var video    = new VideoStreamModel(filename, ext);

            response.Content = new PushStreamContent(video.WriteToStream, new MediaTypeHeaderValue("video/" + ext));

            return(response);
        }
 public VideoFileInformationModel(string fullPath, string filename, string extension, string formatName,
                                  string bitRate, long fileSize, double durationInSecs, VideoStreamModel videoStream,
                                  AudioStreamModel audioStream)
 {
     FullPath       = fullPath;
     Filename       = filename;
     Extension      = extension;
     FormatName     = formatName;
     BitRate        = bitRate;
     FileSize       = fileSize;
     DurationInSecs = durationInSecs;
     VideoStream    = videoStream;
     AudioStream    = audioStream;
 }
Example #3
0
        internal static MEETINGMANAGE_VideoStreamInfo ToStruct(this VideoStreamModel model)
        {
            MEETINGMANAGE_VideoStreamInfo streamInfo = new MEETINGMANAGE_VideoStreamInfo()
            {
                height    = model.Height,
                streamID  = model.StreamId,
                width     = model.Width,
                xPos      = model.X,
                yPos      = model.Y,
                userid    = model.AccountId,
                videoType = (MEETINGMANAGE_MixVideoType)model.VideoType,
            };

            return(streamInfo);
        }
        public VideoStreamModel[] GetVideoStreamModels(Size canvasSize)
        {
            List <IVideoBox> copiedVideoBoxs = new List <IVideoBox>();

            foreach (IVideoBox item in GetVisibleVideoBoxs())
            {
                VideoBox videoBox   = item as VideoBox;
                var      copiedItem = videoBox.Copy();
                copiedVideoBoxs.Add(copiedItem);
            }


            if (LayoutRendererStore.CurrentLayoutRenderType == LayoutRenderType.AutoLayout)
            {
                ModeDisplayerStore.Create().Display(copiedVideoBoxs, canvasSize);
            }
            else
            {
                LayoutRendererStore.Create().Render(copiedVideoBoxs, canvasSize, GetSpecialVideoBoxName(LayoutRendererStore.CurrentLayoutRenderType));
            }

            List <VideoStreamModel> videoStreamModels = new List <VideoStreamModel>();

            foreach (var copiedVideoBox in copiedVideoBoxs)
            {
                VideoStreamModel videoStreamModel = new VideoStreamModel()
                {
                    AccountId = copiedVideoBox.AccountResource.AccountModel.AccountId.ToString(),
                    Height    = (int)Math.Round(copiedVideoBox.Height),
                    StreamId  = copiedVideoBox.AccountResource.ResourceId,
                    Width     = (int)Math.Round(copiedVideoBox.Width),
                    X         = (int)Math.Round(copiedVideoBox.PosX),
                    Y         = (int)Math.Round(copiedVideoBox.PosY),
                };

                VideoBox videoBox = copiedVideoBox as VideoBox;
                videoStreamModel.VideoType = videoBox.AccountResource.MediaType == MediaType.VideoDoc ? VideoType.DataType : VideoType.VideoType;

                videoStreamModels.Add(videoStreamModel);
            }

            return(videoStreamModels.ToArray());
        }
Example #5
0
 public bool Equals(VideoStreamModel other)
 {
     return(Width == other.Width && Height == other.Height && string.Equals(CodecName, other.CodecName) &&
            StartTime.Equals(other.StartTime));
 }