Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVPlayerItemVideoOutput.CopyPixelBuffer missing/broken #21702

Open
kiddkaffeine opened this issue Nov 27, 2024 · 0 comments
Open

AVPlayerItemVideoOutput.CopyPixelBuffer missing/broken #21702

kiddkaffeine opened this issue Nov 27, 2024 · 0 comments

Comments

@kiddkaffeine
Copy link

kiddkaffeine commented Nov 27, 2024

Apple platform

iOS, macOS

Framework version

net9.0-*

Affected platform version

9.0.100

Description

In Objective C, AVPlayerItemVideoOutput has a method called "CopyPixelBuffer", and the documentation suggests a similar version exists in C#:
https://learn.microsoft.com/en-us/dotnet/api/avfoundation.avplayeritemvideooutput.copypixelbuffer?view=xamarin-ios-sdk-12#avfoundation-avplayeritemvideooutput-copypixelbuffer(coremedia-cmtime-coremedia-cmtime@)

However, this method does not appear to exist.
1>TestFile.cs(55,25): Error CS1061 : 'AVPlayerItemVideoOutput' does not contain a definition for 'CopyPixelBuffer' and no accessible extension method 'CopyPixelBuffer' accepting a first argument of type 'AVPlayerItemVideoOutput' could be found (are you missing a using directive or an assembly reference?)

Using Rider to drill into the class, there does appear to be a method called "WeakCopyPixelBuffer" which returns an IntPtr but this method is protected and thus inaccessible.

Steps to Reproduce

  1. Create a net9.0-macos project
  2. Create an AVPlayerItemVideoOutput and attempt to invoke CopyPixelBuffer, eg
    videoOutput = new AVPlayerItemVideoOutput(); CMTime itemTime = videoOutput.GetItemTime((double)DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond); // CACurrentMediaTime()? videoOutput.CopyPixelBuffer(itemTime, null);

Did you find any workaround?

None so far.

I did find this in the repo:

public CVPixelBuffer? CopyPixelBuffer (CMTime itemTime, ref CMTime outItemTimeForDisplay)

And tried to replicate it with reflection, but it appears to call a constructor for CVPixelBuffer which doesn't exist?

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant