Commit 46109c23 authored by Martin Finkel's avatar Martin Finkel

cleanup. bindings on C sort of working. WIP

parent a42bc2e5
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using libvlc;
namespace Sample
{
public class Instance
{
private LibvlcInstanceT _instance;
public Instance(int argc, string[] args)
{
unsafe
{
if (args == null || !args.Any())
_instance = libvlc.libvlc.LibvlcNew(argc, null);
else
{
fixed (byte* arg0 = Encoding.ASCII.GetBytes(args[0]),
arg1 = Encoding.ASCII.GetBytes(args[1]),
arg2 = Encoding.ASCII.GetBytes(args[2]))
{
sbyte*[] arr = { (sbyte*)arg0, (sbyte*)arg1, (sbyte*)arg2 };
fixed (sbyte** argv = arr)
{
_instance = libvlc.libvlc.LibvlcNew(argc, argv);
}
}
}
}
}
public LibvlcInstanceT NativeReference => _instance;
}
}
using System;
using libvlc;
namespace Sample
{
class Program
{
static void Main(string[] args)
{
var instance = new Instance(0, null);
var media = libvlc_media.LibvlcMediaNewLocation(instance.NativeReference,
"http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4");
var mediaPlayer = libvlc_media_player.LibvlcMediaPlayerNewFromMedia(media);
libvlc_media_player.LibvlcMediaPlayerPlay(mediaPlayer);
Console.ReadKey();
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sample")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fa6cfa75-231b-4643-b82a-f88a08f0f3f9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Sample</RootNamespace>
<AssemblyName>Sample</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp.Runtime">
<HintPath>..\..\CppSharp\build\vs2017\lib\Release_x86\CppSharp.Runtime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Instance.cs" />
<Compile Include="libvlc.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
This diff is collapsed.
......@@ -5,22 +5,52 @@ VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libvlcsharp", "libvlcsharp\libvlcsharp.csproj", "{22AD1787-F35D-40C6-AEDF-03D4F9728117}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|ARM.ActiveCfg = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|ARM.Build.0 = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|x64.ActiveCfg = Debug|x64
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|x64.Build.0 = Debug|x64
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|x86.ActiveCfg = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Debug|x86.Build.0 = Debug|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|Any CPU.Build.0 = Release|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|ARM.ActiveCfg = Release|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|ARM.Build.0 = Release|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|x64.ActiveCfg = Release|x64
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|x64.Build.0 = Release|x64
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|x86.ActiveCfg = Release|Any CPU
{22AD1787-F35D-40C6-AEDF-03D4F9728117}.Release|x86.Build.0 = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|ARM.Build.0 = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|x64.ActiveCfg = Debug|x64
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|x64.Build.0 = Debug|x64
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|x86.ActiveCfg = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Debug|x86.Build.0 = Debug|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|Any CPU.Build.0 = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|ARM.ActiveCfg = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|ARM.Build.0 = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|x64.ActiveCfg = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|x64.Build.0 = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|x86.ActiveCfg = Release|Any CPU
{FA6CFA75-231B-4643-B82A-F88A08F0F3F9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using CppSharp;
using CppSharp.AST;
using CppSharp.AST.Extensions;
using CppSharp.Generators;
using CppSharp.Parser;
using CppSharp.Passes;
using CppSharp.Types;
using Type = CppSharp.AST.Type;
using ASTContext = CppSharp.AST.ASTContext;
namespace libvlcsharp
{
......@@ -18,103 +12,62 @@ namespace libvlcsharp
{
static void Main(string[] args)
{
try
{
ConsoleDriver.Run(new LibVLC());
Console.ReadKey();
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
ConsoleDriver.Run(new LibVLC());
//Console.ReadKey();
}
class LibVLC : ILibrary
{
public void Preprocess(Driver driver, ASTContext ctx)
{
//ctx.IgnoreHeadersWithName("libvlc_events.h");
ctx.FindClass("VaCopy").First().Ignore = true;
ctx.TranslationUnits.FirstOrDefault(tu => tu.FileName == "libvlc_events.h").Ignore = true;
//ctx.TranslationUnits.FirstOrDefault(tu => tu.FileName == "libvlc_events.h").ExplicitlyIgnore();
//ctx.TranslationUnits.FirstOrDefault(tu => tu.FileName == "libvlc_events.h").GenerationKind = GenerationKind.None;
}
public void Postprocess(Driver driver, ASTContext ctx)
{
//ctx.SetClassAsValueType("VaCopy");
var ctorsToFix = new List<IEnumerable<Method>>
{
ctx.FindClass("MediaPlayer").First().Constructors,
ctx.FindClass("Media").First().Constructors,
ctx.FindClass("MediaList").First().Constructors,
ctx.FindClass("MediaListPlayer").First().Constructors,
ctx.FindClass("MediaLibrary").First().Constructors
};
foreach (var ctors in ctorsToFix)
{
FixCtorParamNameHack(ctors);
}
}
private void FixCtorParamNameHack(IEnumerable<Method> ctors)
{
foreach (var ctor in ctors)
{
for (var i = 0; i < ctor.Parameters.Count; i++)
{
ctor.Parameters[i].Name = ctor.Parameters[i].Name + i;
}
}
// FIXME
ctx.IgnoreHeadersWithName("libvlc_events.h");
}
public void Setup(Driver driver)
{
var rootPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName;
var libvlcppHeaders = Path.Combine(rootPath, "include\\libvlcpp");
var libvlcHeaders = Path.Combine(rootPath, "include\\libvlcpp\\vlc");
var libvlcPluginsHeaders = Path.Combine(rootPath, "include\\libvlcpp\\vlc\\plugins");
var libvlcHeaders = Path.Combine(rootPath, "include\\vlc");
var libvlcPluginsHeaders = Path.Combine(rootPath, "include\\vlc\\plugins");
var h = Path.Combine(rootPath, "include");
var libFolder = Path.Combine(rootPath, "include\\lib");
driver.ParserOptions = new ParserOptions
{
IncludeDirs = new List<string> {libvlcppHeaders},
LibraryDirs = new List<string> {libFolder},
LibraryFile = "libvlcpp",
//Verbose = true,
EnableRTTI = true,
Arguments = new List<string> {"-fcxx-exceptions"},
LanguageVersion = LanguageVersion.CPP14,
//SystemIncludeDirs = new List<string> { "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503" }
IncludeDirs = new List<string> { libvlcHeaders, libvlcPluginsHeaders, h },
Verbose = true
};
var options = driver.Options;
options.GeneratorKind = GeneratorKind.CSharp;
options.CompileCode = true;
options.CheckSymbols = true;
options.OutputDir = Path.Combine(rootPath, "..\\Sample\\");
var module = options.AddModule("libvlcsharp");
module.IncludeDirs.AddRange(new[] {libvlcppHeaders});
module.Headers.Add("vlc.hpp");
var module = options.AddModule("libvlc");
module.Headers.Add("vlc.h");
//module.Libraries.Add("libvlc.dll");
//module.SharedLibraryName = "libvlc";
//module.SymbolsLibraryName = "libvlc";
//module.LibraryName = "libvlc";
//module.LibraryDirs.Add(Path.Combine(rootPath, "..\\Sample\\bin\\Debug\\"));
module.LibraryDirs.Add(libFolder);
module.Libraries.AddRange(new[] {"libvlc.lib", "libvlccore.lib"});
module.Libraries.Add("libvlc.dll");
module.Libraries.AddRange(new[] { "libvlc.lib", "libvlccore.lib" });
}
public void SetupPasses(Driver driver)
{
//driver.Context.TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
//driver.Context.TranslationUnitPasses.AddPass(new MarshalPrimitivePointersAsRefTypePass());
//driver.Context.TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
//driver.Context.TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
//driver.Context.TranslationUnitPasses.RenameDeclsUpperCase(RenameTargets.Any);
//driver.Context.TranslationUnitPasses.AddPass(new FunctionToInstanceMethodPass());
//driver.Context.TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
//driver.Context.TranslationUnitPasses.AddPass(new StripUnusedSystemTypesPass());
//driver.Context.TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());
//driver.Context.TranslationUnitPasses.AddPass(new FieldToPropertyPass());
}
}
}
......
/*****************************************************************************
* libvlc_events.h: libvlc_events external API structure
*****************************************************************************
* Copyright (C) 1998-2010 VLC authors and VideoLAN
* $Id $
*
* Authors: Filippo Carone <littlejohn@videolan.org>
* Pierre d'Herbemont <pdherbemont@videolan.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LIBVLC_EVENTS_H
#define LIBVLC_EVENTS_H 1
/**
* \file
* This file defines libvlc_event external API
*/
# ifdef __cplusplus
extern "C" {
# endif
typedef struct libvlc_renderer_item_t libvlc_renderer_item_t;
/**
* \ingroup libvlc_event
* @{
*/
/**
* Event types
*/
enum libvlc_event_e {
/* Append new event types at the end of a category.
* Do not remove, insert or re-order any entry.
* Keep this in sync with lib/event.c:libvlc_event_type_name(). */
libvlc_MediaMetaChanged=0,
libvlc_MediaSubItemAdded,
libvlc_MediaDurationChanged,
libvlc_MediaParsedChanged,
libvlc_MediaFreed,
libvlc_MediaStateChanged,
libvlc_MediaSubItemTreeAdded,
libvlc_MediaPlayerMediaChanged=0x100,
libvlc_MediaPlayerNothingSpecial,
libvlc_MediaPlayerOpening,
libvlc_MediaPlayerBuffering,
libvlc_MediaPlayerPlaying,
libvlc_MediaPlayerPaused,
libvlc_MediaPlayerStopped,
libvlc_MediaPlayerForward,
libvlc_MediaPlayerBackward,
libvlc_MediaPlayerEndReached,
libvlc_MediaPlayerEncounteredError,
libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerPositionChanged,
libvlc_MediaPlayerSeekableChanged,
libvlc_MediaPlayerPausableChanged,
libvlc_MediaPlayerTitleChanged,
libvlc_MediaPlayerSnapshotTaken,
libvlc_MediaPlayerLengthChanged,
libvlc_MediaPlayerVout,
libvlc_MediaPlayerScrambledChanged,
libvlc_MediaPlayerESAdded,
libvlc_MediaPlayerESDeleted,
libvlc_MediaPlayerESSelected,
libvlc_MediaPlayerCorked,
libvlc_MediaPlayerUncorked,
libvlc_MediaPlayerMuted,
libvlc_MediaPlayerUnmuted,
libvlc_MediaPlayerAudioVolume,
libvlc_MediaPlayerAudioDevice,
libvlc_MediaPlayerChapterChanged,
libvlc_MediaListItemAdded=0x200,
libvlc_MediaListWillAddItem,
libvlc_MediaListItemDeleted,
libvlc_MediaListWillDeleteItem,
libvlc_MediaListEndReached,
libvlc_MediaListViewItemAdded=0x300,
libvlc_MediaListViewWillAddItem,
libvlc_MediaListViewItemDeleted,
libvlc_MediaListViewWillDeleteItem,
libvlc_MediaListPlayerPlayed=0x400,
libvlc_MediaListPlayerNextItemSet,
libvlc_MediaListPlayerStopped,
/**
* \deprecated Useless event, it will be triggered only when calling
* libvlc_media_discoverer_start()
*/
libvlc_MediaDiscovererStarted=0x500,
/**
* \deprecated Useless event, it will be triggered only when calling
* libvlc_media_discoverer_stop()
*/
libvlc_MediaDiscovererEnded,
libvlc_RendererDiscovererItemAdded,
libvlc_RendererDiscovererItemDeleted,
libvlc_VlmMediaAdded=0x600,
libvlc_VlmMediaRemoved,
libvlc_VlmMediaChanged,
libvlc_VlmMediaInstanceStarted,
libvlc_VlmMediaInstanceStopped,
libvlc_VlmMediaInstanceStatusInit,
libvlc_VlmMediaInstanceStatusOpening,
libvlc_VlmMediaInstanceStatusPlaying,
libvlc_VlmMediaInstanceStatusPause,
libvlc_VlmMediaInstanceStatusEnd,
libvlc_VlmMediaInstanceStatusError
};
/**
* A LibVLC event
*/
typedef struct libvlc_event_t
{
int type; /**< Event type (see @ref libvlc_event_e) */
void *p_obj; /**< Object emitting the event */
union
{
/* media descriptor */
struct
{
libvlc_meta_t meta_type;
} media_meta_changed;
struct
{
libvlc_media_t * new_child;
} media_subitem_added;
struct
{
int64_t new_duration;
} media_duration_changed;
struct
{
int new_status; /**< see @ref libvlc_media_parsed_status_t */
} media_parsed_changed;
struct
{
libvlc_media_t * md;
} media_freed;
struct
{
int new_state; /**< see @ref libvlc_state_t */
} media_state_changed;
struct
{
libvlc_media_t * item;
} media_subitemtree_added;
/* media instance */
struct
{
float new_cache;
} media_player_buffering;
struct
{
int new_chapter;
} media_player_chapter_changed;
struct
{
float new_position;
} media_player_position_changed;
struct
{
libvlc_time_t new_time;
} media_player_time_changed;
struct
{
int new_title;
} media_player_title_changed;
struct
{
int new_seekable;
} media_player_seekable_changed;
struct
{
int new_pausable;
} media_player_pausable_changed;
struct
{
int new_scrambled;
} media_player_scrambled_changed;
struct
{
int new_count;
} media_player_vout;
/* media list */
struct
{
libvlc_media_t * item;
int index;
} media_list_item_added;
struct
{
libvlc_media_t * item;
int index;
} media_list_will_add_item;
struct