Closed Bug 1191534 Opened 9 years ago Closed 9 years ago

Implement GLBlitHelper::BlitImageToFramebuffer for MacIOSurfaceImage

Categories

(Core :: General, defect)

29 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When we're using hardware decoding on OSX we can directly copy the video frames into WebGL without readback, we should do this.
I also follow this bug. I find that depends on video format. On this demo, http://threejs.org/examples/#vr_video, it will enable BlitImageToFramebuffer because its image type is PLANAR_YCBCR. For other demos, like this one, http://mozvr.github.io/loops/20150727_cubes/index.html, it uses MacIOSurfaceImage. Anyway, I think probably I can help contribute to this bug.
Creating and deleting the textures each time probably isn't ideal, but we don't have a great way of unbinding the IOSurface without doing so.

Leaving it bound will hold a reference internally and prevent VideoToolkit from recycling the surface (until we draw another frame).
Assignee: nobody → matt.woodrow
Attachment #8646509 - Flags: review?(jgilbert)
Comment on attachment 8646509 [details] [diff] [review]
Implement BlitImageToFramebuffer for IOSurface

Review of attachment 8646509 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/GLBlitHelper.h
@@ +157,5 @@
>      bool BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage);
>      bool BlitEGLImageImage(layers::EGLImageImage* eglImage);
>  #endif
> +#ifdef XP_MACOSX
> +    bool BlitMacIOSurfaceImage(layers::MacIOSurfaceImage* ioImage);

Avoid ifdefing decls. Instead ifdef the definitions, MOZ_CRASHing when ifndef.

This allows calling code to not become polluted with ifdefs.

I suppose this is 'protected' anyway, so it doesn't matter so much.
Attachment #8646509 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/mozilla-central/rev/8faa9fe21d15
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: