Click here to Skip to main content
15,867,330 members
Home / Discussions / C#
   

C#

 
QuestionReport group Amount problem Pin
imshamim18-Jul-09 17:40
imshamim18-Jul-09 17:40 
QuestionDrawing a dynamic rectangle with GraphicsPath Pin
NewJavaBean18-Jul-09 12:38
NewJavaBean18-Jul-09 12:38 
AnswerRe: Drawing a dynamic rectangle with GraphicsPath Pin
Ravi Bhavnani19-Jul-09 5:54
professionalRavi Bhavnani19-Jul-09 5:54 
QuestionFilling Enum Values?? Pin
Muammar©18-Jul-09 10:56
Muammar©18-Jul-09 10:56 
AnswerRe: Filling Enum Values?? Pin
PIEBALDconsult18-Jul-09 11:36
mvePIEBALDconsult18-Jul-09 11:36 
GeneralRe: Filling Enum Values?? Pin
Muammar©19-Jul-09 0:58
Muammar©19-Jul-09 0:58 
GeneralRe: Filling Enum Values?? Pin
PIEBALDconsult19-Jul-09 4:23
mvePIEBALDconsult19-Jul-09 4:23 
Questionc# DirectShow udp Pin
Maxim Rubchinsky18-Jul-09 10:27
Maxim Rubchinsky18-Jul-09 10:27 
Hello,
I'm using the DirectShow.Net library to create a media player in my software.
using the followong code I'm able to play files in the local pc or the network (unc path)

private const int WMGraphNotify = 0x0400 + 13;
        private const int VolumeFull = 0;
        private const int VolumeSilence = -10000;

        private IGraphBuilder graphBuilder = null;
        private IMediaControl mediaControl = null;
        private IMediaEventEx mediaEventEx = null;
        private IVideoWindow videoWindow = null;
        private IBasicAudio basicAudio = null;
        private IBasicVideo basicVideo = null;
        private IMediaSeeking mediaSeeking = null;
        private IMediaPosition mediaPosition = null;
        private IVideoFrameStep frameStep = null;
        private string filename = string.Empty;
        private bool isAudioOnly = false;
        private bool isFullScreen = false;
        private int currentVolume = VolumeFull;
        private PlayState currentState = PlayState.Stopped;
        private double currentPlaybackRate = 1.0;
        private bool m_bTracking;
        private IntPtr hDrain = IntPtr.Zero;
        private AMSeekingSeekingCapabilities seek;
        private double tDuration;

public void OpenPlayFile(string filename)
        {
            StopClip();
            CloseInterfaces();

            int hr = 0;

            if (filename == string.Empty)
                return;

            this.graphBuilder = (IGraphBuilder)new FilterGraph();

            // Have the graph builder construct its the appropriate graph automatically
            hr = this.graphBuilder.RenderFile(filename, null);
            DsError.ThrowExceptionForHR(hr);

            // QueryInterface for DirectShow interfaces
            this.mediaControl = (IMediaControl)this.graphBuilder;
            this.mediaEventEx = (IMediaEventEx)this.graphBuilder;
            this.mediaSeeking = (IMediaSeeking)this.graphBuilder;
            this.mediaPosition = (IMediaPosition)this.graphBuilder;
            
            // Query for video interfaces, which may not be relevant for audio files
            this.videoWindow = this.graphBuilder as IVideoWindow;
            this.basicVideo = this.graphBuilder as IBasicVideo;

            // Query for audio interfaces, which may not be relevant for video-only files
            this.basicAudio = this.graphBuilder as IBasicAudio;

            // Is this an audio-only file (no video component)?
            CheckVisibility();

            // Have the graph signal event via window callbacks for performance
            hr = this.mediaEventEx.SetNotifyWindow(this.Handle, WMGraphNotify, IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);

            if (!this.isAudioOnly)
            {
                // Setup the video window
                hr = this.videoWindow.put_Owner(this.Handle);
                DsError.ThrowExceptionForHR(hr);

                hr = this.videoWindow.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipSiblings | WindowStyle.ClipChildren);
                DsError.ThrowExceptionForHR(hr);

                hr = InitVideoWindow(1, 1);
                DsError.ThrowExceptionForHR(hr);

                GetFrameStepInterface();
            }
            else
            {
                // Initialize the default player size and enable playback menu items
                hr = InitPlayerWindow();
                DsError.ThrowExceptionForHR(hr);
            }

            // Complete window initialization
            this.isFullScreen = false;
            this.currentPlaybackRate = 1.0;

            this.Focus();

            // Run the graph to play the media file
            hr = this.mediaControl.Run();
            DsError.ThrowExceptionForHR(hr);

            this.currentState = PlayState.Running;

            hr = this.mediaSeeking.GetCapabilities(out seek);
            DsError.ThrowExceptionForHR(hr);

            if (seek != AMSeekingSeekingCapabilities.None)
            {
                hr = mediaPosition.get_Duration(out tDuration);
                DsError.ThrowExceptionForHR(hr);

                tbSeekBar.Enabled = true;
                btnRewind.Enabled = true;
                btnForward.Enabled = true;
                timer.Enabled = true;
            }
            else
            {
                tbSeekBar.Enabled = false;
                btnRewind.Enabled = false;
                btnForward.Enabled = false;
                timer.Enabled = false;
            }
        }


I need to be able to play multicast streams that are sent form other computers and cameres in the Lan in udp, in the vlc player I would use the following address to play it udp://@225.19.19.83:1234 I can'r use this address in my function because it failes on
hr = this.graphBuilder.RenderFile(filename, null);
DsError.ThrowExceptionForHR(hr);

System.IO.FileNotFoundException was unhandled
Message="Exception from HRESULT: 0x800C000D"

It's logical because my code can't connect to the source
can someone help me to be able to conncet to a udp multicast sream?
AnswerRe: c# DirectShow udp Pin
ZainGhani22-Oct-11 17:51
ZainGhani22-Oct-11 17:51 
QuestionmciSendString cannot save wave file Pin
Steve1_rm18-Jul-09 6:42
Steve1_rm18-Jul-09 6:42 
QuestionPrintable DataGrid Pin
danishkhawar18-Jul-09 6:23
danishkhawar18-Jul-09 6:23 
AnswerRe: Printable DataGrid Pin
Gary Stafford18-Jul-09 14:57
Gary Stafford18-Jul-09 14:57 
QuestionDisplay image in table Pin
nudma18-Jul-09 5:10
nudma18-Jul-09 5:10 
AnswerRe: Display image in table Pin
dan!sh 18-Jul-09 5:26
professional dan!sh 18-Jul-09 5:26 
GeneralRe: Display image in table Pin
nudma19-Jul-09 17:23
nudma19-Jul-09 17:23 
QuestionConnecting 2 computers over Internet Pin
Igor120118-Jul-09 3:56
Igor120118-Jul-09 3:56 
AnswerRe: Connecting 2 computers over Internet Pin
dan!sh 18-Jul-09 5:28
professional dan!sh 18-Jul-09 5:28 
GeneralRe: Connecting 2 computers over Internet Pin
Igor120118-Jul-09 5:44
Igor120118-Jul-09 5:44 
GeneralRe: Connecting 2 computers over Internet Pin
dan!sh 18-Jul-09 5:53
professional dan!sh 18-Jul-09 5:53 
GeneralRe: Connecting 2 computers over Internet Pin
Igor120118-Jul-09 6:03
Igor120118-Jul-09 6:03 
QuestionRe: Connecting 2 computers over Internet Pin
harold aptroot18-Jul-09 6:17
harold aptroot18-Jul-09 6:17 
AnswerRe: Connecting 2 computers over Internet Pin
Igor120118-Jul-09 6:38
Igor120118-Jul-09 6:38 
GeneralRe: Connecting 2 computers over Internet Pin
harold aptroot18-Jul-09 6:47
harold aptroot18-Jul-09 6:47 
GeneralRe: Connecting 2 computers over Internet Pin
Igor120118-Jul-09 7:17
Igor120118-Jul-09 7:17 
GeneralRe: Connecting 2 computers over Internet Pin
harold aptroot18-Jul-09 7:25
harold aptroot18-Jul-09 7:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.