Merge branch '3d-2.0' of http://gitea.umayle.com/huangjiayu/Test-TaizhouWarehousePhaseII into 3d-2.0
This commit is contained in:
commit
fa3a5df6fe
|
|
@ -2146,8 +2146,8 @@ namespace HighlightPlus {
|
||||||
fxMat.mainTexture = matTexture;
|
fxMat.mainTexture = matTexture;
|
||||||
fxMat.mainTextureOffset = matTextureOffset;
|
fxMat.mainTextureOffset = matTextureOffset;
|
||||||
fxMat.mainTextureScale = matTextureScale;
|
fxMat.mainTextureScale = matTextureScale;
|
||||||
//}
|
|
||||||
// if (!Application.isMobilePlatform) { // TODO: currently this does not work with URP on Android
|
|
||||||
if ((glow > 0 && glowQuality == QualityLevel.Highest && glowVisibility == Visibility.Normal) || (outline > 0 && outlineQuality == QualityLevel.Highest && outlineVisibility == Visibility.Normal)) {
|
if ((glow > 0 && glowQuality == QualityLevel.Highest && glowVisibility == Visibility.Normal) || (outline > 0 && outlineQuality == QualityLevel.Highest && outlineVisibility == Visibility.Normal)) {
|
||||||
fxMat.EnableKeyword(ShaderParams.SKW_DEPTHCLIP);
|
fxMat.EnableKeyword(ShaderParams.SKW_DEPTHCLIP);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace RenderHeads.Media.AVProVideo.Demos.UI
|
||||||
_segments = new float[] { 0f, 0f };
|
_segments = new float[] { 0f, 0f };
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: detect whether a change actually occured before setting to dirty
|
|
||||||
SetVerticesDirty();
|
SetVerticesDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ namespace RenderHeads.Media.AVProVideo.Demos
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: instead of activating the first one, base it on the language/track
|
|
||||||
// selection stored in the MediaPlayerUI
|
// selection stored in the MediaPlayerUI
|
||||||
_mediaPlayer.TextTracks.SetActiveTextTrack(_mediaPlayer.TextTracks.GetTextTracks()[0]);
|
_mediaPlayer.TextTracks.SetActiveTextTrack(_mediaPlayer.TextTracks.GetTextTracks()[0]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -419,7 +419,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
|
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
|
||||||
GL.sRGBWrite = originalSRGBWrite;
|
GL.sRGBWrite = originalSRGBWrite;
|
||||||
}
|
}
|
||||||
// TODO: OnDisable - stop the video if it's playing (and unload it?)
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
|
|
||||||
private void OnInspectorGUI_SelectPlatform()
|
private void OnInspectorGUI_SelectPlatform()
|
||||||
{
|
{
|
||||||
// TODO: support multiple targets?
|
|
||||||
MediaPlayer media = (this.target) as MediaPlayer;
|
MediaPlayer media = (this.target) as MediaPlayer;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
{
|
{
|
||||||
if (texture != EditorGUIUtility.whiteTexture)
|
if (texture != EditorGUIUtility.whiteTexture)
|
||||||
{
|
{
|
||||||
// TODO: In Linear mode, this displays the texture too bright, but GUI.DrawTexture displays it correctly
|
|
||||||
//GL.sRGBWrite = true;
|
//GL.sRGBWrite = true;
|
||||||
//GUI.DrawTexture(textureRect, rt, ScaleMode.ScaleToFit, false);
|
//GUI.DrawTexture(textureRect, rt, ScaleMode.ScaleToFit, false);
|
||||||
|
|
||||||
|
|
@ -751,7 +751,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
{
|
{
|
||||||
if (!_showAlpha)
|
if (!_showAlpha)
|
||||||
{
|
{
|
||||||
// TODO: In Linear mode, this displays the texture too bright, but GUI.DrawTexture displays it correctly
|
|
||||||
EditorGUI.DrawTextureTransparent(textureRect, texture, ScaleMode.ScaleToFit);
|
EditorGUI.DrawTextureTransparent(textureRect, texture, ScaleMode.ScaleToFit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
newUrl = newUrl.Trim();
|
newUrl = newUrl.Trim();
|
||||||
if (EditorHelper.SafeSetPathProperty(newUrl, propPath))
|
if (EditorHelper.SafeSetPathProperty(newUrl, propPath))
|
||||||
{
|
{
|
||||||
// TODO: shouldn't we set all targets?
|
|
||||||
EditorUtility.SetDirty(property.serializedObject.targetObject);
|
EditorUtility.SetDirty(property.serializedObject.targetObject);
|
||||||
}
|
}
|
||||||
MediaPlayerEditor.ShowFileWarningMessages(propPath.stringValue, (MediaPathType)propPathType.enumValueIndex, null, MediaSource.Path, false, Platform.Unknown);
|
MediaPlayerEditor.ShowFileWarningMessages(propPath.stringValue, (MediaPathType)propPathType.enumValueIndex, null, MediaSource.Path, false, Platform.Unknown);
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ namespace RenderHeads.Media.AVProVideo.Editor
|
||||||
string path = items[i];
|
string path = items[i];
|
||||||
// Slashes in path must be replaced as they cause the menu to create submenuts
|
// Slashes in path must be replaced as they cause the menu to create submenuts
|
||||||
string itemName = ReplaceSlashes(path);
|
string itemName = ReplaceSlashes(path);
|
||||||
// TODO: shorten if itemName too long
|
|
||||||
if (System.IO.File.Exists(path))
|
if (System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
menu.AddItem(new GUIContent(prefix + itemName), false, Callback_Select, new RecentMenuItemData(path, propPath, propMediaSource, autoLoadMedia));
|
menu.AddItem(new GUIContent(prefix + itemName), false, Callback_Select, new RecentMenuItemData(path, propPath, propMediaSource, autoLoadMedia));
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
LateUpdate();
|
LateUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// TODO: remove this, we're just doing this so we can make sure texture is correct when running in EDIT mode
|
|
||||||
LateUpdate();
|
LateUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -419,7 +419,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
|
|
||||||
if (material != null && _mediaPlayer != null)
|
if (material != null && _mediaPlayer != null)
|
||||||
{
|
{
|
||||||
// TODO: only run when dirty
|
|
||||||
VideoRender.SetupMaterialForMedia(materialForRendering, _mediaPlayer);
|
VideoRender.SetupMaterialForMedia(materialForRendering, _mediaPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
// TODO: Currently we need to call this each frame, as when it is called right after SetText()
|
|
||||||
// the ContentSizeFitter hasn't run yet, so effectively the box is a frame behind.
|
// the ContentSizeFitter hasn't run yet, so effectively the box is a frame behind.
|
||||||
UpdateBackgroundRect();
|
UpdateBackgroundRect();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
if (_texturePropertyName != value)
|
if (_texturePropertyName != value)
|
||||||
{
|
{
|
||||||
_texturePropertyName = value;
|
_texturePropertyName = value;
|
||||||
// TODO: if the property changes, remove it from the perioud SetTexture()
|
|
||||||
_propTexture = new LazyShaderProperty(_texturePropertyName);
|
_propTexture = new LazyShaderProperty(_texturePropertyName);
|
||||||
_isDirty = true;
|
_isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
[HelpURL("https://www.renderheads.com/products/avpro-video/")]
|
[HelpURL("https://www.renderheads.com/products/avpro-video/")]
|
||||||
public sealed class ApplyToMesh : ApplyToBase
|
public sealed class ApplyToMesh : ApplyToBase
|
||||||
{
|
{
|
||||||
// TODO: add specific material / material index to target in the mesh if there are multiple materials
|
|
||||||
|
|
||||||
[Space(8f)]
|
[Space(8f)]
|
||||||
[Header("Display")]
|
[Header("Display")]
|
||||||
|
|
@ -81,7 +81,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
if (_texturePropertyName != value)
|
if (_texturePropertyName != value)
|
||||||
{
|
{
|
||||||
_texturePropertyName = value;
|
_texturePropertyName = value;
|
||||||
// TODO: if the property changes, remove it from the perioud SetTexture()
|
|
||||||
_propTexture = new LazyShaderProperty(_texturePropertyName);
|
_propTexture = new LazyShaderProperty(_texturePropertyName);
|
||||||
_isDirty = true;
|
_isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
|
|
||||||
if (_material != null)
|
if (_material != null)
|
||||||
{
|
{
|
||||||
// TODO: Only setup material when needed
|
|
||||||
VideoRender.SetupMaterialForMedia(_material, _mediaPlayer);
|
VideoRender.SetupMaterialForMedia(_material, _mediaPlayer);
|
||||||
|
|
||||||
// NOTE: It seems that Graphics.DrawTexture() behaves differently than GUI.DrawTexture() when it comes to sRGB writing
|
// NOTE: It seems that Graphics.DrawTexture() behaves differently than GUI.DrawTexture() when it comes to sRGB writing
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
if (_persistent)
|
if (_persistent)
|
||||||
{
|
{
|
||||||
// TODO: set "this.transform.root.gameObject" to also DontDestroyOnLoad?
|
|
||||||
DontDestroyOnLoad(this.gameObject);
|
DontDestroyOnLoad(this.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -520,7 +520,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
_isMediaOpened = true;
|
_isMediaOpened = true;
|
||||||
_autoPlayOnStartTriggered = !_autoPlayOnStart;
|
_autoPlayOnStartTriggered = !_autoPlayOnStart;
|
||||||
_finishedFrameOpenCheck = true;
|
_finishedFrameOpenCheck = true;
|
||||||
long fileOffset = GetPlatformFileOffset(); // TODO: replace this with MediaReference
|
long fileOffset = GetPlatformFileOffset();
|
||||||
|
|
||||||
MediaPath mediaPath = null;
|
MediaPath mediaPath = null;
|
||||||
MediaHints mediaHints = _fallbackMediaHints;
|
MediaHints mediaHints = _fallbackMediaHints;
|
||||||
|
|
@ -922,7 +922,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
_resampler = null;
|
_resampler = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: possible bug if MediaPlayers are created and destroyed manually (instantiated), OnApplicationQuit won't be called!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ForceDispose()
|
public void ForceDispose()
|
||||||
|
|
@ -1373,7 +1373,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
|
|
||||||
private void UpdateAudioFocus()
|
private void UpdateAudioFocus()
|
||||||
{
|
{
|
||||||
// TODO: we could use gizmos to draw the focus area
|
|
||||||
_controlInterface.SetAudioFocusEnabled(_audioFocusEnabled);
|
_controlInterface.SetAudioFocusEnabled(_audioFocusEnabled);
|
||||||
_controlInterface.SetAudioFocusProperties(_audioFocusOffLevelDB, _audioFocusWidthDegrees);
|
_controlInterface.SetAudioFocusProperties(_audioFocusOffLevelDB, _audioFocusWidthDegrees);
|
||||||
_controlInterface.SetAudioFocusRotation(_audioFocusTransform == null ? Quaternion.identity : _audioFocusTransform.rotation);
|
_controlInterface.SetAudioFocusRotation(_audioFocusTransform == null ? Quaternion.identity : _audioFocusTransform.rotation);
|
||||||
|
|
@ -1402,7 +1402,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
if (ErrorCode.LoadFailed == errorCode)
|
if (ErrorCode.LoadFailed == errorCode)
|
||||||
{
|
{
|
||||||
#if !UNITY_EDITOR && UNITY_ANDROID
|
#if !UNITY_EDITOR && UNITY_ANDROID
|
||||||
// TODO: Update this to handle case where media is MediaReference
|
|
||||||
if (_mediaPath.Path.ToLower().Contains("http://"))
|
if (_mediaPath.Path.ToLower().Contains("http://"))
|
||||||
{
|
{
|
||||||
Debug.LogError("Android 8 and above require HTTPS by default, change to HTTPS or enable ClearText in the AndroidManifest.xml");
|
Debug.LogError("Android 8 and above require HTTPS by default, change to HTTPS or enable ClearText in the AndroidManifest.xml");
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
public override byte[] GetOverrideDecryptionKey() { return null; }
|
public override byte[] GetOverrideDecryptionKey() { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move these to a Setup object
|
|
||||||
[SerializeField] OptionsWindows _optionsWindows = new OptionsWindows();
|
[SerializeField] OptionsWindows _optionsWindows = new OptionsWindows();
|
||||||
[SerializeField] OptionsApple _optionsMacOSX = new OptionsApple(OptionsApple.TextureFormat.BGRA, OptionsApple.Flags.None);
|
[SerializeField] OptionsApple _optionsMacOSX = new OptionsApple(OptionsApple.TextureFormat.BGRA, OptionsApple.Flags.None);
|
||||||
[SerializeField] OptionsApple _optionsIOS = new OptionsApple(OptionsApple.TextureFormat.BGRA, OptionsApple.Flags.None);
|
[SerializeField] OptionsApple _optionsIOS = new OptionsApple(OptionsApple.TextureFormat.BGRA, OptionsApple.Flags.None);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
// Handle looping
|
// Handle looping
|
||||||
if (_controlInterface.IsLooping() && _timeScaleVideoTime >= Info.GetDuration())
|
if (_controlInterface.IsLooping() && _timeScaleVideoTime >= Info.GetDuration())
|
||||||
{
|
{
|
||||||
// TODO: really we should seek to (_timeScaleVideoTime % Info.GetDuration())
|
|
||||||
_timeScaleVideoTime = 0.0;
|
_timeScaleVideoTime = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -614,8 +614,8 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
NextPlayer.AudioVolume = (1f - t) * this.AudioVolume;
|
NextPlayer.AudioVolume = (1f - t) * this.AudioVolume;
|
||||||
CurrentPlayer.AudioVolume = t * this.AudioVolume;
|
CurrentPlayer.AudioVolume = t * this.AudioVolume;
|
||||||
|
|
||||||
// TODO: support going from mono to stereo
|
|
||||||
// TODO: support videos of different aspect ratios by rendering with scaling to fit
|
|
||||||
// This can be done by blitting twice, once for each eye
|
// This can be done by blitting twice, once for each eye
|
||||||
// If the stereo mode is different for playera/b then both should be set to stereo during the transition
|
// If the stereo mode is different for playera/b then both should be set to stereo during the transition
|
||||||
// if (CurrentPlayer.m_StereoPacking == StereoPacking.TopBottom)....
|
// if (CurrentPlayer.m_StereoPacking == StereoPacking.TopBottom)....
|
||||||
|
|
@ -663,7 +663,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
#region Implementing ITextureProducer
|
#region Implementing ITextureProducer
|
||||||
public Texture GetTexture(int index = 0)
|
public Texture GetTexture(int index = 0)
|
||||||
{
|
{
|
||||||
// TODO: support iOS YCbCr by supporting multiple textures
|
|
||||||
/*if (!IsTransitioning())
|
/*if (!IsTransitioning())
|
||||||
{
|
{
|
||||||
if (_currentItem != null && _currentItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _currentItem.texture != null)
|
if (_currentItem != null && _currentItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _currentItem.texture != null)
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
double time = GetCurrentTime();
|
double time = GetCurrentTime();
|
||||||
|
|
||||||
// TODO: implement a more efficient subtitle index searcher
|
|
||||||
int searchIndex = 0;
|
int searchIndex = 0;
|
||||||
if (_currentSubtitle != null)
|
if (_currentSubtitle != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
TextTracksChanged, // Triggered when the text tracks are added or removed
|
TextTracksChanged, // Triggered when the text tracks are added or removed
|
||||||
TextCueChanged = SubtitleChange, // Triggered when the text to display changes
|
TextCueChanged = SubtitleChange, // Triggered when the text to display changes
|
||||||
|
|
||||||
// TODO:
|
|
||||||
//StartLoop, // Triggered when the video starts and is in loop mode
|
//StartLoop, // Triggered when the video starts and is in loop mode
|
||||||
//EndLoop, // Triggered when the video ends and is in loop mode
|
//EndLoop, // Triggered when the video ends and is in loop mode
|
||||||
//NewFrame // Trigger when a new video frame is available
|
//NewFrame // Trigger when a new video frame is available
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
for (int i = 0; i < areas.Length; i++)
|
for (int i = 0; i < areas.Length; i++)
|
||||||
{
|
{
|
||||||
int d = Mathf.Abs(areas[i] - area);
|
int d = Mathf.Abs(areas[i] - area);
|
||||||
// TODO: add a maximum threshold to ignore differences that are too high
|
|
||||||
if (d < minDelta)
|
if (d < minDelta)
|
||||||
{
|
{
|
||||||
closestAreaIndex = i;
|
closestAreaIndex = i;
|
||||||
|
|
@ -368,7 +368,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
frameRate = Mathf.Max(0f, frameRate);
|
frameRate = Mathf.Max(0f, frameRate);
|
||||||
keyFrameInterval = Mathf.Max(0, keyFrameInterval);
|
keyFrameInterval = Mathf.Max(0, keyFrameInterval);
|
||||||
int currentFrame = Helper.ConvertTimeSecondsToFrame(seconds, frameRate);
|
int currentFrame = Helper.ConvertTimeSecondsToFrame(seconds, frameRate);
|
||||||
// TODO: allow specifying a minimum number of frames so that if currentFrame is too close to nextKeyFrame, it will calculate the next-next keyframe
|
|
||||||
int nextKeyFrame = keyFrameInterval * Mathf.CeilToInt((float)(currentFrame + 1) / (float)keyFrameInterval);
|
int nextKeyFrame = keyFrameInterval * Mathf.CeilToInt((float)(currentFrame + 1) / (float)keyFrameInterval);
|
||||||
return Helper.ConvertFrameToTimeSeconds(nextKeyFrame, frameRate);
|
return Helper.ConvertFrameToTimeSeconds(nextKeyFrame, frameRate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace RenderHeads.Media.AVProVideo
|
namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Android implementation of BaseMediaPlayer
|
/// Android implementation of BaseMediaPlayer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// TODO: seal this class
|
|
||||||
public class AndroidMediaPlayer : BaseMediaPlayer
|
public class AndroidMediaPlayer : BaseMediaPlayer
|
||||||
{
|
{
|
||||||
protected static AndroidJavaObject s_ActivityContext = null;
|
protected static AndroidJavaObject s_ActivityContext = null;
|
||||||
|
|
|
||||||
|
|
@ -670,7 +670,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
int textureId = 80000 + _playerIndex;
|
int textureId = 80000 + _playerIndex;
|
||||||
_cachedTextureNativePtr = new System.IntPtr(textureId);
|
_cachedTextureNativePtr = new System.IntPtr(textureId);
|
||||||
AVPPlayerCreateVideoTexture(textureId);
|
AVPPlayerCreateVideoTexture(textureId);
|
||||||
// TODO: add support for mip generation
|
|
||||||
_texture = Texture2D.CreateExternalTexture(_width, _height, TextureFormat.RGBA32, false, false, _cachedTextureNativePtr);
|
_texture = Texture2D.CreateExternalTexture(_width, _height, TextureFormat.RGBA32, false, false, _cachedTextureNativePtr);
|
||||||
if (_useTextureMips)
|
if (_useTextureMips)
|
||||||
{
|
{
|
||||||
|
|
@ -743,7 +743,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
// Update the texture
|
// Update the texture
|
||||||
if (_cachedTextureNativePtr != System.IntPtr.Zero)
|
if (_cachedTextureNativePtr != System.IntPtr.Zero)
|
||||||
{
|
{
|
||||||
// TODO: only update the texture when the frame count changes
|
|
||||||
// (actually this will break the update for certain browsers such as edge and possibly safari - Sunrise)
|
// (actually this will break the update for certain browsers such as edge and possibly safari - Sunrise)
|
||||||
AVPPlayerFetchVideoTexture(_playerIndex, _cachedTextureNativePtr, false);
|
AVPPlayerFetchVideoTexture(_playerIndex, _cachedTextureNativePtr, false);
|
||||||
|
|
||||||
|
|
@ -767,7 +767,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
_isDirtyAudioTracks = false;
|
_isDirtyAudioTracks = false;
|
||||||
_isDirtyTextTracks = false;
|
_isDirtyTextTracks = false;
|
||||||
|
|
||||||
// TODO: replace this crude polling check with events, or only do it once metadataReady
|
|
||||||
// Need to add event support as tracks can be added via HTML (especially text)
|
// Need to add event support as tracks can be added via HTML (especially text)
|
||||||
int videoTrackCount = AVPPlayerGetVideoTrackCount(_playerIndex);
|
int videoTrackCount = AVPPlayerGetVideoTrackCount(_playerIndex);
|
||||||
int audioTrackCount = AVPPlayerGetAudioTrackCount(_playerIndex);
|
int audioTrackCount = AVPPlayerGetAudioTrackCount(_playerIndex);
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: run without vsync, just show next frame (use media clock for present?)
|
|
||||||
// use our own clock...
|
// use our own clock...
|
||||||
const double SecondsToHNS = 10000000.0;
|
const double SecondsToHNS = 10000000.0;
|
||||||
double videoFrameDuration = SecondsToHNS / (double)GetVideoFrameRate();
|
double videoFrameDuration = SecondsToHNS / (double)GetVideoFrameRate();
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
Native.SetAudioMuted(_playerInstance, bMuted);
|
Native.SetAudioMuted(_playerInstance, bMuted);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace all these options with a structure
|
|
||||||
public override bool OpenMedia(string path, long offset, string httpHeader, MediaHints mediaHints, int forceFileFormat = 0, bool startWithHighestBitrate = false)
|
public override bool OpenMedia(string path, long offset, string httpHeader, MediaHints mediaHints, int forceFileFormat = 0, bool startWithHighestBitrate = false)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
@ -371,13 +371,13 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
if (isNewFrameSpecs)
|
if (isNewFrameSpecs)
|
||||||
{
|
{
|
||||||
eyeTexture.Dispose();
|
eyeTexture.Dispose();
|
||||||
// TODO: blit from the old texture to the new texture before destroying?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Switch to the latest texture pointer
|
/// Switch to the latest texture pointer
|
||||||
if (eyeTexture.texture != null)
|
if (eyeTexture.texture != null)
|
||||||
{
|
{
|
||||||
// TODO: check whether UpdateExternalTexture resets the sampling filter to POINT - it seems to in Unity 5.6.6
|
|
||||||
if (eyeTexture.nativePointer != texturePointer)
|
if (eyeTexture.nativePointer != texturePointer)
|
||||||
{
|
{
|
||||||
eyeTexture.texture.UpdateExternalTexture(texturePointer);
|
eyeTexture.texture.UpdateExternalTexture(texturePointer);
|
||||||
|
|
@ -762,7 +762,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
Fast = 0,
|
Fast = 0,
|
||||||
Accurate = 1,
|
Accurate = 1,
|
||||||
// TODO: Add Fast_Before and Fast_After
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
|
|
@ -774,7 +774,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
public float frameRate;
|
public float frameRate;
|
||||||
public uint averageBitRate;
|
public uint averageBitRate;
|
||||||
//public string trackName;
|
//public string trackName;
|
||||||
// TODO: add index, language, name, bitrate, codec etc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
|
|
@ -786,7 +786,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
public uint bitsPerSample;
|
public uint bitsPerSample;
|
||||||
public uint averageBitRate;
|
public uint averageBitRate;
|
||||||
//public string trackName;
|
//public string trackName;
|
||||||
// TODO: add index, language, name, bitrate, codec etc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
|
|
@ -794,7 +794,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
public double timeSeconds;
|
public double timeSeconds;
|
||||||
public SeekMode mode;
|
public SeekMode mode;
|
||||||
// TODO: add min-max thresholds
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("AVProVideoWinRT")]
|
[DllImport("AVProVideoWinRT")]
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: check via regular expression
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
_outputTexture[i].filterMode = tex.filterMode;
|
_outputTexture[i].filterMode = tex.filterMode;
|
||||||
_outputTexture[i].wrapMode = tex.wrapMode;
|
_outputTexture[i].wrapMode = tex.wrapMode;
|
||||||
_outputTexture[i].anisoLevel = tex.anisoLevel;
|
_outputTexture[i].anisoLevel = tex.anisoLevel;
|
||||||
// TODO: set up the mips level too?
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -503,8 +503,8 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render resolve blit
|
// Render resolve blit
|
||||||
// TODO: combine these two paths into a single material blit
|
|
||||||
{
|
|
||||||
bool prevSRGB = GL.sRGBWrite;
|
bool prevSRGB = GL.sRGBWrite;
|
||||||
GL.sRGBWrite = targetTexture.sRGB;
|
GL.sRGBWrite = targetTexture.sRGB;
|
||||||
RenderTexture prev = RenderTexture.active;
|
RenderTexture prev = RenderTexture.active;
|
||||||
|
|
@ -524,7 +524,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
}
|
}
|
||||||
RenderTexture.active = prev;
|
RenderTexture.active = prev;
|
||||||
GL.sRGBWrite = prevSRGB;
|
GL.sRGBWrite = prevSRGB;
|
||||||
}
|
|
||||||
|
|
||||||
return targetTexture;
|
return targetTexture;
|
||||||
}
|
}
|
||||||
|
|
@ -565,7 +565,7 @@ namespace RenderHeads.Media.AVProVideo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: take into account rotation
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool RequiresResolve(ITextureProducer texture)
|
public static bool RequiresResolve(ITextureProducer texture)
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ namespace NaughtyAttributes.Editor
|
||||||
{
|
{
|
||||||
Undo.RecordObject(serializedObject.targetObject, "Dropdown");
|
Undo.RecordObject(serializedObject.targetObject, "Dropdown");
|
||||||
|
|
||||||
// TODO: Problem with structs, because they are value type.
|
|
||||||
// The solution is to make boxing/unboxing but unfortunately I don't know the compile time type of the target object
|
// The solution is to make boxing/unboxing but unfortunately I don't know the compile time type of the target object
|
||||||
dropdownField.SetValue(target, newValue);
|
dropdownField.SetValue(target, newValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue