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 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite the Wpf control and version bump to 3.0.0 (#365)
New Wpf component using InteropBitmap Fixes #249
- Loading branch information
1 parent
eb6de92
commit 516cca3
Showing
20 changed files
with
591 additions
and
116 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
src/Vlc.DotNet.Core.Interops/VlcManager.SetVideoCallbacks.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,24 @@ | ||
using System; | ||
using Vlc.DotNet.Core.Interops.Signatures; | ||
|
||
namespace Vlc.DotNet.Core.Interops | ||
{ | ||
public sealed partial class VlcManager | ||
{ | ||
private LockVideoCallback _lockVideoCallbackReference; | ||
private UnlockVideoCallback _unlockVideoCallbackReference; | ||
private DisplayVideoCallback _displayVideoCallbackReference; | ||
|
||
public void SetVideoCallbacks(VlcMediaPlayerInstance mediaPlayerInstance, LockVideoCallback lockVideoCallback, UnlockVideoCallback unlockVideoCallback, DisplayVideoCallback displayVideoCallback, IntPtr userData) | ||
{ | ||
if (mediaPlayerInstance == IntPtr.Zero) | ||
throw new ArgumentException("Media player instance is not initialized."); | ||
|
||
this._lockVideoCallbackReference = lockVideoCallback; | ||
this._unlockVideoCallbackReference = unlockVideoCallback; | ||
this._displayVideoCallbackReference = displayVideoCallback; | ||
|
||
GetInteropDelegate<SetVideoCallbacks>().Invoke(mediaPlayerInstance, this._lockVideoCallbackReference, this._unlockVideoCallbackReference, this._displayVideoCallbackReference, userData); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Vlc.DotNet.Core.Interops/VlcManager.SetVideoFormatCallbacks.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,22 @@ | ||
using System; | ||
using Vlc.DotNet.Core.Interops.Signatures; | ||
|
||
namespace Vlc.DotNet.Core.Interops | ||
{ | ||
public sealed partial class VlcManager | ||
{ | ||
private VideoFormatCallback _videoFormatCallbackReference; | ||
private CleanupVideoCallback _cleanupCallbackReference; | ||
|
||
public void SetVideoFormatCallbacks(VlcMediaPlayerInstance mediaPlayerInstance, VideoFormatCallback videoFormatCallback, CleanupVideoCallback cleanupCallback) | ||
{ | ||
if (mediaPlayerInstance == IntPtr.Zero) | ||
throw new ArgumentException("Media player instance is not initialized."); | ||
|
||
this._videoFormatCallbackReference = videoFormatCallback; | ||
this._cleanupCallbackReference = cleanupCallback; | ||
|
||
GetInteropDelegate<SetVideoFormatCallbacks>().Invoke(mediaPlayerInstance, this._videoFormatCallbackReference, this._cleanupCallbackReference); | ||
} | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
src/Vlc.DotNet.Core.Interops/VlcMediaPlayerInstance.SetCallbacks.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/Vlc.DotNet.Core.Interops/VlcMediaPlayerInstance.SetFormatCallbacks.cs
This file was deleted.
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
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,56 @@ | ||
using Vlc.DotNet.Core.Interops.Signatures; | ||
|
||
namespace Vlc.DotNet.Core | ||
{ | ||
using System; | ||
|
||
public sealed partial class VlcMediaPlayer | ||
{ | ||
/// <summary> | ||
/// Sets the video callbacks to render decoded video to a custom area in memory. | ||
/// The media player will hold a reference on the IVideoCallbacks parameter | ||
/// </summary> | ||
/// <remarks> | ||
/// Rendering video into custom memory buffers is considerably less efficient than rendering in a custom window as normal. | ||
/// See libvlc_video_set_callbacks for detailed explanations | ||
/// </remarks> | ||
/// <param name="lockVideo"> | ||
/// Callback to lock video memory (must not be NULL) | ||
/// </param> | ||
/// <param name="unlockVideo"> | ||
/// Callback to unlock video memory (or NULL if not needed) | ||
/// </param> | ||
/// <param name="display"> | ||
/// Callback to display video (or NULL if not needed) | ||
/// </param> | ||
/// <param name="userData"> | ||
/// Private pointer for the three callbacks (as first parameter). | ||
/// This parameter will be overriden if <see cref="SetVideoFormatCallbacks"/> is used | ||
/// </param> | ||
public void SetVideoCallbacks(LockVideoCallback lockVideo, UnlockVideoCallback unlockVideo, DisplayVideoCallback display, IntPtr userData) | ||
{ | ||
if (lockVideo == null) | ||
{ | ||
throw new ArgumentNullException(nameof(lockVideo)); | ||
} | ||
|
||
this.Manager.SetVideoCallbacks(this.myMediaPlayerInstance, lockVideo, unlockVideo, display, userData); | ||
} | ||
|
||
/// <summary> | ||
/// Set decoded video chroma and dimensions. This only works in combination with | ||
/// <see cref="SetVideoCallbacks" /> | ||
/// </summary> | ||
/// <param name="videoFormat">Callback to select the video format (cannot be NULL)</param> | ||
/// <param name="cleanup">Callback to release any allocated resources (or NULL)</param> | ||
public void SetVideoFormatCallbacks(VideoFormatCallback videoFormat, CleanupVideoCallback cleanup) | ||
{ | ||
if (videoFormat == null) | ||
{ | ||
throw new ArgumentNullException(nameof(videoFormat)); | ||
} | ||
|
||
this.Manager.SetVideoFormatCallbacks(this.myMediaPlayerInstance, videoFormat, cleanup); | ||
} | ||
} | ||
} |
Oops, something went wrong.