/// <summary>
 /// Creates player with set of necessary filters support.
 /// </summary>
 public override Player CreatePlayer(PlayerOutput playerOutput, IFilterBase filtersRequired) {
     VerifyObjectIsNotDisposed();
     //
     if (playerOutput == null) {
         throw new ArgumentNullException("playerOutput");
     }
     //
     if (filtersRequired is IAdjustable) {
         
     }
     return (new VlcPlayer(playerOutput, new InternalObjectsFactory(descriptor), this));
 }
 /// <summary>
 /// Creates player which can be used to control media playing.
 /// </summary>
 /// <returns>Player instance.</returns>
 public override Player CreatePlayer(PlayerOutput playerOutput) {
     VerifyObjectIsNotDisposed();
     //
     if (playerOutput == null) {
         throw new ArgumentNullException("playerOutput");
     }
     //
     return (new VlcPlayer(playerOutput, new InternalObjectsFactory(descriptor), this));
 }
 /// <summary>
 /// Creates player with set of necessary filters.
 /// </summary>
 public abstract Player CreatePlayer(PlayerOutput playerOutput, IFilterBase filtersRequired );
 /// <summary>
 /// Creates player which can be used to control media playing.
 /// </summary>
 /// <returns>Player instance.</returns>
 public abstract Player CreatePlayer(PlayerOutput playerOutput);
        public void SetOutput(PlayerOutput playerOutput) {
            if (playerOutput == null) {
                throw new ArgumentNullException("playerOutput");
            }
            //
            VerifyObjectIsNotDisposed();
            //
            if ((playerOutput.Files.Count == 0) && (playerOutput.NetworkStreams.Count == 0)) {
                //
                //addOption("--video-filter=adjust@my_label");
                //
                return;
            }

            //string transcodeString = "vcodec=WMV2,vb=800,scale=1,acodec=wma,ab=128,channels=2";
            const string transcodeString = "vcodec=WMV2,vb=1024,scale=1";

            // Здесь media должна знать, будет ли она дублироваться на экран
            string duplicateString = (playerOutput.Window != null) ? "dst=display" : String.Empty;
            foreach (OutFile file in playerOutput.Files) {
                //dst=std{access=file,mux=ps,dst=\"{0}\"}
                string s = String.Format("dst=std[access=file,mux=ps,dst=\"{0}\"]", file.FileName);

                if (String.IsNullOrEmpty(duplicateString)) {
                    duplicateString = s;
                } else {
                    duplicateString += "," + s;
                }
            }

            foreach (OutputNetworkStream stream in playerOutput.NetworkStreams) {
                //dst=std{access=http,mux=asf,dst=172.28.1.4:8888}
                //dst=rtp{dst=1231232,mux=asf,port=1234,port-audio=12367,port-video=31236}
                string s;
                if (stream.Protocol != NetworkProtocol.RTP) {
                    s = String.Format("dst=std[access={0},mux=asf,dst={1}:{2}]",
                        stream.Protocol.ToString().ToLower(), stream.Ip, stream.Port);
                } else {
                    s = String.Format("dst=rtp[dst={0},mux=asf,port={1},port-audio={2},port-video={3}]",
                        stream.Ip, stream.Port, stream.RtpPortAudio, stream.RtpPortVideo);
                }

                if (String.IsNullOrEmpty(duplicateString)) {
                    duplicateString = s;
                } else {
                    duplicateString += "," + s;
                }
            }

            string optionsString = String.Format(":sout=#transcode[{0}]:duplicate[{1}]", transcodeString, duplicateString);

            addOption(optionsString.Replace('[', '{').Replace(']', '}'));
        }
Ejemplo n.º 6
0
 internal VlcPlayer(PlayerOutput playerOutput, IInternalObjectsFactory internalObjectsFactory, IVolumeManager volumeManager) {
     if (playerOutput == null) {
         throw new ArgumentNullException("playerOutput");
     }
     if (volumeManager == null) {
         throw new ArgumentNullException("volumeManager");
     }
     if (internalObjectsFactory == null) {
         throw new ArgumentNullException("internalObjectsFactory");
     }
     //
     this.playerOutput = playerOutput;
     this.volumeManager = volumeManager;
     this.internalObjectsFactory = internalObjectsFactory;
     //
     firstMediaPlayerInternal = this.internalObjectsFactory.CreateVlcMediaPlayerInternal();
     secondMediaPlayerInternal = this.internalObjectsFactory.CreateVlcMediaPlayerInternal();
     //
     initializeEventsEngine();
 }