Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem in building DirectShow Application

Problem in building DirectShow Application

Scheduled Pinned Locked Moved C#
helpcsharpquestionvisual-studiotutorial
14 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A alpa shah

    All dll's i've included in that. I'm using platform SDK that is server 2003 sp1. I think it is most recent one for DirectShow application.:((

    alpa shah

    A Offline
    A Offline
    Amar Chaudhary
    wrote on last edited by
    #4

    is your hardware accelertion turned on

    It is Good to be Important but! it is more Important to be Good [My Question]

    1 Reply Last reply
    0
    • A alpa shah

      All dll's i've included in that. I'm using platform SDK that is server 2003 sp1. I think it is most recent one for DirectShow application.:((

      alpa shah

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #5

      Is it giving any exception? Which method have u called to play the .avi file? can u paste some code so we can get to the problem.

      Thanks & Regards, Pramod "Everyone is a genius at least once a year"

      A 1 Reply Last reply
      0
      • A AB7771

        Is it giving any exception? Which method have u called to play the .avi file? can u paste some code so we can get to the problem.

        Thanks & Regards, Pramod "Everyone is a genius at least once a year"

        A Offline
        A Offline
        alpa shah
        wrote on last edited by
        #6

        yes, it's throwing me exception. I've implemented the sample application from this site only... sample code is: try{ //get the graph filter ready to render OpenFileDialog ofg = new OpenFileDialog(); if (ofg.ShowDialog() == DialogResult.OK) { String fileName; fileName = ofg.FileName; graphBuilder.RenderFile(fileName); Text = fileName; //set the trackbar isSeeking = (graphBuilder.CanSeekForward() == -1) && (graphBuilder.CanSeekBackward() == -1); if (isSeeking) trackBar1.Enabled = true; else trackBar1.Enabled = false; trackBar1.Minimum = 0; trackBar1.Maximum = (int)(graphBuilder.Duration * 100.0); Text = fileName; //prepare and set the video window videoWin = graphBuilder as IVideoWindow; videoWin.Owner = (int)panel1.Handle; videoWin.WindowStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; Rectangle rc = panel1.ClientRectangle; videoWin.SetWindowPosition(0, 0, rc.Right, rc.Bottom); mediaEvt.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0); //set the different values for controls trackBar1.Value = 0; minutes = (int)graphBuilder.Duration / 60; seconds = (int)graphBuilder.Duration % 60; statusBar1.Panels[0].Text = "Duration: " + minutes.ToString("D2") + ":m" + seconds.ToString("D2") + ":s"; graphState = State.Playing; //start the playback mediaCtrl.Run(); } } catch( Exception ) { Text = "Error loading file"; }

        alpa shah

        A 1 Reply Last reply
        0
        • A alpa shah

          yes, it's throwing me exception. I've implemented the sample application from this site only... sample code is: try{ //get the graph filter ready to render OpenFileDialog ofg = new OpenFileDialog(); if (ofg.ShowDialog() == DialogResult.OK) { String fileName; fileName = ofg.FileName; graphBuilder.RenderFile(fileName); Text = fileName; //set the trackbar isSeeking = (graphBuilder.CanSeekForward() == -1) && (graphBuilder.CanSeekBackward() == -1); if (isSeeking) trackBar1.Enabled = true; else trackBar1.Enabled = false; trackBar1.Minimum = 0; trackBar1.Maximum = (int)(graphBuilder.Duration * 100.0); Text = fileName; //prepare and set the video window videoWin = graphBuilder as IVideoWindow; videoWin.Owner = (int)panel1.Handle; videoWin.WindowStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; Rectangle rc = panel1.ClientRectangle; videoWin.SetWindowPosition(0, 0, rc.Right, rc.Bottom); mediaEvt.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0); //set the different values for controls trackBar1.Value = 0; minutes = (int)graphBuilder.Duration / 60; seconds = (int)graphBuilder.Duration % 60; statusBar1.Panels[0].Text = "Duration: " + minutes.ToString("D2") + ":m" + seconds.ToString("D2") + ":s"; graphState = State.Playing; //start the playback mediaCtrl.Run(); } } catch( Exception ) { Text = "Error loading file"; }

          alpa shah

          A Offline
          A Offline
          AB7771
          wrote on last edited by
          #7

          What i had done is as follows: Create a user control. i have written all the above code in this class. and then created an object of this usercontrol in another form. and called the Run method from that form. it works perfect.

          Thanks & Regards, Pramod "Everyone is a genius at least once a year"

          A 1 Reply Last reply
          0
          • A AB7771

            What i had done is as follows: Create a user control. i have written all the above code in this class. and then created an object of this usercontrol in another form. and called the Run method from that form. it works perfect.

            Thanks & Regards, Pramod "Everyone is a genius at least once a year"

            A Offline
            A Offline
            alpa shah
            wrote on last edited by
            #8

            Ok..I'm trying this idea...but actually i'm new to c#. so can u please tell me that i've to build a dll of my old code and then use it to the new form?:(

            alpa shah

            A 1 Reply Last reply
            0
            • A alpa shah

              Ok..I'm trying this idea...but actually i'm new to c#. so can u please tell me that i've to build a dll of my old code and then use it to the new form?:(

              alpa shah

              A Offline
              A Offline
              AB7771
              wrote on last edited by
              #9

              u give me ur email id i will send u a sample app... i think that should be enough for u.

              Thanks & Regards, Pramod "Everyone is a genius at least once a year"

              A B 2 Replies Last reply
              0
              • A AB7771

                u give me ur email id i will send u a sample app... i think that should be enough for u.

                Thanks & Regards, Pramod "Everyone is a genius at least once a year"

                A Offline
                A Offline
                alpa shah
                wrote on last edited by
                #10

                I'm really thankful to you.... My mail id is "alpa_shah04@yahooo.com" and please give me your mail id also

                alpa shah

                A 1 Reply Last reply
                0
                • A AB7771

                  u give me ur email id i will send u a sample app... i think that should be enough for u.

                  Thanks & Regards, Pramod "Everyone is a genius at least once a year"

                  B Offline
                  B Offline
                  Blekk
                  wrote on last edited by
                  #11

                  Please may you send me the example code too, because I was reading into this, and would like to see how it works. My email is: gingermigit@hotmail.com Thankyou.

                  A 1 Reply Last reply
                  0
                  • A alpa shah

                    I'm really thankful to you.... My mail id is "alpa_shah04@yahooo.com" and please give me your mail id also

                    alpa shah

                    A Offline
                    A Offline
                    AB7771
                    wrote on last edited by
                    #12

                    Is ur id correct, the mail i sent u has bounced. i have also sent a request to add in yahoo. Please check that.

                    Thanks & Regards, Pramod "Everyone is a genius at least once a year"

                    1 Reply Last reply
                    0
                    • B Blekk

                      Please may you send me the example code too, because I was reading into this, and would like to see how it works. My email is: gingermigit@hotmail.com Thankyou.

                      A Offline
                      A Offline
                      AB7771
                      wrote on last edited by
                      #13

                      sure

                      Thanks & Regards, Pramod "Everyone is a genius at least once a year"

                      A 1 Reply Last reply
                      0
                      • A AB7771

                        sure

                        Thanks & Regards, Pramod "Everyone is a genius at least once a year"

                        A Offline
                        A Offline
                        alpa shah
                        wrote on last edited by
                        #14

                        ok note my ids: "alpa_shah04@yahoo.com" "alpashah04@gmail.com" egarly waiting for your reply...

                        alpa shah

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups