GithubHelp home page GithubHelp logo

jiang6777 / metal_learn Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 27.73 MB

This project realizes the rendering of real-time video stream through Metal, and the rendered video stream supports NV12, NV21, RGB, BGR and other video formats.

Objective-C 9.99% C 3.04% C++ 86.96%

metal_learn's Introduction

Metal_Learn

This project realizes the rendering of real-time video stream through Metal, and the rendered video stream supports NV12, NV21, RGB, BGR and other video formats,Although the Metal rendering of this project only shows the rendering of the camera on the Mac platform, the iOS platform is also supported.

Ideas

In order to be compatible with many video frame formats, in CVTI420Buffer, I will convert YUV420, RGB and other data formats to I420 through the newI420Frame and toI420 methods, and then render the Y, U, V planes in Metal. This example is rendered by collecting data from a Mac computer camera.

Usage

The specific usage of tmalview is as follows:

if ([CVTMetalView isMetalAvailable]) {

     CGFloat height = self. view. frame. size. width * 9 / 16.0;

     self. metalView = [[CVTMetalView alloc] initWithFrame:NSMakeRect(0, 0, self.view.frame.size.width, height)];

     self. metalView. delegate = self;

     self. metalView. wantsLayer = YES;

     self. metalView. layer. backgroundColor = [NSColor blackColor]. CGColor;

     [self.view addSubview:self.metalView];

 }

Achievement display

Metal icon

End

If you find any problems during use, please send me an email message [email protected], it is not easy to create, if you think it can help you, I hope you can appreciate it, thank you

My QR code

metal_learn's People

Contributors

jiang6777 avatar

Stargazers

 avatar  avatar  avatar zhangjixiong avatar  avatar  avatar juvham avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

hejiangshan1991

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.