// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Runtime.InteropServices; namespace SharpDX.MediaFoundation { public partial class MediaEventGenerator { /// ///

Applies to: desktop apps | Metro style apps

Retrieves the next event in the queue. This method is synchronous.

///
/// true if the method blocks until the event generator queues an event, false otherwise. /// a reference to the interface. The caller must release the interface. /// ///

This method executes synchronously.

If the queue already contains an event, the method returns immediately. If the queue does not contain an event, the behavior depends on the value of dwFlags:

This method returns if you previously called and have not yet called .

///
/// ms704754 /// HRESULT IMFMediaEventGenerator::GetEvent([In] unsigned int dwFlags,[Out] IMFMediaEvent** ppEvent) /// IMFMediaEventGenerator::GetEvent public MediaEvent GetEvent(bool isBlocking) { MediaEvent mediaEvent; GetEvent(isBlocking ? 0 : 1, out mediaEvent); return mediaEvent; } /// ///

Applies to: desktop apps | Metro style apps

Begins an asynchronous request for the next event in the queue.

///
///

Pointer to the interface of a callback object. The client must implement this interface.

/// A reference to a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked. /// ///

When a new event is available, the event generator calls the method. The Invoke method should call to get a reference to the interface, and use that interface to examine the event.

Do not call BeginGetEvent a second time before calling EndGetEvent. While the first call is still pending, additional calls to the same object will fail. Also, the method fails if an asynchronous request is still pending.

///
/// ms701637 /// HRESULT IMFMediaEventGenerator::BeginGetEvent([In] IMFAsyncCallback* pCallback,[In] void* punkState) /// IMFMediaEventGenerator::BeginGetEvent public void BeginGetEvent(IAsyncCallback callback, object stateObject) { BeginGetEvent(callback, stateObject == null ? IntPtr.Zero : Marshal.GetIUnknownForObject(stateObject)); } } }