Git Product home page Git Product logo

hap-quicktime-playback-demo's Introduction

Hap QuickTime Playback Demo

A demonstration of GPU-accelerated playback of Hap movies using the QuickTime codec.

Hap is a video codec for fast decompression on modern graphics hardware. For general information about Hap, see the Hap project.

Accelerated Playback

Accelerated playback of Hap involves passing S3TC frames to graphics hardware using OpenGL. The Hap codec will emit S3TC frames when an application indicates it can handle them. This is done using the usual QuickTime playback mechanisms and if you are already using QuickTime the code overhead to support Hap is fairly low.

The Hap QuickTime codec must be installed.

The steps are

  1. Open a movie and examine its video track to confirm it is Hap
  2. Create a QTPixelBufferContext for playback using a list of custom pixel-format type constants
  3. Play the movie
  4. When you receive a frame, perform compressed texture upload using OpenGL
  5. If the movie is encoded with Hap Q, use a shader when you draw the texture

This example includes reusable code to aid the process. Steps 1. and 2. utilise

HapSupport.h
HapSupport.c

Steps 4. and 5. utilise

HapPixelBufferTexture.h
HapPixelBufferTexture.m
ScaledCoCgYToRGBA.vert
ScaledCoCgYToRGBA.frag

Further Reading

Open-Source

This code is open-source, licensed under a Free BSD License, meaning you can use it in your commercial or non-commercial applications free of charge.

This project was originally written by Tom Butterworth and commissioned by VIDVOX, 2012.

hap-quicktime-playback-demo's People

Contributors

bangnoise avatar dlublin avatar

Watchers

Joseph Laurino avatar James Cloos avatar

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.