LEADTOOLS Multimedia (Leadtools.Multimedia assembly)

MediaEventCode Enumeration

Show in webframe
ExampleExample 



Defines values used for media event reporting.
Syntax
'Declaration
 
Public Enum MediaEventCode 
   Inherits System.Enum
   Implements System.IComparableSystem.IConvertibleSystem.IFormattable 
'Usage
 
Dim instance As MediaEventCode
public enum class MediaEventCode : public System.Enum, System.IComparableSystem.IConvertibleSystem.IFormattable  
Members
ValueMemberDescription
0x00000001EC_COMPLETEIndicates the completed playback of a stream within the graph.
0x00000002EC_USERABORTIndicates that the user has requested that playback be terminated.
0x00000003EC_ERRORABORTOperation aborted because of error.
0x00000005EC_REPAINTIndicates that a repaint is required.
0x00000006EC_STREAM_ERROR_STOPPEDIndicates that a stream error occurs that stopped playback.
0x00000007EC_STREAM_ERROR_STILLPLAYINGIndicates that a stream error occurred, but playback has continued.
0x00000008EC_ERROR_STILLPLAYINGIndicates that an asynchronous run command was sent to the graph when the graph was already running.
0x00000009EC_PALETTE_CHANGEDIndicates that the video palette has changed.
0x0000000AEC_VIDEO_SIZE_CHANGEDIndicates that the video size has changed.
0x0000000BEC_QUALITY_CHANGEIndicates that playback quality degradation has occurred.
0x0000000CEC_SHUTTING_DOWNNotifies IMediaEventSink filters that the filter graph is preparing to shutdown.
0x0000000DEC_CLOCK_CHANGEDIndicates that the clock has changed.
0x0000000EEC_PAUSEDIndicates that the previous pause request has completed.
0x00000010EC_OPENING_FILEIndicates that a file is being opened.
0x00000011EC_BUFFERING_DATAIndicates that the filter graph is buffering data.
0x00000012EC_FULLSCREEN_LOSTIndicates that full screen mode was toggled off.
0x00000013EC_ACTIVATEIndicates that a video renderer has lost or gained activation.
0x00000014EC_NEED_RESTARTIndicates that a renderer has regained a resource and the graph will be restarted.
0x00000015EC_WINDOW_DESTROYEDIndicates that a video window for a video renderer has been destroyed.
0x00000016EC_DISPLAY_CHANGEDIndicates that a video renderer has detected a display change.
0x00000018EC_OLE_EVENTIndicates that the filter is sending a text string to the application. This is useful for detecting Windows Media Script events that were added with the WMScript object. For Windows Media Script events, param1 is a BSTR containing the command name while param2 is a BSTR containing the command string.
0x00000019EC_NOTIFY_WINDOWIndicates that the window handle is being passed to a filter.
0x0000001AEC_STREAM_CONTROL_STOPPEDIndicates that an earlier call to IAMStreamControl.StopAt has now taken effect.
0x0000001BEC_STREAM_CONTROL_STARTEDIndicates that an earlier call to IAMStreamControl.StartAt has now taken effect.
0x0000001CEC_END_OF_SEGMENTIndicates that a segment end has been reached.
0x0000001DEC_SEGMENT_STARTEDIndicates that a segment start has been reached.
0x0000001EEC_LENGTH_CHANGEDIndicates that the length of the "file" has changed.
0x0000001FEC_DEVICE_LOSTIndicates that a device has been lost, see IAMDeviceRemoval interface for more information.
0x00000020EC_SAMPLE_NEEDEDIndicates that a sample is needed on the specified input pin.
0x00000022EC_SAMPLE_LATENCYIndicates that the filter is the specified amount of time behind or ahead in processing incoming samples.
0x00000023EC_SCRUB_TIMEIndicates the timestamp for the sample frame displayed after an EC_STEP_COMPLETE notification.
0x00000024EC_STEP_COMPLETEIndicates that a step request has completed or was cancelled.
0x00000025EC_SKIP_FRAMESIndicates to the filter graph to skip some frames and notify.
0x00000030EC_TIMECODE_AVAILABLEIndicates that a filter has timecodes available.
0x00000031EC_EXTDEVICE_MODE_CHANGEIndicates that a filter supporting the IAMExtDevice interface has detected a device mode change.
0x00000032EC_STATE_CHANGEIndicates state changes in the filter graph.
0x00000040EC_PLEASE_REOPENIndicates that changes have been made that require a graph to be re-rendered.
0x00000041EC_STATUSIndicates that a filter is sending status message strings.
0x00000042EC_MARKER_HITIndicates that the specified "marker #" has just been passed.
0x00000043EC_LOADSTATUSThis event is sent by certain filters to indicate the progress of a load operation. In particular, the LEAD MPEG-2 Transport Demultiplexer sends this when it is added to a graph. Intercept this event notification to instruct the MPEG-2 Transport Demultiplexer which streams to consider to be important. You can mark certain streams as unimportant in order to speed up graph building. See the comments section below for more details.
0x00000044EC_FILE_CLOSEDIndicates that a file was involuntarily closed, i.e. by a network server shutdown.
0x00000045EC_ERRORABORTEXIndicates that an operation aborted because of error.
0x00000046EC_EOS_SOONIndicates that the source filter is about to deliver an EOS downstream.
0x00000047EC_CONTENTPROPERTY_CHANGEDIndicates that a streaming media filter received a change in stream description information.
0x00000048EC_BANDWIDTHCHANGEIndicates that the bandwidth of the streaming data has changed.
0x00000049EC_VIDEOFRAMEREADYIndicates that the first video frame is about to be drawn.
0x00000050EC_GRAPH_CHANGEDIndicates that the filter graph has changed.
0x00000051EC_CLOCK_UNSETIndicates to the filter graph to unset the current graph clock.
0x00000053EC_VMR_RENDERDEVICE_SETIndicates the type of rendering mechanism the VMR is using to display video.
0x00000054EC_VMR_SURFACE_FLIPPEDIndicates that the VMR's allocator-presenter has called the DDraw flip API on the surface being presented.
0x00000055EC_VMR_RECONNECTION_FAILEDIndicates that an upstream decoder tried to perform a dynamic format change and the VMR was unable to accept the new format.
0x00000057EC_CODECAPI_EVENTIndicates that the Codec API event was encountered.
0x00000101EC_DVD_DOMAIN_CHANGEThe DVD domain is changed.
0x00000102EC_DVD_TITLE_CHANGEThe DVD current title has changed.
0x00000103EC_DVD_CHAPTER_STARTThe player has started playing a new chapter The name for each individual video file on a DVD.
0x00000104EC_DVD_AUDIO_STREAM_CHANGEThe audio stream The portion of the file holding the audio data.
0x00000105EC_DVD_SUBPICTURE_STREAM_CHANGEThe DVD sub-picture stream number has changed.
0x00000106EC_DVD_ANGLE_CHANGEThe number of available angles is changed or the current angle number is changed.
0x00000107EC_DVD_BUTTON_CHANGEThe number of available buttons is changed or the currently selected button number is changed.
0x00000108EC_DVD_VALID_UOPS_CHANGEThe available set of DVDControl interface methods has changed.
0x0000010BEC_DVD_CURRENT_TIMEThe beginning of every video object unit, a video segment that is 0.
0x0000010CEC_DVD_ERRORA DVD error condition.
0x0000010DEC_DVD_WARNINGA DVD warning condition.
0x0000010EEC_DVD_CHAPTER_AUTOSTOPPlayback is stopped as a result of a call to the DVDControl.
0x00000110EC_DVD_PLAYBACK_RATE_CHANGEA rate change in the playback has been initiated; the parameter Param1 indicates the new playback rate being used.
0x00000111EC_DVD_PARENTAL_LEVEL_CHANGEThe parental level of the authored content is about to change.
0x00000112EC_DVD_PLAYBACK_STOPPEDPlayback has been stopped. See DVDPlaybackStopped enumeration for possible stop reason codes passed in param1 of the MediaEventArgs object.
0x00000113EC_DVD_ANGLES_AVAILABLEIndicates whether an angle block is being played and angle changes can be performed.
0x00000114EC_DVD_PLAYPERIOD_AUTOSTOPThe Navigator has finished playing the segment specified in a call to DVDControl.
0x00000115EC_DVD_BUTTON_AUTO_ACTIVATEDA menu button has been automatically activated per instructions on the disc.
0x00000116EC_DVD_CMD_STARTA command has begun.
0x00000117EC_DVD_CMD_ENDA command has completed.
0x00000118EC_DVD_DISC_EJECTEDA disc was ejected.
0x00000119EC_DVD_DISC_INSERTEDA disc was inserted.
0x0000011AEC_DVD_CURRENT_HMSF_TIMEThe beginning of every video object unit, a video segment that is 0.
0x0000011BEC_DVD_KARAOKE_MODEThe Navigator has either begun playing or finished playing karaoke data.
0x00000251EC_WMT_INDEX_EVENTIndicates that Windows Media indexing event has occurred.
0x00000252EC_WMT_EVENTIndicates that a Windows Media event has occurred.
0x00000300EC_BUILTThis event is sent when a graph has been built.
0x00000301EC_UNBUILTThis event is sent when a graph has been torn down.
Remarks

For more information, refer to the Microsoft documentation for the Event Notification and DVD Event Notification Codes.

The LEAD MPEG-2 Transport Demultiplexer sends the EC_LOADSTATUS and sets lParam1 to ltmmAM_LOADSTATUS_PROGRAM_PACKET_RECEIVED (0x100) to signal that it has been added to the graph. This event is sent while the graph is being built and you have the option to instruct the demultiplexer to not wait until it receives data from streams that you don't consider important. For example, if the speed with which the graph is built is more important to you than playing the audio stream, you can instruct the demultiplexer that the audio stream is not important and that you want to start playing the graph as soon as the video stream has been identified. This can speed up the playback in situations in which certain streams have packets that occur at rare intervals. By default, the demultiplexer will wait until it identifies all important streams so if the audio stream is signaled as present but the audio packets are never received, the graph might wait a long time for audio packets that will never come. If you receive EC_LOADSTATUS but lParam1 is not set to AM_LOADSTATUS_PROGRAM_PACKET_RECEIVED, then the event was not sent by the LEAD MPEG-2 Transport Demultiplexer.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Multimedia
Imports LeadtoolsMultimediaExamples.Fixtures

Public _result As Boolean = False
Public _form As PlayCtrlForm = New PlayCtrlForm()
Public Sub SourceStreamExample()
   ' reference the play control
   Dim playctrl As PlayCtrl = _form.PlayCtrl

   ' input and output file names
   Dim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")

   Try
      ' turn off auto start
      playctrl.AutoStart = False

      ' subscribe to the complete event to check our result
      AddHandler playctrl.MediaEvent, AddressOf PlayCtrl_MediaEvent

      ' set the source stream
      playctrl.SourceStream = New StreamReader(inFile).BaseStream

      ' set the allowed streams
      playctrl.AllowedStreams = StreamFormatType.AudioVideoCC

      ' play it!
      playctrl.Run()
   Catch e1 As Exception
      _result = False
   End Try

   ' we'll loop on the state and pump messages for this example.
   ' but you should not need to if running from a Windows Forms application.
   Do While playctrl.State = PlayState.Running
      Application.DoEvents()
   Loop
End Sub

Private Sub PlayCtrl_MediaEvent(ByVal sender As Object, ByVal e As MediaEventArgs)
   ' set the result
   If e.eventCode = MediaEventCode.EC_COMPLETE Then
      _result = True
   End If
End Sub

Public NotInheritable Class LEAD_VARS
Public Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media"
End Class
using Leadtools;
using Leadtools.Multimedia;
using LeadtoolsMultimediaExamples.Fixtures;

public bool _result = false;
public PlayCtrlForm _form = new PlayCtrlForm();
public void SourceStreamExample()
{
   // reference the play control
   PlayCtrl playctrl = _form.PlayCtrl;

   // input and output file names
   string inFile = Path.Combine(LEAD_VARS.MediaDir,"PlayCtrl_Source.avi");

   try
   {
      // turn off auto start
      playctrl.AutoStart = false;

      // subscribe to the complete event to check our result
      playctrl.MediaEvent += new MediaEventHandler(PlayCtrl_MediaEvent);

      // set the source stream
      playctrl.SourceStream = new StreamReader(inFile).BaseStream;

      // set the allowed streams
      playctrl.AllowedStreams = StreamFormatType.AudioVideoCC;

      // play it!
      playctrl.Run();
   }
   catch (Exception)
   {
      _result = false;
   }

   // we'll loop on the state and pump messages for this example.
   // but you should not need to if running from a Windows Forms application.
   while (playctrl.State == PlayState.Running)
      Application.DoEvents();
}

void PlayCtrl_MediaEvent(object sender, MediaEventArgs e)
{
   // set the result
   if (e.eventCode == MediaEventCode.EC_COMPLETE)
      _result = true;
}

static class LEAD_VARS
{
public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media";
}
Imports Leadtools
Imports Leadtools.Multimedia
Imports LeadtoolsMultimediaExamples.Fixtures

Public _result As Boolean = False
Public _form As New PlayCtrlForm()
Public Sub HandleScriptExample()
   Dim playctrl As PlayCtrl = _form.PlayCtrl
   Dim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "WriteScriptStream_Dest.wmv")

   Try
      AddHandler playctrl.MediaEvent, AddressOf PlayCtrl_MediaEvent

      playctrl.SourceFile = inFile
   Catch generatedExceptionName As Exception
      Exit Sub
   End Try

   ' we'll loop on the state and pump messages for this example.
   ' but you should not need to if running from a Windows Forms application.
   While playctrl.State = PlayState.Running
      Application.DoEvents()
   End While
End Sub

Public Sub PlayCtrl_MediaEvent(ByVal sender As Object, ByVal e As MediaEventArgs)
   If (e.eventCode = MediaEventCode.EC_OLE_EVENT) Then
      Dim nameString As String = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(New IntPtr(e.param1))
      Dim commandString As String = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(New IntPtr(e.param2))
      Console.WriteLine("EC_OLE_EVENT: name={0}, command={1}", nameString, commandString)
      _result = True
   End If
End Sub

Public NotInheritable Class LEAD_VARS
Public Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media"
End Class
using Leadtools;
using Leadtools.Multimedia;
using LeadtoolsMultimediaExamples.Fixtures;

public bool _result = false;
public PlayCtrlForm _form = new PlayCtrlForm();
public void HandleScriptExample()
{
   PlayCtrl playctrl = _form.PlayCtrl;
   string inFile = Path.Combine(LEAD_VARS.MediaDir,"WriteScriptStream_Dest.wmv");

   try
   {
      playctrl.MediaEvent += new MediaEventHandler(PlayCtrl_MediaEvent);

      playctrl.SourceFile = inFile;
   }
   catch (Exception)
   {
      return;
   }

   // we'll loop on the state and pump messages for this example.
   // but you should not need to if running from a Windows Forms application.
   while (playctrl.State == PlayState.Running)
      Application.DoEvents();
}

public void PlayCtrl_MediaEvent(object sender, MediaEventArgs e)
{
   if (e.eventCode == MediaEventCode.EC_OLE_EVENT)
   {
      string nameString = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(new IntPtr(e.param1));
      string commandString = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(new IntPtr(e.param2));
      Console.WriteLine("EC_OLE_EVENT: name={0}, command={1}", nameString, commandString);
      _result = true;
   }
}

static class LEAD_VARS
{
public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 18\Media";
}
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Leadtools.Multimedia.MediaEventCode

Requirements

Target Platforms

See Also

Reference

Leadtools.Multimedia Namespace

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Multimedia requires a Multimedia or Multimedia Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features