This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from microchi/master
Add Get/Set Video Aspect Ratio With Sample
- Loading branch information
Showing
13 changed files
with
170 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...lc.DotNet.Core.Interops/Signatures/libvlc_media_player.h/libvlc_video_get_aspect_ratio.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Vlc.DotNet.Core.Interops.Signatures | ||
{ | ||
/// <summary> | ||
/// Get current crop filter geometry. | ||
/// </summary> | ||
[LibVlcFunction("libvlc_video_get_aspect_ratio")] | ||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate IntPtr GetVideoAspectRatio(IntPtr mediaPlayerInstance); | ||
} |
12 changes: 12 additions & 0 deletions
12
...lc.DotNet.Core.Interops/Signatures/libvlc_media_player.h/libvlc_video_set_aspect_ratio.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Vlc.DotNet.Core.Interops.Signatures | ||
{ | ||
/// <summary> | ||
/// Set current crop filter geometry. | ||
/// </summary> | ||
[LibVlcFunction("libvlc_video_set_aspect_ratio")] | ||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate void SetVideoAspectRatio(IntPtr mediaPlayerInstance, IntPtr cropGeometry); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Vlc.DotNet.Core.Interops/VlcManager.GetVideoAspectRatio.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using Vlc.DotNet.Core.Interops.Signatures; | ||
|
||
namespace Vlc.DotNet.Core.Interops | ||
{ | ||
public sealed partial class VlcManager | ||
{ | ||
public string GetVideoAspectRatio(VlcMediaPlayerInstance mediaPlayerInstance) | ||
{ | ||
if (mediaPlayerInstance == IntPtr.Zero) | ||
throw new ArgumentException("Media player instance is not initialized."); | ||
#if NET20 | ||
return IntPtrExtensions.ToStringAnsi(GetInteropDelegate<GetVideoAspectRatio>().Invoke(mediaPlayerInstance)); | ||
#else | ||
return GetInteropDelegate<GetVideoAspectRatio>().Invoke(mediaPlayerInstance).ToStringAnsi(); | ||
#endif | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Vlc.DotNet.Core.Interops/VlcManager.SetVideoAspectRatio.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using Vlc.DotNet.Core.Interops.Signatures; | ||
|
||
namespace Vlc.DotNet.Core.Interops | ||
{ | ||
public sealed partial class VlcManager | ||
{ | ||
public void SetVideoAspectRatio(VlcMediaPlayerInstance mediaPlayerInstance, string cropGeometry) | ||
{ | ||
if (mediaPlayerInstance == IntPtr.Zero) | ||
throw new ArgumentException("Media player instance is not initialized."); | ||
#if NET20 | ||
GetInteropDelegate<SetVideoAspectRatio>().Invoke(mediaPlayerInstance, StringExtensions.ToHGlobalAnsi(cropGeometry)); | ||
#else | ||
GetInteropDelegate<SetVideoAspectRatio>().Invoke(mediaPlayerInstance, cropGeometry.ToHGlobalAnsi()); | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters